From 64ab103b27ab5b1fae2536f1b0899ac1d845f06e Mon Sep 17 00:00:00 2001 From: Andrew Letson Date: Tue, 9 Feb 2016 13:12:40 -0500 Subject: [PATCH] Cherry-picked from merid14/zabbixweb:patch-1. Merges #27. --- index.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 92c5e65..4a796fa 100644 --- a/index.html +++ b/index.html @@ -172,6 +172,7 @@ function getHostsFromZabbix(zabbix) { return zabbix.call('host.get', { + //"monitored_hosts": true, //Only display hosts that are enabled (status=enabled) in Zabbix "selectInventory": true, "selectItems": [ "name", @@ -210,6 +211,13 @@ function filterHostsAndOutput(hosts) { var anError = 0; var hostsCount = 0; + + if($("input:radio[name=view-grid-cols]:checked").val()) { + columnWidth = $('input:radio[name=view-grid-cols]:checked').val(); //If a value has been selected for the grid view + } else if ($('input:radio[name=view-select]:checked').val() == 'grid') { + columnWidth = 3; //If the grid view is selected but no value has been assigned for view-grid-cols + } + $('#hosts-list').empty(); $.each(hosts, function() { var thisHost = $(this); @@ -362,13 +370,7 @@ } else { diskUsageClass = 'panel-default'; } - //TODO Move this outside of the loop; it should only be set once. - if($("input:radio[name=view-grid-cols]:checked").val()) { - columnWidth = $('input:radio[name=view-grid-cols]:checked').val(); //If a value has been selected for the grid view - } else if ($('input:radio[name=view-select]:checked').val() == 'grid') { - columnWidth = 3; //If the grid view is selected but no value has been assigned for view-grid-cols - } //TODO Check hostsCount % columnWidth to add
surrounding each row for better layout. hostsCount++;