mirror of
https://github.com/ansible/awx.git
synced 2026-03-10 05:59:28 -02:30
Added support for long node names on tree. Fixed tree styling issues. Fixed node copy. Fixed tree collapse/expand bug. Added dynamic tooltips to the status icon that account for inventory updates and jobs, giving precedence to inventory updates.
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
'use strict';
|
||||
|
||||
function Home ($routeParams, $scope, $rootScope, $location, Wait, ObjectCount, JobStatus, InventorySyncStatus, SCMSyncStatus,
|
||||
ClearScope)
|
||||
{
|
||||
ClearScope) {
|
||||
|
||||
ClearScope('home'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||
//scope.
|
||||
|
||||
@@ -36,7 +36,7 @@ function Home ($routeParams, $scope, $rootScope, $location, Wait, ObjectCount, J
|
||||
Wait('stop');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Home.$inject=[ '$routeParams', '$scope', '$rootScope', '$location', 'Wait', 'ObjectCount', 'JobStatus', 'InventorySyncStatus',
|
||||
'SCMSyncStatus', 'ClearScope'];
|
||||
@@ -41,29 +41,30 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
|
||||
scope.inventories[i].failed_hosts = scope.inventories[i].hosts_with_active_failures + ' / ' + scope.inventories[i].total_hosts;
|
||||
if (scope.inventories[i].hosts_with_active_failures > 0) {
|
||||
scope.inventories[i].failed_hosts_tip = "Contains " + scope.inventories[i].hosts_with_active_failures +
|
||||
[ (scope.inventories[i].hosts_with_active_failures == 1) ? ' host' : ' hosts' ] + ' where the latest job failed. Click to view the ' +
|
||||
[ (scope.inventories[i].hosts_with_active_failures == 1) ? ' offending host.' : ' hosts with failed jobs.' ];
|
||||
[ (scope.inventories[i].hosts_with_active_failures == 1) ? ' host' : ' hosts' ] + ' with job failures. Click to view the offending ' +
|
||||
[ (scope.inventories[i].hosts_with_active_failures == 1) ? ' host' : ' hosts' ] + '.';
|
||||
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts?has_active_failures=true';
|
||||
scope.inventories[i].failed_hosts_class = 'true';
|
||||
}
|
||||
else {
|
||||
if (scope.inventories[i].total_hosts == 0) {
|
||||
// no hosts
|
||||
scope.inventories[i].failed_hosts_tip = "There are no hosts in this inventory. It's a sad empty shell. Click to view the hosts page and add a host.";
|
||||
scope.inventories[i].failed_hosts_tip = "There are no hosts in this inventory. It's a sad empty shell. Click to view the hosts page " +
|
||||
"and add a host.";
|
||||
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts';
|
||||
scope.inventories[i].failed_hosts_class = 'na';
|
||||
}
|
||||
else if (scope.inventories[i].total_hosts == 1) {
|
||||
// on host with 0 failures
|
||||
scope.inventories[i].failed_hosts_tip = "The 1 host contained in this inventory does not have a current job failure. It's happy!" +
|
||||
scope.inventories[i].failed_hosts_tip = "The 1 host found in this inventory is happy! There are no job failures." +
|
||||
" Click to view the host.";
|
||||
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts';
|
||||
scope.inventories[i].failed_hosts_class = 'false';
|
||||
}
|
||||
else {
|
||||
// many hosts with 0 failures
|
||||
scope.inventories[i].failed_hosts_tip = "All " + scope.inventories[i].total_hosts + " hosts are happy! None of them have " +
|
||||
" a recent job failure. Click to view the hosts.";
|
||||
scope.inventories[i].failed_hosts_tip = "All " + scope.inventories[i].total_hosts + " hosts are happy! There are no" +
|
||||
" job failures. Click to view the hosts.";
|
||||
scope.inventories[i].failed_hosts_link = '/#/inventories/' + scope.inventories[i].id + '/hosts';
|
||||
scope.inventories[i].failed_hosts_class = 'false';
|
||||
}
|
||||
@@ -73,31 +74,31 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
|
||||
scope.inventories[i].status = scope.inventories[i].inventory_sources_with_failures + ' / ' + scope.inventories[i].total_inventory_sources;
|
||||
if (scope.inventories[i].inventory_sources_with_failures > 0) {
|
||||
scope.inventories[i].status_tip = "Contains " + scope.inventories[i].inventory_sources_with_failures +
|
||||
[ (scope.inventories[i].inventory_sources_with_failures == 1) ? ' group' : ' groups' ] + ' where the latest inventory update failed. ' +
|
||||
[ (scope.inventories[i].inventory_sources_with_failures == 1) ? ' group' : ' groups' ] + ' with inventory update failures. ' +
|
||||
'Click to view the ' +
|
||||
[ (scope.inventories[i].inventory_sources_with_failures == 1) ? ' offending group.' : ' groups with failures.' ];
|
||||
[ (scope.inventories[i].inventory_sources_with_failures == 1) ? ' offending group.' : ' groups.' ];
|
||||
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups?status=failed';
|
||||
scope.inventories[i].status_class = 'failed';
|
||||
}
|
||||
else {
|
||||
if (scope.inventories[i].total_inventory_sources == 0) {
|
||||
// no groups are reporting a source
|
||||
scope.inventories[i].status_tip = "There are no groups configured for an external inventory source. Click to view groups and " +
|
||||
scope.inventories[i].status_tip = "Does not have an external inventory source. Click to view groups and " +
|
||||
"and add an inventory source.";
|
||||
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups';
|
||||
scope.inventories[i].status_class = 'na';
|
||||
}
|
||||
else if (scope.inventories[i].total_inventory_sources == 1) {
|
||||
// on host with 0 failures
|
||||
scope.inventories[i].status_tip = "The 1 group configured with an inventory source was updated successfully. It's happy!" +
|
||||
scope.inventories[i].status_tip = "The 1 group with an inventory source is happy!. No updates have failed." +
|
||||
" Click to view the group.";
|
||||
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups?has_external_source=true';
|
||||
scope.inventories[i].status_class = 'successful';
|
||||
}
|
||||
else {
|
||||
// many hosts with 0 failures
|
||||
scope.inventories[i].status_tip = "The " + scope.inventories[i].total_inventory_sources + " groups with an inventory source are happy! " +
|
||||
" The most recent update of each group was successful. Click to view the groups.";
|
||||
scope.inventories[i].status_tip = scope.inventories[i].total_inventory_sources + " groups external inventory sources are happy! " +
|
||||
" No updates have failed. Click to view the groups.";
|
||||
scope.inventories[i].status_link = '/#/inventories/' + scope.inventories[i].id + '/groups?has_external_source=true';
|
||||
scope.inventories[i].status_class = 'successful';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user