mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
Failed jobs link on Inventories tab list now works. Clicking takes user to Jobs tab, filters jobs by Inventory ID and sorts by Status (so that failed jobs appear first in list).
This commit is contained in:
@@ -520,6 +520,6 @@
|
|||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-body {
|
#form-modal-body, #password-body {
|
||||||
padding-top: 30px;
|
padding-top: 30px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,6 +150,11 @@ function InventoriesList ($scope, $rootScope, $location, $log, $routeParams, Res
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Failed jobs link. Go to the jobs tabs, find all jobs for the inventory and sort by status
|
||||||
|
scope.viewJobs = function(id) {
|
||||||
|
$location.url('/jobs/?inventory__int=' + id + '&order_by=status');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InventoriesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'InventoryList', 'GenerateList',
|
InventoriesList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'InventoryList', 'GenerateList',
|
||||||
|
|||||||
@@ -36,8 +36,20 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
|||||||
|
|
||||||
SearchInit({ scope: scope, set: 'jobs', list: list, url: defaultUrl });
|
SearchInit({ scope: scope, set: 'jobs', list: list, url: defaultUrl });
|
||||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||||
|
|
||||||
|
// Called from Inventories page, failed jobs link. Find jobs for selected inventory.
|
||||||
|
if ($routeParams['inventory__int']) {
|
||||||
|
scope[list.iterator + 'SearchField'] = 'inventory';
|
||||||
|
scope[list.iterator + 'SearchValue'] = $routeParams['inventory__int'];
|
||||||
|
scope[list.iterator + 'SearchFieldLabel'] = 'Inventory';
|
||||||
|
}
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
|
|
||||||
|
// Called from Inventories page, failed jobs link. Now sort by status so faild jobs appear at top of list
|
||||||
|
if ($routeParams.order_by) {
|
||||||
|
scope.sort($routeParams.order_by);
|
||||||
|
}
|
||||||
|
|
||||||
LoadBreadCrumbs();
|
LoadBreadCrumbs();
|
||||||
|
|
||||||
scope.refreshJob = function() {
|
scope.refreshJob = function() {
|
||||||
|
|||||||
@@ -145,8 +145,9 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
|||||||
|| list.fields[scope[iterator + 'SearchField']].searchType == 'select') ) {
|
|| list.fields[scope[iterator + 'SearchField']].searchType == 'select') ) {
|
||||||
scope[iterator + 'SearchParams'] += scope[iterator + 'SearchSelectValue'].value;
|
scope[iterator + 'SearchParams'] += scope[iterator + 'SearchSelectValue'].value;
|
||||||
}
|
}
|
||||||
else if ( list.fields[scope[iterator + 'SearchField']].searchType == undefined ||
|
else {
|
||||||
list.fields[scope[iterator + 'SearchField']].searchType == 'gtzero' ) {
|
//if ( list.fields[scope[iterator + 'SearchField']].searchType == undefined ||
|
||||||
|
// list.fields[scope[iterator + 'SearchField']].searchType == 'gtzero' ) {
|
||||||
scope[iterator + 'SearchParams'] += escape(scope[iterator + 'SearchValue']);
|
scope[iterator + 'SearchParams'] += escape(scope[iterator + 'SearchValue']);
|
||||||
}
|
}
|
||||||
scope[iterator + 'SearchParams'] += (sort_order) ? '&order_by=' + escape(sort_order) : '';
|
scope[iterator + 'SearchParams'] += (sort_order) ? '&order_by=' + escape(sort_order) : '';
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ angular.module('InventoriesListDefinition', [])
|
|||||||
ngShow: "\{\{ inventory.has_active_failures \}\}",
|
ngShow: "\{\{ inventory.has_active_failures \}\}",
|
||||||
icon: 'icon-exclamation-sign',
|
icon: 'icon-exclamation-sign',
|
||||||
"class": 'active-failures-\{\{ inventory.has_active_failures \}\}',
|
"class": 'active-failures-\{\{ inventory.has_active_failures \}\}',
|
||||||
|
ngClick: 'viewJobs(\{\{ inventory.id \}\})',
|
||||||
searchField: 'has_active_failures',
|
searchField: 'has_active_failures',
|
||||||
searchType: 'boolean',
|
searchType: 'boolean',
|
||||||
searchOptions: [{ name: "No", value: 0 }, { name: "Yes", value: 1 }]
|
searchOptions: [{ name: "No", value: 0 }, { name: "Yes", value: 1 }]
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ angular.module('JobsListDefinition', [])
|
|||||||
key: true,
|
key: true,
|
||||||
desc: true,
|
desc: true,
|
||||||
searchType: 'int'
|
searchType: 'int'
|
||||||
|
},
|
||||||
|
inventory: {
|
||||||
|
label: 'Inventory ID',
|
||||||
|
searchType: 'int',
|
||||||
|
searchOnly: true
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
|
|||||||
@@ -153,27 +153,29 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
|||||||
html += "<th>#</th>\n";
|
html += "<th>#</th>\n";
|
||||||
}
|
}
|
||||||
for (var fld in list.fields) {
|
for (var fld in list.fields) {
|
||||||
html += "<th class=\"list-header\" id=\"";
|
if (list.fields[fld].searchOnly == undefined || list.fields[fld].searchOnly == false) {
|
||||||
html += (list.fields[fld].id) ? list.fields[fld].id : fld + "-header";
|
html += "<th class=\"list-header\" id=\"";
|
||||||
html += "\"";
|
html += (list.fields[fld].id) ? list.fields[fld].id : fld + "-header";
|
||||||
html += (list.fields[fld].nosort === undefined || list.fields[fld].nosort !== true) ? "ng-click=\"sort('" + fld + "')\"" : "";
|
html += "\"";
|
||||||
html += ">" + list.fields[fld].label;
|
html += (list.fields[fld].nosort === undefined || list.fields[fld].nosort !== true) ? "ng-click=\"sort('" + fld + "')\"" : "";
|
||||||
if (list.fields[fld].nosort === undefined || list.fields[fld].nosort !== true) {
|
html += ">" + list.fields[fld].label;
|
||||||
html += " <i class=\"";
|
if (list.fields[fld].nosort === undefined || list.fields[fld].nosort !== true) {
|
||||||
if (list.fields[fld].key) {
|
html += " <i class=\"";
|
||||||
if (list.fields[fld].desc) {
|
if (list.fields[fld].key) {
|
||||||
html += "icon-sort-down";
|
if (list.fields[fld].desc) {
|
||||||
|
html += "icon-sort-down";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html += "icon-sort-up";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html += "icon-sort-up";
|
html += "icon-sort";
|
||||||
}
|
}
|
||||||
|
html += "\"></i></a>";
|
||||||
}
|
}
|
||||||
else {
|
html += "</th>\n";
|
||||||
html += "icon-sort";
|
|
||||||
}
|
|
||||||
html += "\"></i></a>";
|
|
||||||
}
|
}
|
||||||
html += "</th>\n";
|
|
||||||
}
|
}
|
||||||
if (options.mode == 'select') {
|
if (options.mode == 'select') {
|
||||||
html += "<th>Select</th>";
|
html += "<th>Select</th>";
|
||||||
@@ -199,7 +201,9 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
|||||||
base = base.replace(/^\//,'');
|
base = base.replace(/^\//,'');
|
||||||
for (fld in list.fields) {
|
for (fld in list.fields) {
|
||||||
cnt++;
|
cnt++;
|
||||||
html += Column({ list: list, fld: fld, options: options, base: base });
|
if (list.fields[fld].searchOnly == undefined || list.fields[fld].searchOnly == false) {
|
||||||
|
html += Column({ list: list, fld: fld, options: options, base: base });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.mode == 'select' ) {
|
if (options.mode == 'select' ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user