mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
AC-1236 fixed broken failed jobs link on dashboard. Fixed broken job links on inventory tab page.
This commit is contained in:
parent
6618cc877c
commit
8bd2117e77
@ -188,9 +188,9 @@ function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $com
|
|||||||
html += "<td><a ng-click=\"viewJob('" + row.url + "')\" " + "aw-tool-tip=\"" + row.status.charAt(0).toUpperCase() + row.status.slice(1) +
|
html += "<td><a ng-click=\"viewJob('" + row.url + "')\" " + "aw-tool-tip=\"" + row.status.charAt(0).toUpperCase() + row.status.slice(1) +
|
||||||
". Click for details\" aw-tip-placement=\"top\"><i class=\"fa icon-job-" +
|
". Click for details\" aw-tip-placement=\"top\"><i class=\"fa icon-job-" +
|
||||||
row.status + "\"></i></a></td>\n";
|
row.status + "\"></i></a></td>\n";
|
||||||
html += "<td>" + ((row.finished) ? ( ($filter('date')(row.finished,'MM/dd HH:mm:ss')).replace(/ /,'<br />') ) : '') + "</td>";
|
html += "<td>" + ($filter('date')(row.finished,'MM/dd HH:mm:ss')).replace(/ /,'<br />') + "</td>";
|
||||||
html += "<td><a href=\"/#/jobs/" + row.id + "/job_events\">Events</a><br />" +
|
html += "<td><a href=\"/#/job_events/" + row.id + "\">Events</a><br />" +
|
||||||
"<a href=\"/#/jobs/" + row.id + "/job_host_summaries\">Hosts</a></td>";
|
"<a href=\"/#/job_host_summaries/" + row.id + "\">Hosts</a></td>";
|
||||||
html += "<td><a href=\"\" ng-click=\"viewJob('" + row.url + "')\" >" + ellipsis(row.name) + "</a></td>";
|
html += "<td><a href=\"\" ng-click=\"viewJob('" + row.url + "')\" >" + ellipsis(row.name) + "</a></td>";
|
||||||
html += "</tr>\n";
|
html += "</tr>\n";
|
||||||
});
|
});
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope, LoadJobsScope, RunningJobsList, CompletedJobsList, QueuedJobsList,
|
function JobsListController ($scope, $compile, $routeParams, ClearScope, Breadcrumbs, LoadBreadCrumbs, LoadSchedulesScope, LoadJobsScope, RunningJobsList, CompletedJobsList, QueuedJobsList,
|
||||||
ScheduledJobsList, GetChoices, GetBasePath, Wait, Socket) {
|
ScheduledJobsList, GetChoices, GetBasePath, Wait, Socket) {
|
||||||
|
|
||||||
ClearScope();
|
ClearScope();
|
||||||
@ -135,6 +135,8 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
|
|||||||
$scope.removeBuildJobsList();
|
$scope.removeBuildJobsList();
|
||||||
}
|
}
|
||||||
$scope.removeBuildJobsList = $scope.$on('buildJobsList', function() {
|
$scope.removeBuildJobsList = $scope.$on('buildJobsList', function() {
|
||||||
|
var opt, search_params;
|
||||||
|
|
||||||
if (CompletedJobsList.fields.type) {
|
if (CompletedJobsList.fields.type) {
|
||||||
CompletedJobsList.fields.type.searchOptions = $scope.type_choices;
|
CompletedJobsList.fields.type.searchOptions = $scope.type_choices;
|
||||||
}
|
}
|
||||||
@ -144,6 +146,19 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
|
|||||||
if (QueuedJobsList.fields.type) {
|
if (QueuedJobsList.fields.type) {
|
||||||
QueuedJobsList.fields.type.searchOptions = $scope.type_choices;
|
QueuedJobsList.fields.type.searchOptions = $scope.type_choices;
|
||||||
}
|
}
|
||||||
|
if ($routeParams.status) {
|
||||||
|
search_params[CompletedJobsList.iterator + 'SearchField'] = 'status';
|
||||||
|
search_params[CompletedJobsList.iterator + 'SelectShow'] = true;
|
||||||
|
search_params[CompletedJobsList.iterator + 'SearchSelectOpts'] = CompletedJobsList.fields.status.searchOptions;
|
||||||
|
search_params[CompletedJobsList.iterator + 'SearchFieldLabel'] = CompletedJobsList.fields.status.label.replace(/<br\>/g,' ');
|
||||||
|
search_params[CompletedJobsList.iterator + 'SearchType'] = '';
|
||||||
|
for (opt in CompletedJobsList.fields.status.searchOptions) {
|
||||||
|
if (CompletedJobsList.fields.status.searchOptions[opt].value === $routeParams.status) {
|
||||||
|
search_params[CompletedJobsList.iterator + 'SearchSelectValue'] = CompletedJobsList.fields.status.searchOptions[opt];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
completed_scope = $scope.$new(true);
|
completed_scope = $scope.$new(true);
|
||||||
completed_scope.showJobType = true;
|
completed_scope.showJobType = true;
|
||||||
LoadJobsScope({
|
LoadJobsScope({
|
||||||
@ -151,7 +166,8 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
|
|||||||
scope: completed_scope,
|
scope: completed_scope,
|
||||||
list: CompletedJobsList,
|
list: CompletedJobsList,
|
||||||
id: 'completed-jobs',
|
id: 'completed-jobs',
|
||||||
url: GetBasePath('unified_jobs') + '?or__status=successful&or__status=failed&or__status=error&or__status=canceled'
|
url: GetBasePath('unified_jobs') + '?or__status=successful&or__status=failed&or__status=error&or__status=canceled',
|
||||||
|
searchParams: search_params
|
||||||
});
|
});
|
||||||
running_scope = $scope.$new(true);
|
running_scope = $scope.$new(true);
|
||||||
LoadJobsScope({
|
LoadJobsScope({
|
||||||
@ -254,7 +270,7 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JobsListController.$inject = [ '$scope', '$compile', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'LoadSchedulesScope', 'LoadJobsScope', 'RunningJobsList', 'CompletedJobsList',
|
JobsListController.$inject = [ '$scope', '$compile', '$routeParams', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'LoadSchedulesScope', 'LoadJobsScope', 'RunningJobsList', 'CompletedJobsList',
|
||||||
'QueuedJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait', 'Socket' ];
|
'QueuedJobsList', 'ScheduledJobsList', 'GetChoices', 'GetBasePath', 'Wait', 'Socket' ];
|
||||||
|
|
||||||
function JobsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, JobForm, JobTemplateForm, GenerateForm, Rest,
|
function JobsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, JobForm, JobTemplateForm, GenerateForm, Rest,
|
||||||
|
@ -357,7 +357,8 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
|
|||||||
url = params.url,
|
url = params.url,
|
||||||
pageSize = params.pageSize || 5,
|
pageSize = params.pageSize || 5,
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||||
e, html;
|
search_params = params.searchParams,
|
||||||
|
e, html, key;
|
||||||
|
|
||||||
// Add the search widget. We want it arranged differently, so we're injecting and compiling it separately
|
// Add the search widget. We want it arranged differently, so we're injecting and compiling it separately
|
||||||
html = SearchWidget({
|
html = SearchWidget({
|
||||||
@ -408,6 +409,12 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
|
|||||||
scope[list.iterator + 'SearchFieldLabel'] = 'Job ID';
|
scope[list.iterator + 'SearchFieldLabel'] = 'Job ID';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (search_params) {
|
||||||
|
for (key in search_params) {
|
||||||
|
scope[key] = search_params[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
scope.search(list.iterator);
|
scope.search(list.iterator);
|
||||||
};
|
};
|
||||||
}])
|
}])
|
||||||
|
Loading…
Reference in New Issue
Block a user