diff --git a/awx/ui/client/features/jobs/jobsList.controller.js b/awx/ui/client/features/jobs/jobsList.controller.js
index 7b5b4d8656..77be97e72d 100644
--- a/awx/ui/client/features/jobs/jobsList.controller.js
+++ b/awx/ui/client/features/jobs/jobsList.controller.js
@@ -3,8 +3,7 @@
*
* All Rights Reserved
************************************************ */
-const mapChoices = choices => Object
- .assign(...choices.map(([k, v]) => ({ [k]: v })));
+const mapChoices = choices => Object.assign(...choices.map(([k, v]) => ({ [k]: v })));
function ListJobsController (
$scope,
@@ -61,37 +60,36 @@ function ListJobsController (
vm.emptyListReason = strings.get('list.NO_RUNNING');
}
- vm.jobTypes = mapChoices(unifiedJob
- .options('actions.GET.type.choices'));
+ vm.jobTypes = mapChoices(unifiedJob.options('actions.GET.type.choices'));
- vm.getLink = ({ type, id }) => {
- let link;
+ vm.getSref = ({ type, id }) => {
+ let sref;
switch (type) {
case 'job':
- link = `/#/jobz/playbook/${id}`;
+ sref = `output({type: 'playbook', id: ${id}})`;
break;
case 'ad_hoc_command':
- link = `/#/jobz/command/${id}`;
+ sref = `output({type: 'command', id: ${id}})`;
break;
case 'system_job':
- link = `/#/jobz/system/${id}`;
+ sref = `output({type: 'system', id: ${id}})`;
break;
case 'project_update':
- link = `/#/jobz/project/${id}`;
+ sref = `output({type: 'project', id: ${id}})`;
break;
case 'inventory_update':
- link = `/#/jobz/inventory/${id}`;
+ sref = `output({type: 'inventory', id: ${id}})`;
break;
case 'workflow_job':
- link = `/#/workflows/${id}`;
+ sref = `workflowResults({id: ${id}})`;
break;
default:
- link = '';
+ sref = '';
break;
}
- return link;
+ return sref;
};
vm.deleteJob = (job) => {
diff --git a/awx/ui/client/features/jobs/jobsList.view.html b/awx/ui/client/features/jobs/jobsList.view.html
index d339ee75f1..e550cd879f 100644
--- a/awx/ui/client/features/jobs/jobsList.view.html
+++ b/awx/ui/client/features/jobs/jobsList.view.html
@@ -21,7 +21,7 @@
status="{{ job.status }}"
status-tip="Job {{job.status}}. Click for details."
header-value="{{ job.name }}"
- header-link="{{ vm.getLink(job) }}"
+ header-state="{{ vm.getSref(job) }}"
header-tag="{{ vm.jobTypes[job.type] }}">
diff --git a/awx/ui/client/features/output/_index.less b/awx/ui/client/features/output/_index.less
index 0bb8a72aba..524951ecbc 100644
--- a/awx/ui/client/features/output/_index.less
+++ b/awx/ui/client/features/output/_index.less
@@ -303,7 +303,7 @@
grid-template-rows: minmax(500px, ~"calc(100vh - 140px)");
.at-Panel {
- overflow-y: scroll;
+ overflow-y: auto;
}
}
diff --git a/awx/ui/client/features/output/details.directive.js b/awx/ui/client/features/output/details.directive.js
index 76d25270d5..36a0d5c16b 100644
--- a/awx/ui/client/features/output/details.directive.js
+++ b/awx/ui/client/features/output/details.directive.js
@@ -227,7 +227,7 @@ function getProjectUpdateDetails (updateId) {
return null;
}
- const link = `/#/jobz/project/${jobId}`;
+ const link = `/#/jobs/project/${jobId}`;
const tooltip = strings.get('resourceTooltips.PROJECT_UPDATE');
return { link, tooltip };
@@ -510,8 +510,7 @@ function AtJobDetailsController (
_strings_,
_status_,
_wait_,
- ParseTypeChange,
- ParseVariableString,
+ _parse_,
) {
vm = this || {};
@@ -520,7 +519,7 @@ function AtJobDetailsController (
$state = _$state_;
error = _error_;
- parse = ParseVariableString;
+ parse = _parse_;
prompt = _prompt_;
strings = _strings_;
status = _status_;
@@ -589,7 +588,6 @@ AtJobDetailsController.$inject = [
'JobStrings',
'JobStatusService',
'Wait',
- 'ParseTypeChange',
'ParseVariableString',
];
diff --git a/awx/ui/client/features/output/host-event/host-event-modal.partial.html b/awx/ui/client/features/output/host-event/host-event-modal.partial.html
index a79b3cde68..47676df842 100644
--- a/awx/ui/client/features/output/host-event/host-event-modal.partial.html
+++ b/awx/ui/client/features/output/host-event/host-event-modal.partial.html
@@ -40,19 +40,19 @@
-
-
-
diff --git a/awx/ui/client/features/output/host-event/host-event.controller.js b/awx/ui/client/features/output/host-event/host-event.controller.js
index a688e59a64..280bf51818 100644
--- a/awx/ui/client/features/output/host-event/host-event.controller.js
+++ b/awx/ui/client/features/output/host-event/host-event.controller.js
@@ -57,7 +57,7 @@ function HostEventsController (
$scope.stdout = event[0];// eslint-disable-line prefer-destructuring
}
// instantiate Codemirror
- if ($state.current.name === 'jobz.host-event.json') {
+ if ($state.current.name === 'output.host-event.json') {
try {
if (_.has(hostEvent.event_data, 'res')) {
initCodeMirror(
@@ -73,14 +73,14 @@ function HostEventsController (
// element with id HostEvent-codemirror is not the view
// controlled by this instance of HostEventController
}
- } else if ($state.current.name === 'jobz.host-event.stdout') {
+ } else if ($state.current.name === 'output.host-event.stdout') {
try {
resize();
} catch (err) {
// element with id HostEvent-codemirror is not the view
// controlled by this instance of HostEventController
}
- } else if ($state.current.name === 'jobz.host-event.stderr') {
+ } else if ($state.current.name === 'output.host-event.stderr') {
try {
resize();
} catch (err) {
@@ -98,11 +98,11 @@ function HostEventsController (
});
function resize () {
- if ($state.current.name === 'jobz.host-event.json') {
+ if ($state.current.name === 'output.host-event.json') {
const editor = $('.CodeMirror')[0].CodeMirror;
const height = $('.modal-dialog').height() - $('.HostEvent-header').height() - $('.HostEvent-details').height() - $('.HostEvent-nav').height() - $('.HostEvent-controls').height() - 120;
editor.setSize('100%', height);
- } else if ($state.current.name === 'jobz.host-event.stdout' || $state.current.name === 'jobz.host-event.stderr') {
+ } else if ($state.current.name === 'output.host-event.stdout' || $state.current.name === 'output.host-event.stderr') {
const height = $('.modal-dialog').height() - $('.HostEvent-header').height() - $('.HostEvent-details').height() - $('.HostEvent-nav').height() - $('.HostEvent-controls').height() - 120;
$('.HostEvent-stdout').width('100%');
$('.HostEvent-stdout').height(height);
@@ -154,7 +154,7 @@ function HostEventsController (
// Unbind the listener so it doesn't fire when we close the modal via navigation
$('#HostEvent').off('hidden.bs.modal');
$('#HostEvent').modal('hide');
- $state.go('jobz');
+ $state.go('output');
}
$scope.init = init;
$scope.init();
diff --git a/awx/ui/client/features/output/host-event/host-event.route.js b/awx/ui/client/features/output/host-event/host-event.route.js
index 105881c778..aba9273327 100644
--- a/awx/ui/client/features/output/host-event/host-event.route.js
+++ b/awx/ui/client/features/output/host-event/host-event.route.js
@@ -25,7 +25,7 @@ HostEventResolve.$inject = [
];
const hostEventModal = {
- name: 'jobz.host-event',
+ name: 'output.host-event',
url: '/host-event/:eventId',
controller: 'HostEventsController',
templateUrl: HostEventModalTemplate,
@@ -40,7 +40,7 @@ const hostEventModal = {
};
const hostEventJson = {
- name: 'jobz.host-event.json',
+ name: 'output.host-event.json',
url: '/json',
controller: 'HostEventsController',
templateUrl: HostEventCodeMirrorTemplate,
@@ -50,7 +50,7 @@ const hostEventJson = {
};
const hostEventStdout = {
- name: 'jobz.host-event.stdout',
+ name: 'output.host-event.stdout',
url: '/stdout',
controller: 'HostEventsController',
templateUrl: HostEventStdoutTemplate,
@@ -60,7 +60,7 @@ const hostEventStdout = {
};
const hostEventStderr = {
- name: 'jobz.host-event.stderr',
+ name: 'output.host-event.stderr',
url: '/stderr',
controller: 'HostEventsController',
templateUrl: HostEventStderrTemplate,
diff --git a/awx/ui/client/features/output/index.js b/awx/ui/client/features/output/index.js
index 35fa91ef6e..0bb295a714 100644
--- a/awx/ui/client/features/output/index.js
+++ b/awx/ui/client/features/output/index.js
@@ -8,6 +8,7 @@ import RenderService from '~features/output/render.service';
import ScrollService from '~features/output/scroll.service';
import EngineService from '~features/output/engine.service';
import StatusService from '~features/output/status.service';
+import LegacyRedirect from '~features/output/legacy.route';
import DetailsDirective from '~features/output/details.directive';
import SearchDirective from '~features/output/search.directive';
@@ -125,12 +126,6 @@ function resolveWebSocketConnection ($stateParams, SocketService) {
return SocketService.addStateResolve(state, id);
}
-function resolveBreadcrumb (strings) {
- return {
- label: strings.get('state.TITLE')
- };
-}
-
function getWebSocketResource (type) {
let name;
let key;
@@ -163,11 +158,15 @@ function getWebSocketResource (type) {
return { name, key };
}
-function JobsRun ($stateRegistry) {
+function JobsRun ($stateRegistry, strings) {
+ const parent = 'jobs';
+ const ncyBreadcrumb = { parent, label: strings.get('state.BREADCRUMB_DEFAULT') };
+
const state = {
- name: 'jobz',
- url: '/jobz/:type/:id?job_event_search',
- route: '/jobz/:type/:id?job_event_search',
+ url: '/:type/:id?job_event_search',
+ name: 'output',
+ parent,
+ ncyBreadcrumb,
data: {
activityStream: false,
},
@@ -179,6 +178,11 @@ function JobsRun ($stateRegistry) {
}
},
resolve: {
+ webSocketConnection: [
+ '$stateParams',
+ 'SocketService',
+ resolveWebSocketConnection
+ ],
resource: [
'JobModel',
'ProjectUpdateModel',
@@ -191,14 +195,11 @@ function JobsRun ($stateRegistry) {
'Wait',
resolveResource
],
- ncyBreadcrumb: [
- 'JobStrings',
- resolveBreadcrumb
- ],
- webSocketConnection: [
- '$stateParams',
- 'SocketService',
- resolveWebSocketConnection
+ breadcrumbLabel: [
+ 'resource',
+ ({ model }) => {
+ ncyBreadcrumb.label = `${model.get('id')} - ${model.get('name')}`;
+ }
],
},
};
@@ -206,7 +207,7 @@ function JobsRun ($stateRegistry) {
$stateRegistry.register(state);
}
-JobsRun.$inject = ['$stateRegistry'];
+JobsRun.$inject = ['$stateRegistry', 'JobStrings'];
angular
.module(MODULE_NAME, [
@@ -223,6 +224,7 @@ angular
.directive('atJobDetails', DetailsDirective)
.directive('atJobSearch', SearchDirective)
.directive('atJobStats', StatsDirective)
- .run(JobsRun);
+ .run(JobsRun)
+ .run(LegacyRedirect);
export default MODULE_NAME;
diff --git a/awx/ui/client/features/output/jobs.strings.js b/awx/ui/client/features/output/jobs.strings.js
index 742c4c38fb..c581039172 100644
--- a/awx/ui/client/features/output/jobs.strings.js
+++ b/awx/ui/client/features/output/jobs.strings.js
@@ -5,7 +5,7 @@ function JobsStrings (BaseString) {
const ns = this.jobs;
ns.state = {
- TITLE: t.s('JOBZ')
+ BREADCRUMB_DEFAULT: t.s('RESULTS'),
};
ns.status = {
diff --git a/awx/ui/client/features/output/legacy.route.js b/awx/ui/client/features/output/legacy.route.js
new file mode 100644
index 0000000000..4abf991dbb
--- /dev/null
+++ b/awx/ui/client/features/output/legacy.route.js
@@ -0,0 +1,55 @@
+function LegacyRedirect ($stateRegistry) {
+ const destination = 'output';
+ const routes = [
+ {
+ name: 'legacyJobResult',
+ url: '/jobs/:id?job_event_search',
+ redirectTo: (trans) => {
+ const {
+ id,
+ job_event_search // eslint-disable-line camelcase
+ } = trans.params();
+
+ return { state: destination, params: { type: 'playbook', id, job_event_search } };
+ }
+ },
+ {
+ name: 'legacyAdHocJobStdout',
+ url: '/ad_hoc_commands/:id',
+ redirectTo: (trans) => {
+ const { id } = trans.params();
+ return { state: destination, params: { type: 'command', id } };
+ }
+ },
+ {
+ name: 'legacyInventorySyncStdout',
+ url: '/inventory_sync/:id',
+ redirectTo: (trans) => {
+ const { id } = trans.params();
+ return { state: destination, params: { type: 'inventory', id } };
+ }
+ },
+ {
+ name: 'legacyManagementJobStdout',
+ url: '/management_jobs/:id',
+ redirectTo: (trans) => {
+ const { id } = trans.params();
+ return { state: destination, params: { type: 'system', id } };
+ }
+ },
+ {
+ name: 'legacyScmUpdateStdout',
+ url: '/scm_update/:id',
+ redirectTo: (trans) => {
+ const { id } = trans.params();
+ return { state: destination, params: { type: 'project', id } };
+ }
+ },
+ ];
+
+ routes.forEach(state => $stateRegistry.register(state));
+}
+
+LegacyRedirect.$inject = ['$stateRegistry'];
+
+export default LegacyRedirect;
diff --git a/awx/ui/client/features/output/render.service.js b/awx/ui/client/features/output/render.service.js
index 81728150fe..9981cac65b 100644
--- a/awx/ui/client/features/output/render.service.js
+++ b/awx/ui/client/features/output/render.service.js
@@ -183,7 +183,7 @@ function JobRenderService ($q, $sce, $window) {
}
if (current.isHost) {
- tdEvent = `
${content} | `;
+ tdEvent = `${content} | `;
}
if (current.time && current.line === ln) {
diff --git a/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js b/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js
index bd82a2fa10..f8f6734c0e 100644
--- a/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js
+++ b/awx/ui/client/lib/components/launchTemplateButton/launchTemplateButton.component.js
@@ -41,7 +41,7 @@ function atLaunchTemplateCtrl (
selectedJobTemplate
.postLaunch({ id: vm.template.id })
.then(({ data }) => {
- $state.go('jobz', { id: data.job, type: 'playbook' }, { reload: true });
+ $state.go('output', { id: data.job, type: 'playbook' }, { reload: true });
});
} else {
const promptData = {
@@ -138,7 +138,7 @@ function atLaunchTemplateCtrl (
id: vm.promptData.template,
launchData: jobLaunchData
}).then((launchRes) => {
- $state.go('jobz', { id: launchRes.data.job, type: 'playbook' }, { reload: true });
+ $state.go('output', { id: launchRes.data.job, type: 'playbook' }, { reload: true });
}).catch(createErrorHandler('launch job template', 'POST'));
} else if (vm.promptData.templateType === 'workflow_job_template') {
workflowTemplate.create().postLaunch({
diff --git a/awx/ui/client/lib/components/list/row-item.directive.js b/awx/ui/client/lib/components/list/row-item.directive.js
index ea116cc5cc..67e169835a 100644
--- a/awx/ui/client/lib/components/list/row-item.directive.js
+++ b/awx/ui/client/lib/components/list/row-item.directive.js
@@ -11,6 +11,7 @@ function atRowItem () {
badge: '@',
headerValue: '@',
headerLink: '@',
+ headerState: '@',
headerTag: '@',
status: '@',
statusTip: '@',
diff --git a/awx/ui/client/lib/components/list/row-item.partial.html b/awx/ui/client/lib/components/list/row-item.partial.html
index 4783993acc..7698ba85a9 100644
--- a/awx/ui/client/lib/components/list/row-item.partial.html
+++ b/awx/ui/client/lib/components/list/row-item.partial.html
@@ -11,7 +11,10 @@
-