1
0
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:
chouseknecht 2014-05-13 14:05:39 -04:00
parent 6618cc877c
commit 8bd2117e77
3 changed files with 30 additions and 7 deletions

View File

@ -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) +
". Click for details\" aw-tip-placement=\"top\"><i class=\"fa icon-job-" +
row.status + "\"></i></a></td>\n";
html += "<td>" + ((row.finished) ? ( ($filter('date')(row.finished,'MM/dd HH:mm:ss')).replace(/ /,'<br />') ) : '') + "</td>";
html += "<td><a href=\"/#/jobs/" + row.id + "/job_events\">Events</a><br />" +
"<a href=\"/#/jobs/" + row.id + "/job_host_summaries\">Hosts</a></td>";
html += "<td>" + ($filter('date')(row.finished,'MM/dd HH:mm:ss')).replace(/ /,'<br />') + "</td>";
html += "<td><a href=\"/#/job_events/" + row.id + "\">Events</a><br />" +
"<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 += "</tr>\n";
});

View File

@ -10,7 +10,7 @@
'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) {
ClearScope();
@ -135,6 +135,8 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
$scope.removeBuildJobsList();
}
$scope.removeBuildJobsList = $scope.$on('buildJobsList', function() {
var opt, search_params;
if (CompletedJobsList.fields.type) {
CompletedJobsList.fields.type.searchOptions = $scope.type_choices;
}
@ -144,6 +146,19 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
if (QueuedJobsList.fields.type) {
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.showJobType = true;
LoadJobsScope({
@ -151,7 +166,8 @@ function JobsListController ($scope, $compile, ClearScope, Breadcrumbs, LoadBrea
scope: completed_scope,
list: CompletedJobsList,
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);
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' ];
function JobsEdit($scope, $rootScope, $compile, $location, $log, $routeParams, JobForm, JobTemplateForm, GenerateForm, Rest,

View File

@ -357,7 +357,8 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
url = params.url,
pageSize = params.pageSize || 5,
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
html = SearchWidget({
@ -408,6 +409,12 @@ angular.module('JobsHelper', ['Utilities', 'RestServices', 'FormGenerator', 'Job
scope[list.iterator + 'SearchFieldLabel'] = 'Job ID';
}
}
if (search_params) {
for (key in search_params) {
scope[key] = search_params[key];
}
}
scope.search(list.iterator);
};
}])