From 212ab96a31ef07925b8d92649685b3c8a81ec063 Mon Sep 17 00:00:00 2001 From: gconsidine Date: Thu, 2 Nov 2017 17:01:12 -0400 Subject: [PATCH] Add structure for sandboxed job results --- awx/ui/client/features/index.js | 5 ++- .../features/output/index.controller.js | 4 +++ awx/ui/client/features/output/index.js | 35 +++++++++++++++++++ awx/ui/client/features/output/index.view.html | 3 ++ awx/ui/client/features/output/jobs.strings.js | 14 ++++++++ awx/ui/client/lib/models/Jobs.js | 19 ++++++++++ 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 awx/ui/client/features/output/index.controller.js create mode 100644 awx/ui/client/features/output/index.js create mode 100644 awx/ui/client/features/output/index.view.html create mode 100644 awx/ui/client/features/output/jobs.strings.js create mode 100644 awx/ui/client/lib/models/Jobs.js diff --git a/awx/ui/client/features/index.js b/awx/ui/client/features/index.js index 763894c93c..0a6ec3864c 100644 --- a/awx/ui/client/features/index.js +++ b/awx/ui/client/features/index.js @@ -4,6 +4,7 @@ import atLibModels from '~models'; import atFeaturesApplications from '~features/applications'; import atFeaturesCredentials from '~features/credentials'; +import atFeaturesOutput from '~features/output'; import atFeaturesTemplates from '~features/templates'; import atFeaturesUsers from '~features/users'; import atFeaturesJobs from '~features/jobs'; @@ -18,7 +19,9 @@ angular.module(MODULE_NAME, [ atFeaturesCredentials, atFeaturesTemplates, atFeaturesUsers, - atFeaturesJobs + atFeaturesJobs, + atFeaturesOutput, + atFeaturesTemplates ]); export default MODULE_NAME; diff --git a/awx/ui/client/features/output/index.controller.js b/awx/ui/client/features/output/index.controller.js new file mode 100644 index 0000000000..8a730a99c8 --- /dev/null +++ b/awx/ui/client/features/output/index.controller.js @@ -0,0 +1,4 @@ +function JobsIndexController () { +} + +module.exports = JobsIndexController; diff --git a/awx/ui/client/features/output/index.js b/awx/ui/client/features/output/index.js new file mode 100644 index 0000000000..03b596e00a --- /dev/null +++ b/awx/ui/client/features/output/index.js @@ -0,0 +1,35 @@ +import JobsStrings from '~features/output/jobs.strings'; +import IndexController from '~features/output/index.controller'; + +const indexTemplate = require('~features/output/index.view.html'); + +const MODULE_NAME = 'at.features.output'; + +function JobsRun ($stateExtender, strings) { + $stateExtender.addState({ + name: 'jobz', + route: '/jobz', + ncyBreadcrumb: { + label: strings.get('state.TITLE') + }, + data: { + activityStream: true, + activityStreamTarget: 'jobs' + }, + views: { + templateUrl: indexTemplate, + controller: IndexController, + controllerAs: 'vm' + } + }); +} + +JobsRun.$inject = ['$stateExtender', 'JobsStrings']; + +angular + .module(MODULE_NAME, []) + .controller('indexController', IndexController) + .service('JobsStrings', JobsStrings) + .run(JobsRun); + +export default MODULE_NAME; diff --git a/awx/ui/client/features/output/index.view.html b/awx/ui/client/features/output/index.view.html new file mode 100644 index 0000000000..36bd84a02d --- /dev/null +++ b/awx/ui/client/features/output/index.view.html @@ -0,0 +1,3 @@ +

+ test +

diff --git a/awx/ui/client/features/output/jobs.strings.js b/awx/ui/client/features/output/jobs.strings.js new file mode 100644 index 0000000000..aa1afcdfaf --- /dev/null +++ b/awx/ui/client/features/output/jobs.strings.js @@ -0,0 +1,14 @@ +function JobsStrings (BaseString) { + BaseString.call(this, 'jobs'); + + const { t } = this; + const ns = this.jobs; + + ns.state = { + TITLE: t.s('JOBZ') + }; +} + +JobsStrings.$inject = ['BaseStringService']; + +export default JobsStrings; diff --git a/awx/ui/client/lib/models/Jobs.js b/awx/ui/client/lib/models/Jobs.js new file mode 100644 index 0000000000..e82b3e04af --- /dev/null +++ b/awx/ui/client/lib/models/Jobs.js @@ -0,0 +1,19 @@ +let BaseModel; + +function JobsModel (method, resource, config) { + BaseModel.call(this, 'jobs'); + + this.Constructor = JobsModel; + + return this.create(method, resource, config); +} + +function JobsModelLoader (_BaseModel_) { + BaseModel = _BaseModel_; + + return JobsModel; +} + +JobsModelLoader.$inject = ['BaseModel']; + +export default JobsModelLoader;