From dfeaea01488febbe8ec261c622f30635bcbe01e6 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 13 Nov 2014 11:29:42 -0500 Subject: [PATCH] Configure Tower adding changes to app and index for configure tower files. also included are updates to the scheduler widget for system jobs --- awx/ui/static/js/app.js | 14 +- awx/ui/static/js/helpers/JobSubmission.js | 1 + awx/ui/static/less/ansible-ui.less | 120 ++++++++++++++++++ .../angular-scheduler/app/partials/main.html | 2 +- .../lib/angular-scheduler.html | 35 +++-- .../lib/angular-scheduler.js | 58 +++++---- awx/ui/templates/ui/index.html | 37 +++++- 7 files changed, 222 insertions(+), 45 deletions(-) diff --git a/awx/ui/static/js/app.js b/awx/ui/static/js/app.js index ec889c0302..27dc045ee2 100644 --- a/awx/ui/static/js/app.js +++ b/awx/ui/static/js/app.js @@ -119,7 +119,9 @@ angular.module('Tower', [ 'SocketHelper', 'AboutAnsibleHelpModal', 'SurveyQuestionFormDefinition', - 'PortalJobsListDefinition' + 'PortalJobsListDefinition', + 'ConfigureTowerHelper', + 'ConfigureTowerJobsListDefinition' ]) .constant('AngularScheduler.partials', urlPrefix + 'lib/angular-scheduler/lib/') @@ -432,9 +434,9 @@ angular.module('Tower', [ }]) .run(['$compile', '$cookieStore', '$rootScope', '$log', 'CheckLicense', '$location', 'Authorization', 'LoadBasePaths', 'Timer', 'ClearScope', 'HideStream', 'Socket', - 'LoadConfig', 'Store', 'ShowSocketHelp', 'LicenseViewer', 'AboutAnsibleHelp', + 'LoadConfig', 'Store', 'ShowSocketHelp', 'LicenseViewer', 'AboutAnsibleHelp', 'ConfigureTower', function ($compile, $cookieStore, $rootScope, $log, CheckLicense, $location, Authorization, LoadBasePaths, Timer, ClearScope, HideStream, Socket, - LoadConfig, Store, ShowSocketHelp, LicenseViewer, AboutAnsibleHelp) { + LoadConfig, Store, ShowSocketHelp, LicenseViewer, AboutAnsibleHelp, ConfigureTower) { var e, html, sock, checkCount = 0; @@ -586,6 +588,12 @@ angular.module('Tower', [ $location.path('/home/'); }; + $rootScope.configureTower = function(){ + ConfigureTower({ + scope: $rootScope + }); + }; + html = ""; e = angular.element(document.getElementById('socket-beacon-div')); diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 4d242b5941..80671750b4 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -671,6 +671,7 @@ function($location, Wait, GetBasePath, LookUpInit, JobTemplateForm, CredentialLi return function (params) { var scope = params.scope, id = params.id, + system_job = params.system_job || false, base = $location.path().replace(/^\//, '').split('/')[0], url, job_template, diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index ac576f7138..e8e005a691 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -186,6 +186,126 @@ a:focus { } } +#configure-schedules-tab { + position: relative; + top: 0; + left: 0; +} + +#configure-schedules-overlay { + display: none; + position: absolute; + top: 0; + left: 0; + z-index: 100; + background-color: @black; + opacity: 0; + } + +#configure-schedules-buttons{ + height: 46px; + padding-top: 10px; + text-align: right; + border-top: 1px solid #A6C9E2; + margin-top: 5px; + a { + margin-right: 8px; + font-size: 12px; + } +} + +#configure-schedules-form-container { + position: absolute; + top: 0; + left: 0; + display: none; + border: 1px solid #e5e5e5; + border-radius: 4px; + box-shadow: 3px 3px 6px 0 #666; + padding: 0 10px 15px 8px; + background-color: @white; + z-index: 200; +} + +#configure-schedules-title { + border-bottom: 1px solid #e5e5e5; + padding-bottom: 8px; + margin-bottom: 10px; + margin-top: 0; + h4 { + display: inline-block; + margin: 0; + } + button { + display: inline-block; + } +} + +#configure-schedules-list { + overflow-x: hidden; + overflow-y: auto; +} + +#configure-schedules-overlay { + display: none; + position: absolute; + top: 0; + left: 0; + z-index: 100; + background-color: @black; + opacity: 0; +} + +#configure-tower-dialog, #configure-schedules-form-container { + display: none; + overflow-x: hidden; + overflow-y: auto; + padding-top: 25px; + + form { + width: 100%; + } + + .sublabel { + font-weight: normal; + } + + #occurrence-label { + display: inline-block; + } + + .occurrence-list { + border: 1px solid @well-border; + padding: 8px 10px; + border-radius: 4px; + background-color: @well; + list-style: none; + margin-bottom: 5px; + } + + #date-choice { + display: inline-block; + margin-left: 15px; + font-size: 12px; + + .label-inline { + display: inline-block; + vertical-align: middle; + } + input { + margin-bottom: 2px; + height: 11px; + width: 10px; + } + .label-inline:first-child { + padding-bottom: 2px; + margin-right: 10px; + } + .label-inline:nth-child(3) { + margin-right: 10px; + } + } +} #home_groups_table .actions .cancel { padding-right: 3px; } .success-badge { diff --git a/awx/ui/static/lib/angular-scheduler/app/partials/main.html b/awx/ui/static/lib/angular-scheduler/app/partials/main.html index 19b24a787a..578400203f 100644 --- a/awx/ui/static/lib/angular-scheduler/app/partials/main.html +++ b/awx/ui/static/lib/angular-scheduler/app/partials/main.html @@ -1,7 +1,7 @@
- +