mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 18:51:06 -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:
@@ -112,9 +112,6 @@ export function JobsListController ($rootScope, $log, $scope, $compile, $routePa
|
|||||||
jobs_scope.search('queued_job');
|
jobs_scope.search('queued_job');
|
||||||
jobs_scope.search('running_job');
|
jobs_scope.search('running_job');
|
||||||
jobs_scope.search('completed_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');
|
scheduled_scope.search('schedule');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -562,8 +562,8 @@ export default
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
.factory('LoadSchedulesScope', ['$compile', '$location', '$routeParams','SearchInit', 'PaginateInit', 'generateList', 'SchedulesControllerInit',
|
.factory('LoadSchedulesScope', ['$compile', '$location', '$routeParams','SearchInit', 'PaginateInit', 'generateList', 'SchedulesControllerInit',
|
||||||
'SchedulesListInit', 'SearchWidget',
|
'SchedulesListInit',
|
||||||
function($compile, $location, $routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit, SearchWidget) {
|
function($compile, $location, $routeParams, SearchInit, PaginateInit, GenerateList, SchedulesControllerInit, SchedulesListInit) {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var parent_scope = params.parent_scope,
|
var parent_scope = params.parent_scope,
|
||||||
scope = params.scope,
|
scope = params.scope,
|
||||||
@@ -571,37 +571,17 @@ export default
|
|||||||
id = params.id,
|
id = params.id,
|
||||||
url = params.url,
|
url = params.url,
|
||||||
pageSize = params.pageSize || 5,
|
pageSize = params.pageSize || 5,
|
||||||
spinner = (params.spinner === undefined) ? true : params.spinner,
|
spinner = (params.spinner === undefined) ? true : params.spinner;
|
||||||
base = $location.path().replace(/^\//, '').split('/')[0],
|
|
||||||
e, html;
|
|
||||||
|
|
||||||
if (base === 'jobs') {
|
|
||||||
// on jobs page the search widget appears on the right
|
GenerateList.inject(list, {
|
||||||
html = SearchWidget({
|
mode: 'edit',
|
||||||
iterator: list.iterator,
|
id: id,
|
||||||
template: params.list,
|
breadCrumbs: false,
|
||||||
includeSize: false
|
scope: scope,
|
||||||
});
|
searchSize: 'col-lg-6 col-md-6 col-sm-6 col-xs-12',
|
||||||
e = angular.element(document.getElementById(id + '-search-container')).append(html);
|
showSearch: true
|
||||||
$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
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
SearchInit({
|
SearchInit({
|
||||||
scope: scope,
|
scope: scope,
|
||||||
|
|||||||
@@ -96,11 +96,19 @@ export default
|
|||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngHide: "all_job.type == 'system_job' "
|
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": {
|
"delete": {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
ngClick: 'deleteJob(all_job.id)',
|
ngClick: 'deleteJob(all_job.id)',
|
||||||
awToolTip: 'Delete the job',
|
awToolTip: 'Delete the job',
|
||||||
dataPlacement: 'top'
|
dataPlacement: 'top',
|
||||||
|
ngShow: "all_job.status !== 'running'"
|
||||||
},
|
},
|
||||||
stdout: {
|
stdout: {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
|
|||||||
@@ -102,12 +102,6 @@ export default
|
|||||||
dataPlacement: 'top',
|
dataPlacement: 'top',
|
||||||
ngShow: "job.status != 'running'"
|
ngShow: "job.status != 'running'"
|
||||||
},
|
},
|
||||||
// job_details: {
|
|
||||||
// mode: 'all',
|
|
||||||
// ngClick: "viewJobLog(job.id)",
|
|
||||||
// awToolTip: 'View job details',
|
|
||||||
// dataPlacement: 'top'
|
|
||||||
// },
|
|
||||||
stdout: {
|
stdout: {
|
||||||
mode: 'all',
|
mode: 'all',
|
||||||
href: '/#/jobs/{{ job.id }}/stdout',
|
href: '/#/jobs/{{ job.id }}/stdout',
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ angular.module('DashboardJobsWidget', ['RestServices', 'Utilities'])
|
|||||||
scope: jobs_scope,
|
scope: jobs_scope,
|
||||||
list: JobsList,
|
list: JobsList,
|
||||||
id: 'active-jobs',
|
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,
|
pageSize: max_rows,
|
||||||
spinner: false
|
spinner: false
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,21 +13,6 @@
|
|||||||
</div>
|
</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 >
|
<div >
|
||||||
<ul id="jobs_tabs" class="nav nav-tabs">
|
<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>
|
<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>
|
</div>
|
||||||
<div class= "tab-pane" id="scheduled-jobs-tab">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user