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:
chouseknecht
2013-07-01 13:24:25 -04:00
parent e17d984758
commit dc670e86aa
3 changed files with 20 additions and 6 deletions

View File

@@ -29,6 +29,7 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
scope.PostRefershRemove = scope.$on('PostRefresh', function() { scope.PostRefershRemove = scope.$on('PostRefresh', function() {
for( var i=0; i < scope.jobhosts.length; i++) { 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';
} }
}); });

View File

@@ -196,12 +196,17 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
} }
// Set the sorder order value and call the API to refresh the list with the new order // Set the sorder order value and call the API to refresh the list with the new order
if (list.fields[fld].searchField) {
sort_order = direction + list.fields[fld].searchField;
}
else {
if (list.fields[fld].sourceModel) { if (list.fields[fld].sourceModel) {
sort_order = direction + list.fields[fld].sourceModel + '__' + list.fields[fld].sourceField; sort_order = direction + list.fields[fld].sourceModel + '__' + list.fields[fld].sourceField;
} }
else { else {
sort_order = direction + fld; sort_order = direction + fld;
} }
}
scope.search(list.iterator); scope.search(list.iterator);
} }

View File

@@ -25,6 +25,14 @@ angular.module('JobHostDefinition', [])
ngBind: 'jobhost.host_name', ngBind: 'jobhost.host_name',
ngClick:"showEvents('\{\{ jobhost.summary_fields.host.name \}\}','\{\{ jobhost.related.job \}\}')" ngClick:"showEvents('\{\{ jobhost.summary_fields.host.name \}\}','\{\{ jobhost.related.job \}\}')"
}, },
status: {
label: 'Status',
icon: 'icon-circle',
"class": 'job-\{\{ jobhost.status \}\}',
searchField: 'failed',
searchType: 'boolean',
searchOptions: [{ name: "success", value: 0 }, { name: "error", value: 1 }]
},
ok: { ok: {
label: 'Success', label: 'Success',
searchable: false searchable: false