mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 20:20:06 -03:30
Inventory sync group totals are now derived by summing counts for inventory sources. Cleaned up summation process in scm sync.
This commit is contained in:
@@ -47,7 +47,7 @@ angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities'])
|
|||||||
html += "</td></tr>\n";
|
html += "</td></tr>\n";
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
html += makeRow({ label: 'Inventories',
|
html += makeRow({ label: 'Inventories',
|
||||||
count: [(dashboard.inventories && dashboard.inventories.total_with_inventory_source) ?
|
count: [(dashboard.inventories && dashboard.inventories.total_with_inventory_source) ?
|
||||||
dashboard.inventories.total_with_inventory_source : '?'],
|
dashboard.inventories.total_with_inventory_source : '?'],
|
||||||
@@ -56,9 +56,18 @@ angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities'])
|
|||||||
fail_link: '/#/inventories/?inventory_sources_with_failures=true'
|
fail_link: '/#/inventories/?inventory_sources_with_failures=true'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var group_total = 0;
|
||||||
|
var group_fail = 0;
|
||||||
|
if (dashboard.inventory_sources) {
|
||||||
|
for (var src in dashboard.inventory_sources) {
|
||||||
|
group_total += (dashboard.inventory_sources[src].total) ? dashboard.inventory_sources[src].total : 0;
|
||||||
|
group_fail += (dashboard.inventory_sources[src].failed) ? dashboard.inventory_sources[src].failed : 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
html += makeRow({ label: 'Groups',
|
html += makeRow({ label: 'Groups',
|
||||||
count: [(dashboard.groups && dashboard.groups.total_with_inventory_source) ? dashboard.groups.total_with_inventory_source : '?'],
|
count: group_total,
|
||||||
fail: [(dashboard.groups && dashboard.groups.inventory_failed) ? dashboard.groups.inventory_failed : 0],
|
fail: group_fail,
|
||||||
link: '/#/home/groups/?has_external_source=true',
|
link: '/#/home/groups/?has_external_source=true',
|
||||||
fail_link: '/#/home/groups/?status=failed'
|
fail_link: '/#/home/groups/?status=failed'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -47,13 +47,16 @@ angular.module('SCMSyncStatusWidget', ['RestServices', 'Utilities'])
|
|||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tot = 0;
|
var total_count = 0;
|
||||||
for (var type in dashboard.scm_types) {
|
if (dashboard.scm_types) {
|
||||||
tot += dashboard.scm_types[type].total;
|
for (var type in dashboard.scm_types) {
|
||||||
|
total_count += (dashboard.scm_types[type].total) ? dashboard.scm_types[type].total : 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
html += makeRow({ label: 'Projects',
|
html += makeRow({ label: 'Projects',
|
||||||
link: '/#/projects',
|
link: '/#/projects',
|
||||||
count: tot,
|
count: total_count,
|
||||||
fail: [(dashboard.projects && dashboard.projects.failed) ? dashboard.projects.failed : 0],
|
fail: [(dashboard.projects && dashboard.projects.failed) ? dashboard.projects.failed : 0],
|
||||||
fail_link: '/#/projects/?status=failed'
|
fail_link: '/#/projects/?status=failed'
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user