mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
Schedule search widget, and fix buttons for jobs
Inserted the schedule search widget for hte scheduled jobs tab, and adjusting the correct buttons based on if a job is running.
This commit is contained in:
parent
eabe4bdf02
commit
9cffbd63c2
@ -112,9 +112,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa
|
||||
jobs_scope.search('queued_job');
|
||||
jobs_scope.search('running_job');
|
||||
jobs_scope.search('completed_job');
|
||||
// queued_scope.search('queued_job');
|
||||
// running_scope.search('running_job');
|
||||
// completed_scope.search('completed_job');
|
||||
scheduled_scope.search('schedule');
|
||||
};
|
||||
|
||||
|
||||
@ -562,8 +562,8 @@ export default
|
||||
*
|
||||
*/
|
||||
.factory('LoadSchedulesScope', ['$compile', '$location', '$routeParams','SearchInit', 'PaginateInit', 'generateList', 'SchedulesControllerInit',
|
||||
'SchedulesListInit', 'SearchWidget',
|
||||
function($compile, $location, $routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit, SearchWidget) {
|
||||
'SchedulesListInit',
|
||||
function($compile, $location, $routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit) {
|
||||
return function(params) {
|
||||
var parent_scope = params.parent_scope,
|
||||
scope = params.scope,
|
||||
@ -571,37 +571,17 @@ export default
|
||||
id = params.id,
|
||||
url = params.url,
|
||||
pageSize = params.pageSize || 5,
|
||||
spinner = (params.spinner === undefined) ? true : params.spinner,
|
||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
||||
e, html;
|
||||
spinner = (params.spinner === undefined) ? true : params.spinner;
|
||||
|
||||
if (base === 'jobs') {
|
||||
// on jobs page the search widget appears on the right
|
||||
html = SearchWidget({
|
||||
iterator: list.iterator,
|
||||
template: params.list,
|
||||
includeSize: false
|
||||
});
|
||||
e = angular.element(document.getElementById(id + '-search-container')).append(html);
|
||||
$compile(e)(scope);
|
||||
GenerateList.inject(list, {
|
||||
mode: 'edit',
|
||||
id: id,
|
||||
breadCrumbs: false,
|
||||
scope: scope,
|
||||
showSearch: false
|
||||
});
|
||||
}
|
||||
else {
|
||||
GenerateList.inject(list, {
|
||||
mode: 'edit',
|
||||
id: id,
|
||||
breadCrumbs: false,
|
||||
scope: scope,
|
||||
searchSize: 'col-lg-6 col-md-6 col-sm-6 col-xs-12',
|
||||
showSearch: true
|
||||
});
|
||||
}
|
||||
|
||||
GenerateList.inject(list, {
|
||||
mode: 'edit',
|
||||
id: id,
|
||||
breadCrumbs: false,
|
||||
scope: scope,
|
||||
searchSize: 'col-lg-6 col-md-6 col-sm-6 col-xs-12',
|
||||
showSearch: true
|
||||
});
|
||||
|
||||
SearchInit({
|
||||
scope: scope,
|
||||
|
||||
@ -96,11 +96,19 @@ export default
|
||||
dataPlacement: 'top',
|
||||
ngHide: "all_job.type == 'system_job' "
|
||||
},
|
||||
cancel: {
|
||||
mode: 'all',
|
||||
ngClick: 'deleteJob(all_job.id)',
|
||||
awToolTip: 'Cancel the job',
|
||||
dataPlacement: 'top',
|
||||
ngShow: "all_job.status === 'running'"
|
||||
},
|
||||
"delete": {
|
||||
mode: 'all',
|
||||
ngClick: 'deleteJob(all_job.id)',
|
||||
awToolTip: 'Delete the job',
|
||||
dataPlacement: 'top'
|
||||
dataPlacement: 'top',
|
||||
ngShow: "all_job.status !== 'running'"
|
||||
},
|
||||
stdout: {
|
||||
mode: 'all',
|
||||
|
||||
@ -102,12 +102,6 @@ export default
|
||||
dataPlacement: 'top',
|
||||
ngShow: "job.status != 'running'"
|
||||
},
|
||||
// job_details: {
|
||||
// mode: 'all',
|
||||
// ngClick: "viewJobLog(job.id)",
|
||||
// awToolTip: 'View job details',
|
||||
// dataPlacement: 'top'
|
||||
// },
|
||||
stdout: {
|
||||
mode: 'all',
|
||||
href: '/#/jobs/{{ job.id }}/stdout',
|
||||
|
||||
@ -76,7 +76,7 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
|
||||
scope: jobs_scope,
|
||||
list: JobsList,
|
||||
id: 'active-jobs',
|
||||
url: GetBasePath('unified_jobs') + '?status__in=running,completed,failed,successful,error,canceled',
|
||||
url: GetBasePath('unified_jobs') + '?status__in=pending,running,completed,failed,successful,error,canceled',
|
||||
pageSize: max_rows,
|
||||
spinner: false
|
||||
});
|
||||
|
||||
@ -12,22 +12,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="completed">
|
||||
<div class="row search-row">
|
||||
<div class="col-md-6"><div class="title">Jobs</div></div>
|
||||
<div class="col-md-6" id="completed-jobs-search-container"></div>
|
||||
</div>
|
||||
<div class="job-list" id="completed-jobs-container">
|
||||
<div id="completed-jobs" class="job-list-target"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> -->
|
||||
|
||||
|
||||
<div >
|
||||
<ul id="jobs_tabs" class="nav nav-tabs">
|
||||
<li class="active"><a id="active_jobs_link" ng-click="toggleTab($event, 'active_jobs_link', 'jobs_tabs')" href="#active-jobs-tab" data-toggle="tab">Jobs</a></li>
|
||||
@ -45,6 +30,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class= "tab-pane" id="scheduled-jobs-tab">
|
||||
<div class= "row search-row">
|
||||
<div class="col-lg-6 col-md-6 " id="scheduled-jobs-tab-search-container">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user