Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Commit

Permalink
Cherry-picked from merid14/zabbixweb:patch-1. Merges #27.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Letson committed Feb 9, 2016
1 parent 0f2bd9c commit 64ab103
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ <h4 class="modal-title" id="Settings">Settings</h4>

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",
Expand Down Expand Up @@ -210,6 +211,13 @@ <h4 class="modal-title" id="Settings">Settings</h4>
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);
Expand Down Expand Up @@ -362,13 +370,7 @@ <h4 class="modal-title" id="Settings">Settings</h4>
} 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 <div class="row"></div> surrounding each row for better layout.
hostsCount++;

Expand Down

0 comments on commit 64ab103

Please sign in to comment.