mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 15:14:45 -03:30
AC-177 Added status field to Host Summary page. Field shows red/green icon indicating if host failed or succeeded.
This commit is contained in:
@@ -28,8 +28,9 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
|
||||
}
|
||||
scope.PostRefershRemove = scope.$on('PostRefresh', function() {
|
||||
for( var i=0; i < scope.jobhosts.length; i++) {
|
||||
scope.jobhosts[i].host_name = scope.jobhosts[i].summary_fields.host.name;
|
||||
}
|
||||
scope.jobhosts[i].host_name = scope.jobhosts[i].summary_fields.host.name;
|
||||
scope.jobhosts[i].status = (scope.jobhosts[i].failed) ? 'error' : 'success';
|
||||
}
|
||||
});
|
||||
|
||||
SearchInit({ scope: scope, set: 'jobhosts', list: list, url: defaultUrl });
|
||||
|
||||
@@ -196,11 +196,16 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
}
|
||||
|
||||
// Set the sorder order value and call the API to refresh the list with the new order
|
||||
if (list.fields[fld].sourceModel) {
|
||||
sort_order = direction + list.fields[fld].sourceModel + '__' + list.fields[fld].sourceField;
|
||||
if (list.fields[fld].searchField) {
|
||||
sort_order = direction + list.fields[fld].searchField;
|
||||
}
|
||||
else {
|
||||
sort_order = direction + fld;
|
||||
if (list.fields[fld].sourceModel) {
|
||||
sort_order = direction + list.fields[fld].sourceModel + '__' + list.fields[fld].sourceField;
|
||||
}
|
||||
else {
|
||||
sort_order = direction + fld;
|
||||
}
|
||||
}
|
||||
scope.search(list.iterator);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,15 @@ angular.module('JobHostDefinition', [])
|
||||
ngBind: 'jobhost.host_name',
|
||||
ngClick:"showEvents('\{\{ jobhost.summary_fields.host.name \}\}','\{\{ jobhost.related.job \}\}')"
|
||||
},
|
||||
ok: {
|
||||
status: {
|
||||
label: 'Status',
|
||||
icon: 'icon-circle',
|
||||
"class": 'job-\{\{ jobhost.status \}\}',
|
||||
searchField: 'failed',
|
||||
searchType: 'boolean',
|
||||
searchOptions: [{ name: "success", value: 0 }, { name: "error", value: 1 }]
|
||||
},
|
||||
ok: {
|
||||
label: 'Success',
|
||||
searchable: false
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user