AC-502 home page widgets should now show 0 rather than ' ' for empty values.

This commit is contained in:
Chris Houseknecht 2013-11-12 16:20:24 +00:00
parent 4e93a5c6e2
commit 68286074cf
3 changed files with 17 additions and 6 deletions

View File

@ -13,7 +13,11 @@ angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities'])
return function(params) {
var scope = $rootScope.$new();
var inventoryCount, inventoryFails, groupCount, groupFails, hostCount;
var inventoryCount = 0;
var inventoryFails = 0;
var groupCount = 0;
var groupFails = 0;
var hostCount = 0;
var hostFails = 0;
var counts = 0;
var expectedCounts = 5;
@ -34,10 +38,10 @@ angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities'])
html += (label == 'Hosts' || label == 'Groups') ? " class=\"pad-left-sm\" " : "";
html += ">" + label + "</a></td>\n";
html += "<td class=\"failed-column text-right\">";
html += (fail > 0) ? "<a href=\"/blah/blah\">" + fail + "</a>" : "";
html += "<a href=\"/blah/blah\">" + fail + "</a>";
html += "</td>\n";
html += "<td class=\"text-right\">";
html += (count > 0) ? "<a href=\"/blah/blah\">" + count + "</a>" : "";
html += "<a href=\"/blah/blah\">" + count + "</a>";
html += "</td></tr>\n";
return html;
}

View File

@ -13,7 +13,14 @@ angular.module('JobStatusWidget', ['RestServices', 'Utilities'])
return function(params) {
var scope = $rootScope.$new();
var jobCount, jobFails, inventoryCount, inventoryFails, groupCount, groupFails, hostCount, hostFails;
var jobCount = 0;
var jobFails = 0;
var inventoryCount = 0;
var inventoryFails = 0;
var groupCount = 0;
var groupFails = 0;
var hostCount = 0;
var hostFails = 0;
var counts = 0;
var expectedCounts = 8;
var target = params.target;

View File

@ -36,10 +36,10 @@ angular.module('SCMSyncStatusWidget', ['RestServices', 'Utilities'])
var html = ''
html += "<tr><td><a href=\"/#/projects/?source_type=" + value + "\">" + label + "</a></td>\n";
html += "<td class=\"failed-column text-right\">";
html += (fail > 0) ? "<a href=\"/blah/blah\">" + fail + "</a>" : "";
html += "<a href=\"/blah/blah\">" + fail + "</a>";
html += "</td>\n";
html += "<td class=\"text-right\">";
html += (count > 0) ? "<a href=\"/blah/blah\">" + count + "</a>" : "";
html += "<a href=\"/blah/blah\">" + count + "</a>";
html += "</td>\n";
html += "</tr>\n";
return html;