mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 19:07:36 -02:30
AC-502 added group ID as a parameter on 'job failure' links from /home/hosts. This causes the tree to load with the appropriate group selected.
This commit is contained in:
@@ -75,7 +75,8 @@ function HomeGroups ($location, $routeParams, HomeGroupList, GenerateList, Proce
|
|||||||
msg = HostsStatusMsg({
|
msg = HostsStatusMsg({
|
||||||
active_failures: scope.groups[i].hosts_with_active_failures,
|
active_failures: scope.groups[i].hosts_with_active_failures,
|
||||||
total_hosts: scope.groups[i].total_hosts,
|
total_hosts: scope.groups[i].total_hosts,
|
||||||
inventory_id: scope.groups[i].inventory
|
inventory_id: scope.groups[i].inventory,
|
||||||
|
group_id: scope.groups[i].id
|
||||||
});
|
});
|
||||||
|
|
||||||
update_status = UpdateStatusMsg({ status: scope.groups[i].summary_fields.inventory_source.status });
|
update_status = UpdateStatusMsg({ status: scope.groups[i].summary_fields.inventory_source.status });
|
||||||
|
|||||||
@@ -137,13 +137,26 @@ function InventoryHosts ($scope, $rootScope, $compile, $location, $log, $routePa
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Load the tree. See TreeSelector.js
|
// Load the tree. See TreeSelector.js
|
||||||
BuildTree({
|
var group_id = ($routeParams['group'] !== undefined) ? $routeParams['group'] : null;
|
||||||
scope: scope,
|
if (group_id !== null) {
|
||||||
inventory_id: id,
|
// group was passed as a search parameter. load the tree with the group selected.
|
||||||
emit_on_select: 'refreshHost',
|
BuildTree({
|
||||||
target_id: 'search-tree-container'
|
scope: scope,
|
||||||
});
|
inventory_id: id,
|
||||||
|
emit_on_select: 'refreshHost',
|
||||||
|
target_id: 'search-tree-container',
|
||||||
|
refresh: true,
|
||||||
|
group_id: group_id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BuildTree({
|
||||||
|
scope: scope,
|
||||||
|
inventory_id: id,
|
||||||
|
emit_on_select: 'refreshHost',
|
||||||
|
target_id: 'search-tree-container'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoryHosts.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryHostsForm',
|
InventoryHosts.$inject = [ '$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'InventoryHostsForm',
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
var active_failures = params.active_failures;
|
var active_failures = params.active_failures;
|
||||||
var total_hosts = params.total_hosts;
|
var total_hosts = params.total_hosts;
|
||||||
var inventory_id = params.inventory_id;
|
var inventory_id = params.inventory_id;
|
||||||
|
var group_id = params.group_id;
|
||||||
var tips, link, html_class;
|
var tips, link, html_class;
|
||||||
|
|
||||||
// Return values for use on host status indicator
|
// Return values for use on host status indicator
|
||||||
@@ -135,28 +136,28 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
tip = "Contains " + active_failures +
|
tip = "Contains " + active_failures +
|
||||||
[ (active_failures == 1) ? ' host' : ' hosts' ] + ' with failed jobs. Click to view the offending ' +
|
[ (active_failures == 1) ? ' host' : ' hosts' ] + ' with failed jobs. Click to view the offending ' +
|
||||||
[ (active_failures == 1) ? ' host' : ' hosts' ] + '.';
|
[ (active_failures == 1) ? ' host' : ' hosts' ] + '.';
|
||||||
link = '/#/inventories/' + inventory_id + '/hosts?has_active_failures=true';
|
link = '/#/inventories/' + inventory_id + '/hosts?group=' + group_id + '&has_active_failures=true';
|
||||||
html_class = 'true';
|
html_class = 'true';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (total_hosts == 0) {
|
if (total_hosts == 0) {
|
||||||
// no hosts
|
// no hosts
|
||||||
tip = "There are no hosts in this group. It's a sad empty shell. Click to view the hosts page and add a host.";
|
tip = "There are no hosts in this group. It's a sad empty shell. Click to view the hosts page and add a host.";
|
||||||
link = '/#/inventories/' + inventory_id + '/hosts';
|
link = '/#/inventories/' + inventory_id + '/hosts/?group=' + group_id;
|
||||||
html_class = 'na';
|
html_class = 'na';
|
||||||
}
|
}
|
||||||
else if (total_hosts == 1) {
|
else if (total_hosts == 1) {
|
||||||
// on host with 0 failures
|
// on host with 0 failures
|
||||||
tip = "The 1 host in this group is happy! It does not have a job failure. " +
|
tip = "The 1 host in this group is happy! It does not have a job failure. " +
|
||||||
" Click to view the host.";
|
" Click to view the host.";
|
||||||
link = '/#/inventories/' + inventory_id + '/hosts';
|
link = '/#/inventories/' + inventory_id + '/hosts/?group=' + group_id;
|
||||||
html_class = 'false';
|
html_class = 'false';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// many hosts with 0 failures
|
// many hosts with 0 failures
|
||||||
tip = "All " + total_hosts + " hosts in this group are happy! None of them have " +
|
tip = "All " + total_hosts + " hosts in this group are happy! None of them have " +
|
||||||
" a recent job failure. Click to view the hosts.";
|
" a recent job failure. Click to view the hosts.";
|
||||||
links = '/#/inventories/' + inventory_id + '/hosts';
|
links = '/#/inventories/' + inventory_id + '/hosts/?group=' + group_id;
|
||||||
html_class = 'false';
|
html_class = 'false';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -353,7 +354,8 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
|||||||
msg = HostsStatusMsg({
|
msg = HostsStatusMsg({
|
||||||
active_failures: scope.groups[i].hosts_with_active_failures,
|
active_failures: scope.groups[i].hosts_with_active_failures,
|
||||||
total_hosts: scope.groups[i].total_hosts,
|
total_hosts: scope.groups[i].total_hosts,
|
||||||
inventory_id: scope['inventory_id']
|
inventory_id: scope['inventory_id'],
|
||||||
|
group_id: scope['groups'][i]['id']
|
||||||
});
|
});
|
||||||
|
|
||||||
update_status = UpdateStatusMsg({ status: scope.groups[i].summary_fields.inventory_source.status });
|
update_status = UpdateStatusMsg({ status: scope.groups[i].summary_fields.inventory_source.status });
|
||||||
|
|||||||
Reference in New Issue
Block a user