mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 04:15:02 -02:30
AC-503 Latest dashboard progress.
This commit is contained in:
@@ -18,13 +18,24 @@ angular.module('JobStatusWidget', ['RestServices', 'Utilities'])
|
||||
var expectedCounts = 8;
|
||||
var target = params.target;
|
||||
|
||||
scope.$on('CountReceived', function() {
|
||||
if (scope.removeCountReceived) {
|
||||
scope.removeCountReceived();
|
||||
}
|
||||
scope.removeCountReceived = scope.$on('CountReceived', function() {
|
||||
|
||||
var rowcount = 0;
|
||||
|
||||
function makeRow(label, count, fail) {
|
||||
return "<tr><td><a href=\"/#/" + label.toLowerCase() + "\">" + label +
|
||||
"</a></td><td class=\"failed-column text-right\"><a href=\"/blah/blah\">" +
|
||||
fail + "</a></td><td class=\"text-right\"><a href=\"/blah/blah\">" +
|
||||
count + "</a></td></tr>";
|
||||
var html = '';
|
||||
html += "<tr>\n";
|
||||
html += "<td><a href=\"/#/" + label.toLowerCase() + "\">" + label + "</a></td>\n";
|
||||
html += "<td class=\"failed-column text-right\">";
|
||||
html += (fail > 0) ? "<a href=\"/blah/blah\">" + fail + "</a>" : "";
|
||||
html += "</td>\n";
|
||||
html += "<td class=\"text-right\">"
|
||||
html += (count > 0) ? "<a href=\"/blah/blah\">" + count + "</a>" : "";
|
||||
html += "</td></tr>\n";
|
||||
return html;
|
||||
}
|
||||
|
||||
counts++;
|
||||
@@ -36,27 +47,45 @@ angular.module('JobStatusWidget', ['RestServices', 'Utilities'])
|
||||
html += "<table class=\"table table-condensed table-hover\">\n";
|
||||
html += "<thead>\n";
|
||||
html += "<tr>\n";
|
||||
html += "<th></th>\n";
|
||||
html += "<th class=\"text-right\">Failed</th>\n";
|
||||
html += "<th class=\"text-right\">Total</th>\n";
|
||||
html += "<th class=\"col-md-4 col-lg-3\"></th>\n";
|
||||
html += "<th class=\"col-md-2 col-lg-1 text-right\">Failed</th>\n";
|
||||
html += "<th class=\"col-md-2 col-lg-1 text-right\">Total</th>\n";
|
||||
html += "</tr>\n";
|
||||
html += "</thead>\n";
|
||||
html += "<tbody>\n";
|
||||
html += makeRow('Jobs', jobCount, jobFails);
|
||||
html += makeRow('Inventories', inventoryCount, inventoryFails);
|
||||
html += makeRow('Groups', groupCount, groupFails);
|
||||
html += makeRow('Hosts', hostCount, hostFails);
|
||||
|
||||
if (jobCount > 0) {
|
||||
html += makeRow('Jobs', jobCount, jobFails);
|
||||
rowcount++;
|
||||
}
|
||||
if (inventoryCount > 0) {
|
||||
html += makeRow('Inventories', inventoryCount, inventoryFails);
|
||||
rowcount++;
|
||||
}
|
||||
if (groupCount > 0) {
|
||||
html += makeRow('Groups', groupCount, groupFails);
|
||||
rowcount++;
|
||||
}
|
||||
if (hostCount > 0) {
|
||||
html += makeRow('Hosts', hostCount, hostFails);
|
||||
rowcount++;
|
||||
}
|
||||
|
||||
if (rowcount == 0) {
|
||||
html += "<tr><td colspan=\"3\">No job data found</td></tr>\n";
|
||||
}
|
||||
|
||||
html += "</tbody>\n";
|
||||
html += "</table>\n";
|
||||
html += "</div>\n";
|
||||
html += "</div>\n";
|
||||
html += "</div>\n";
|
||||
}
|
||||
|
||||
var element = angular.element(document.getElementById(target));
|
||||
element.html(html);
|
||||
$compile(element)(scope);
|
||||
$rootScope.$emit('WidgetLoaded');
|
||||
var element = angular.element(document.getElementById(target));
|
||||
element.html(html);
|
||||
$compile(element)(scope);
|
||||
$rootScope.$emit('WidgetLoaded');
|
||||
}
|
||||
});
|
||||
|
||||
var url = GetBasePath('jobs') + '?page=1';
|
||||
|
||||
Reference in New Issue
Block a user