puppetboard/app.py: Adding Radiator view (#232)
* puppetboard/app.py: Adding Radiator view Part 2 of https://github.com/voxpupuli/puppetboard/issues/70 This is a refactoring of the changes in https://github.com/voxpupuli/puppetboard/pull/100. Adds a simple Heads-Up Display of the last run statuses of managed nodes, either environment filtered or not. * puppetboard/app.py: Fixing environment filters and metric strings. * The names of the population metrics have changes in PuppetDB 4.0, the initial commit used the metric names from PuppetDB 2.x. * The main nodes query did not include a query string to filter on environments.
This commit is contained in:
21
puppetboard/static/js/radiator.js
Normal file
21
puppetboard/static/js/radiator.js
Normal file
@@ -0,0 +1,21 @@
|
||||
function resizeMe() {
|
||||
var preferredHeight = 944;
|
||||
var displayHeight = $(window).height();
|
||||
var percentageHeight = displayHeight / preferredHeight;
|
||||
|
||||
var preferredWidth = 1100;
|
||||
var displayWidth = $(window).width();
|
||||
var percentageWidth = displayWidth / preferredWidth;
|
||||
|
||||
var newFontSize;
|
||||
if (percentageHeight < percentageWidth) {
|
||||
newFontSize = Math.floor("960" * percentageHeight) - 30;
|
||||
} else {
|
||||
newFontSize = Math.floor("960" * percentageWidth) - 30;
|
||||
}
|
||||
$("body").css("font-size", newFontSize + "%")
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$(window).on('resize', resizeMe).trigger('resize');
|
||||
})
|
||||
Reference in New Issue
Block a user