Merge pull request #1647 from jakemcdermott/fix-1534-and-713

add persistent jobs->results filtering, prior version compatibility for job urls
This commit is contained in:
Jake McDermott
2018-05-02 18:42:54 -04:00
committed by GitHub
28 changed files with 139 additions and 82 deletions

View File

@@ -3,8 +3,7 @@
* *
* All Rights Reserved * All Rights Reserved
************************************************ */ ************************************************ */
const mapChoices = choices => Object const mapChoices = choices => Object.assign(...choices.map(([k, v]) => ({ [k]: v })));
.assign(...choices.map(([k, v]) => ({ [k]: v })));
function ListJobsController ( function ListJobsController (
$scope, $scope,
@@ -61,37 +60,36 @@ function ListJobsController (
vm.emptyListReason = strings.get('list.NO_RUNNING'); vm.emptyListReason = strings.get('list.NO_RUNNING');
} }
vm.jobTypes = mapChoices(unifiedJob vm.jobTypes = mapChoices(unifiedJob.options('actions.GET.type.choices'));
.options('actions.GET.type.choices'));
vm.getLink = ({ type, id }) => { vm.getSref = ({ type, id }) => {
let link; let sref;
switch (type) { switch (type) {
case 'job': case 'job':
link = `/#/jobz/playbook/${id}`; sref = `output({type: 'playbook', id: ${id}})`;
break; break;
case 'ad_hoc_command': case 'ad_hoc_command':
link = `/#/jobz/command/${id}`; sref = `output({type: 'command', id: ${id}})`;
break; break;
case 'system_job': case 'system_job':
link = `/#/jobz/system/${id}`; sref = `output({type: 'system', id: ${id}})`;
break; break;
case 'project_update': case 'project_update':
link = `/#/jobz/project/${id}`; sref = `output({type: 'project', id: ${id}})`;
break; break;
case 'inventory_update': case 'inventory_update':
link = `/#/jobz/inventory/${id}`; sref = `output({type: 'inventory', id: ${id}})`;
break; break;
case 'workflow_job': case 'workflow_job':
link = `/#/workflows/${id}`; sref = `workflowResults({id: ${id}})`;
break; break;
default: default:
link = ''; sref = '';
break; break;
} }
return link; return sref;
}; };
vm.deleteJob = (job) => { vm.deleteJob = (job) => {

View File

@@ -21,7 +21,7 @@
status="{{ job.status }}" status="{{ job.status }}"
status-tip="Job {{job.status}}. Click for details." status-tip="Job {{job.status}}. Click for details."
header-value="{{ job.name }}" header-value="{{ job.name }}"
header-link="{{ vm.getLink(job) }}" header-state="{{ vm.getSref(job) }}"
header-tag="{{ vm.jobTypes[job.type] }}"> header-tag="{{ vm.jobTypes[job.type] }}">
</at-row-item> </at-row-item>
<div class="at-Row--inline"> <div class="at-Row--inline">

View File

@@ -303,7 +303,7 @@
grid-template-rows: minmax(500px, ~"calc(100vh - 140px)"); grid-template-rows: minmax(500px, ~"calc(100vh - 140px)");
.at-Panel { .at-Panel {
overflow-y: scroll; overflow-y: auto;
} }
} }

View File

@@ -227,7 +227,7 @@ function getProjectUpdateDetails (updateId) {
return null; return null;
} }
const link = `/#/jobz/project/${jobId}`; const link = `/#/jobs/project/${jobId}`;
const tooltip = strings.get('resourceTooltips.PROJECT_UPDATE'); const tooltip = strings.get('resourceTooltips.PROJECT_UPDATE');
return { link, tooltip }; return { link, tooltip };
@@ -510,8 +510,7 @@ function AtJobDetailsController (
_strings_, _strings_,
_status_, _status_,
_wait_, _wait_,
ParseTypeChange, _parse_,
ParseVariableString,
) { ) {
vm = this || {}; vm = this || {};
@@ -520,7 +519,7 @@ function AtJobDetailsController (
$state = _$state_; $state = _$state_;
error = _error_; error = _error_;
parse = ParseVariableString; parse = _parse_;
prompt = _prompt_; prompt = _prompt_;
strings = _strings_; strings = _strings_;
status = _status_; status = _status_;
@@ -589,7 +588,6 @@ AtJobDetailsController.$inject = [
'JobStrings', 'JobStrings',
'JobStatusService', 'JobStatusService',
'Wait', 'Wait',
'ParseTypeChange',
'ParseVariableString', 'ParseVariableString',
]; ];

View File

@@ -40,19 +40,19 @@
<div class="HostEvent-nav"> <div class="HostEvent-nav">
<!-- view navigation buttons --> <!-- view navigation buttons -->
<button ui-sref="jobz.host-event.json" type="button" <button ui-sref="output.host-event.json" type="button"
class="btn btn-sm btn-default HostEvent-tab" class="btn btn-sm btn-default HostEvent-tab"
ng-class="{'HostEvent-tab--selected' : isActiveState('jobz.host-event.json')}"> ng-class="{'HostEvent-tab--selected' : isActiveState('output.host-event.json')}">
JSON JSON
</button> </button>
<button ng-if="stdout" ui-sref="jobz.host-event.stdout" <button ng-if="stdout" ui-sref="output.host-event.stdout"
type="button" class="btn btn-sm btn-default HostEvent-tab" type="button" class="btn btn-sm btn-default HostEvent-tab"
ng-class="{'HostEvent-tab--selected' : isActiveState('jobz.host-event.stdout')}"> ng-class="{'HostEvent-tab--selected' : isActiveState('output.host-event.stdout')}">
Standard Out Standard Out
</button> </button>
<button ng-if="stderr" ui-sref="jobz.host-event.stderr" <button ng-if="stderr" ui-sref="output.host-event.stderr"
type="button" class="btn btn-sm btn-default HostEvent-tab" type="button" class="btn btn-sm btn-default HostEvent-tab"
ng-class="{'HostEvent-tab--selected' : isActiveState('jobz.host-event.stderr')}"> ng-class="{'HostEvent-tab--selected' : isActiveState('output.host-event.stderr')}">
Standard Error Standard Error
</button> </button>

View File

@@ -57,7 +57,7 @@ function HostEventsController (
$scope.stdout = event[0];// eslint-disable-line prefer-destructuring $scope.stdout = event[0];// eslint-disable-line prefer-destructuring
} }
// instantiate Codemirror // instantiate Codemirror
if ($state.current.name === 'jobz.host-event.json') { if ($state.current.name === 'output.host-event.json') {
try { try {
if (_.has(hostEvent.event_data, 'res')) { if (_.has(hostEvent.event_data, 'res')) {
initCodeMirror( initCodeMirror(
@@ -73,14 +73,14 @@ function HostEventsController (
// element with id HostEvent-codemirror is not the view // element with id HostEvent-codemirror is not the view
// controlled by this instance of HostEventController // 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 { try {
resize(); resize();
} catch (err) { } catch (err) {
// element with id HostEvent-codemirror is not the view // element with id HostEvent-codemirror is not the view
// controlled by this instance of HostEventController // 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 { try {
resize(); resize();
} catch (err) { } catch (err) {
@@ -98,11 +98,11 @@ function HostEventsController (
}); });
function resize () { function resize () {
if ($state.current.name === 'jobz.host-event.json') { if ($state.current.name === 'output.host-event.json') {
const editor = $('.CodeMirror')[0].CodeMirror; const editor = $('.CodeMirror')[0].CodeMirror;
const height = $('.modal-dialog').height() - $('.HostEvent-header').height() - $('.HostEvent-details').height() - $('.HostEvent-nav').height() - $('.HostEvent-controls').height() - 120; const height = $('.modal-dialog').height() - $('.HostEvent-header').height() - $('.HostEvent-details').height() - $('.HostEvent-nav').height() - $('.HostEvent-controls').height() - 120;
editor.setSize('100%', height); 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; const height = $('.modal-dialog').height() - $('.HostEvent-header').height() - $('.HostEvent-details').height() - $('.HostEvent-nav').height() - $('.HostEvent-controls').height() - 120;
$('.HostEvent-stdout').width('100%'); $('.HostEvent-stdout').width('100%');
$('.HostEvent-stdout').height(height); $('.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 // Unbind the listener so it doesn't fire when we close the modal via navigation
$('#HostEvent').off('hidden.bs.modal'); $('#HostEvent').off('hidden.bs.modal');
$('#HostEvent').modal('hide'); $('#HostEvent').modal('hide');
$state.go('jobz'); $state.go('output');
} }
$scope.init = init; $scope.init = init;
$scope.init(); $scope.init();

View File

@@ -25,7 +25,7 @@ HostEventResolve.$inject = [
]; ];
const hostEventModal = { const hostEventModal = {
name: 'jobz.host-event', name: 'output.host-event',
url: '/host-event/:eventId', url: '/host-event/:eventId',
controller: 'HostEventsController', controller: 'HostEventsController',
templateUrl: HostEventModalTemplate, templateUrl: HostEventModalTemplate,
@@ -40,7 +40,7 @@ const hostEventModal = {
}; };
const hostEventJson = { const hostEventJson = {
name: 'jobz.host-event.json', name: 'output.host-event.json',
url: '/json', url: '/json',
controller: 'HostEventsController', controller: 'HostEventsController',
templateUrl: HostEventCodeMirrorTemplate, templateUrl: HostEventCodeMirrorTemplate,
@@ -50,7 +50,7 @@ const hostEventJson = {
}; };
const hostEventStdout = { const hostEventStdout = {
name: 'jobz.host-event.stdout', name: 'output.host-event.stdout',
url: '/stdout', url: '/stdout',
controller: 'HostEventsController', controller: 'HostEventsController',
templateUrl: HostEventStdoutTemplate, templateUrl: HostEventStdoutTemplate,
@@ -60,7 +60,7 @@ const hostEventStdout = {
}; };
const hostEventStderr = { const hostEventStderr = {
name: 'jobz.host-event.stderr', name: 'output.host-event.stderr',
url: '/stderr', url: '/stderr',
controller: 'HostEventsController', controller: 'HostEventsController',
templateUrl: HostEventStderrTemplate, templateUrl: HostEventStderrTemplate,

View File

@@ -8,6 +8,7 @@ import RenderService from '~features/output/render.service';
import ScrollService from '~features/output/scroll.service'; import ScrollService from '~features/output/scroll.service';
import EngineService from '~features/output/engine.service'; import EngineService from '~features/output/engine.service';
import StatusService from '~features/output/status.service'; import StatusService from '~features/output/status.service';
import LegacyRedirect from '~features/output/legacy.route';
import DetailsDirective from '~features/output/details.directive'; import DetailsDirective from '~features/output/details.directive';
import SearchDirective from '~features/output/search.directive'; import SearchDirective from '~features/output/search.directive';
@@ -125,12 +126,6 @@ function resolveWebSocketConnection ($stateParams, SocketService) {
return SocketService.addStateResolve(state, id); return SocketService.addStateResolve(state, id);
} }
function resolveBreadcrumb (strings) {
return {
label: strings.get('state.TITLE')
};
}
function getWebSocketResource (type) { function getWebSocketResource (type) {
let name; let name;
let key; let key;
@@ -163,11 +158,15 @@ function getWebSocketResource (type) {
return { name, key }; return { name, key };
} }
function JobsRun ($stateRegistry) { function JobsRun ($stateRegistry, strings) {
const parent = 'jobs';
const ncyBreadcrumb = { parent, label: strings.get('state.BREADCRUMB_DEFAULT') };
const state = { const state = {
name: 'jobz', url: '/:type/:id?job_event_search',
url: '/jobz/:type/:id?job_event_search', name: 'output',
route: '/jobz/:type/:id?job_event_search', parent,
ncyBreadcrumb,
data: { data: {
activityStream: false, activityStream: false,
}, },
@@ -179,6 +178,11 @@ function JobsRun ($stateRegistry) {
} }
}, },
resolve: { resolve: {
webSocketConnection: [
'$stateParams',
'SocketService',
resolveWebSocketConnection
],
resource: [ resource: [
'JobModel', 'JobModel',
'ProjectUpdateModel', 'ProjectUpdateModel',
@@ -191,14 +195,11 @@ function JobsRun ($stateRegistry) {
'Wait', 'Wait',
resolveResource resolveResource
], ],
ncyBreadcrumb: [ breadcrumbLabel: [
'JobStrings', 'resource',
resolveBreadcrumb ({ model }) => {
], ncyBreadcrumb.label = `${model.get('id')} - ${model.get('name')}`;
webSocketConnection: [ }
'$stateParams',
'SocketService',
resolveWebSocketConnection
], ],
}, },
}; };
@@ -206,7 +207,7 @@ function JobsRun ($stateRegistry) {
$stateRegistry.register(state); $stateRegistry.register(state);
} }
JobsRun.$inject = ['$stateRegistry']; JobsRun.$inject = ['$stateRegistry', 'JobStrings'];
angular angular
.module(MODULE_NAME, [ .module(MODULE_NAME, [
@@ -223,6 +224,7 @@ angular
.directive('atJobDetails', DetailsDirective) .directive('atJobDetails', DetailsDirective)
.directive('atJobSearch', SearchDirective) .directive('atJobSearch', SearchDirective)
.directive('atJobStats', StatsDirective) .directive('atJobStats', StatsDirective)
.run(JobsRun); .run(JobsRun)
.run(LegacyRedirect);
export default MODULE_NAME; export default MODULE_NAME;

View File

@@ -5,7 +5,7 @@ function JobsStrings (BaseString) {
const ns = this.jobs; const ns = this.jobs;
ns.state = { ns.state = {
TITLE: t.s('JOBZ') BREADCRUMB_DEFAULT: t.s('RESULTS'),
}; };
ns.status = { ns.status = {

View File

@@ -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;

View File

@@ -183,7 +183,7 @@ function JobRenderService ($q, $sce, $window) {
} }
if (current.isHost) { if (current.isHost) {
tdEvent = `<td class="at-Stdout-event--host" ui-sref="jobz.host-event.json({eventId: ${current.id}, taskUuid: '${current.uuid}' })"><span ng-non-bindable>${content}</span></td>`; tdEvent = `<td class="at-Stdout-event--host" ui-sref="output.host-event.json({eventId: ${current.id}, taskUuid: '${current.uuid}' })"><span ng-non-bindable>${content}</span></td>`;
} }
if (current.time && current.line === ln) { if (current.time && current.line === ln) {

View File

@@ -41,7 +41,7 @@ function atLaunchTemplateCtrl (
selectedJobTemplate selectedJobTemplate
.postLaunch({ id: vm.template.id }) .postLaunch({ id: vm.template.id })
.then(({ data }) => { .then(({ data }) => {
$state.go('jobz', { id: data.job, type: 'playbook' }, { reload: true }); $state.go('output', { id: data.job, type: 'playbook' }, { reload: true });
}); });
} else { } else {
const promptData = { const promptData = {
@@ -138,7 +138,7 @@ function atLaunchTemplateCtrl (
id: vm.promptData.template, id: vm.promptData.template,
launchData: jobLaunchData launchData: jobLaunchData
}).then((launchRes) => { }).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')); }).catch(createErrorHandler('launch job template', 'POST'));
} else if (vm.promptData.templateType === 'workflow_job_template') { } else if (vm.promptData.templateType === 'workflow_job_template') {
workflowTemplate.create().postLaunch({ workflowTemplate.create().postLaunch({

View File

@@ -11,6 +11,7 @@ function atRowItem () {
badge: '@', badge: '@',
headerValue: '@', headerValue: '@',
headerLink: '@', headerLink: '@',
headerState: '@',
headerTag: '@', headerTag: '@',
status: '@', status: '@',
statusTip: '@', statusTip: '@',

View File

@@ -11,7 +11,10 @@
<div class="at-RowItem-header" ng-if="headerValue && headerLink"> <div class="at-RowItem-header" ng-if="headerValue && headerLink">
<a ng-href="{{ headerLink }}">{{ headerValue }}</a> <a ng-href="{{ headerLink }}">{{ headerValue }}</a>
</div> </div>
<div class="at-RowItem-header" ng-if="headerValue && !headerLink"> <div class="at-RowItem-header" ng-if="headerValue && headerState">
<a ui-sref="{{ headerState }}" >{{ headerValue }}</a>
</div>
<div class="at-RowItem-header" ng-if="headerValue && !headerLink && !headerState">
{{ headerValue }} {{ headerValue }}
</div> </div>
<div class="at-RowItem-tag at-RowItem-tag--header" ng-if="headerTag"> <div class="at-RowItem-tag at-RowItem-tag--header" ng-if="headerTag">

View File

@@ -128,7 +128,7 @@ function atRelaunchCtrl (
.then((launchRes) => { .then((launchRes) => {
if (!$state.is('jobs')) { if (!$state.is('jobs')) {
const relaunchType = launchRes.data.type === 'job' ? 'playbook' : launchRes.data.type; const relaunchType = launchRes.data.type === 'job' ? 'playbook' : launchRes.data.type;
$state.go('jobz', { id: launchRes.data.id, type: relaunchType }, { reload: true }); $state.go('output', { id: launchRes.data.id, type: relaunchType }, { reload: true });
} }
}).catch(({ data, status, config }) => { }).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
@@ -173,7 +173,7 @@ function atRelaunchCtrl (
inventorySource.postUpdate(vm.job.inventory_source) inventorySource.postUpdate(vm.job.inventory_source)
.then((postUpdateRes) => { .then((postUpdateRes) => {
if (!$state.is('jobs')) { if (!$state.is('jobs')) {
$state.go('jobz', { id: postUpdateRes.data.id, type: 'inventory' }, { reload: true }); $state.go('output', { id: postUpdateRes.data.id, type: 'inventory' }, { reload: true });
} }
}).catch(({ data, status, config }) => { }).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
@@ -197,7 +197,7 @@ function atRelaunchCtrl (
project.postUpdate(vm.job.project) project.postUpdate(vm.job.project)
.then((postUpdateRes) => { .then((postUpdateRes) => {
if (!$state.is('jobs')) { if (!$state.is('jobs')) {
$state.go('jobz', { id: postUpdateRes.data.id, type: 'project' }, { reload: true }); $state.go('output', { id: postUpdateRes.data.id, type: 'project' }, { reload: true });
} }
}).catch(({ data, status, config }) => { }).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
@@ -243,7 +243,7 @@ function atRelaunchCtrl (
id: vm.job.id id: vm.job.id
}).then((launchRes) => { }).then((launchRes) => {
if (!$state.is('jobs')) { if (!$state.is('jobs')) {
$state.go('jobz', { id: launchRes.data.id, type: 'command' }, { reload: true }); $state.go('output', { id: launchRes.data.id, type: 'command' }, { reload: true });
} }
}).catch(({ data, status, config }) => { }).catch(({ data, status, config }) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {
@@ -268,7 +268,7 @@ function atRelaunchCtrl (
relaunchData: PromptService.bundlePromptDataForRelaunch(vm.promptData) relaunchData: PromptService.bundlePromptDataForRelaunch(vm.promptData)
}).then((launchRes) => { }).then((launchRes) => {
if (!$state.is('jobs')) { if (!$state.is('jobs')) {
$state.go('jobz', { id: launchRes.data.job, type: 'playbook' }, { reload: true }); $state.go('output', { id: launchRes.data.job, type: 'playbook' }, { reload: true });
} }
}).catch(({ data, status }) => { }).catch(({ data, status }) => {
ProcessErrors($scope, data, status, null, { ProcessErrors($scope, data, status, null, {

View File

@@ -34,7 +34,7 @@ export default
if (job.type === 'workflow_job') { if (job.type === 'workflow_job') {
detailsUrl = `/#/workflows/${job.id}`; detailsUrl = `/#/workflows/${job.id}`;
} else { } else {
detailsUrl = `/#/jobz/playbook/${job.id}`; detailsUrl = `/#/jobs/playbook/${job.id}`;
} }
return { return {

View File

@@ -241,7 +241,7 @@ function adhocController($q, $scope, $stateParams,
Rest.post(data) Rest.post(data)
.then(({data}) => { .then(({data}) => {
Wait('stop'); Wait('stop');
$state.go('jobz', {id: data.id, type: 'command'}); $state.go('output', {id: data.id, type: 'command'});
}) })
.catch(({data, status}) => { .catch(({data, status}) => {
ProcessErrors($scope, data, status, adhocForm, { ProcessErrors($scope, data, status, adhocForm, {

View File

@@ -23,7 +23,7 @@ export default [ '$scope', 'Empty', 'Wait', 'GetBasePath', 'Rest', 'ProcessError
}; };
$scope.viewJob = function(jobId) { $scope.viewJob = function(jobId) {
$state.go('jobz', { id: jobId, type: 'playbook' }); $state.go('output', { id: jobId, type: 'playbook' });
}; };
} }

View File

@@ -20,7 +20,7 @@ export default [ '$scope', 'Wait', 'Empty', 'Rest', 'ProcessErrors', '$state',
$scope.viewJob = function(url) { $scope.viewJob = function(url) {
// Pull the id out of the URL // Pull the id out of the URL
var id = url.replace(/^\//, '').split('/')[3]; var id = url.replace(/^\//, '').split('/')[3];
$state.go('jobz', { id, type: 'inventory' } ); $state.go('output', { id, type: 'inventory' } );
}; };
} }

View File

@@ -17,7 +17,7 @@ export default
// Get the ID from the correct summary field // Get the ID from the correct summary field
var update_id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id; var update_id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id;
$state.go('jobz', { id: update_id, type: 'inventory' }); $state.go('output', { id: update_id, type: 'inventory' });
}) })
.catch(({data, status}) => { .catch(({data, status}) => {
ProcessErrors(scope, data, status, null, { hdr: 'Error!', ProcessErrors(scope, data, status, null, { hdr: 'Error!',

View File

@@ -89,7 +89,7 @@
.then(({data}) => { .then(({data}) => {
Wait('stop'); Wait('stop');
if($location.path().replace(/^\//, '').split('/')[0] !== 'jobs') { if($location.path().replace(/^\//, '').split('/')[0] !== 'jobs') {
$state.go('jobz', { id: data.id, type: 'command' }); $state.go('output', { id: data.id, type: 'command' });
} }
}) })
.catch(({data, status}) => { .catch(({data, status}) => {

View File

@@ -150,7 +150,7 @@ export default
// use $state.go with reload: true option to re-instantiate sockets in // use $state.go with reload: true option to re-instantiate sockets in
var goTojobResults = function(type) { var goTojobResults = function(type) {
$state.go('jobz', {id: job, type}, {reload:true}); $state.go('output', {id: job, type}, {reload:true});
}; };
if($state.includes('jobs')) { if($state.includes('jobs')) {

View File

@@ -94,7 +94,7 @@ export default
Wait('stop'); Wait('stop');
$("#prompt-for-days").dialog("close"); $("#prompt-for-days").dialog("close");
// $("#configure-dialog").dialog('close'); // $("#configure-dialog").dialog('close');
$state.go('jobz', { id: data.system_job, type: 'system' }, { reload: true }); $state.go('output', { id: data.system_job, type: 'system' }, { reload: true });
}) })
.catch(({data, status}) => { .catch(({data, status}) => {
let template_id = $scope.job_template_id; let template_id = $scope.job_template_id;

View File

@@ -234,7 +234,7 @@ export default ['$scope', '$rootScope', '$location',
$scope.viewJob = function(url) { $scope.viewJob = function(url) {
// Pull the id out of the URL // Pull the id out of the URL
var id = url.replace(/^\//, '').split('/')[3]; var id = url.replace(/^\//, '').split('/')[3];
$state.go('jobz', { id: id, type: 'inventory' }); $state.go('output', { id: id, type: 'inventory' });
}; };

View File

@@ -187,7 +187,7 @@ export default ['$scope', '$rootScope', '$log', '$stateParams', 'Rest', 'Alert',
// Grab the id from summary_fields // Grab the id from summary_fields
var id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id; var id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id;
$state.go('jobz', { id: id, type: 'project' }); $state.go('output', { id: id, type: 'project' });
} else { } else {
Alert('No Updates Available', 'There is no SCM update information available for this project. An update has not yet been ' + Alert('No Updates Available', 'There is no SCM update information available for this project. An update has not yet been ' +

View File

@@ -146,7 +146,7 @@ export default ['$scope', '$rootScope', '$log', 'Rest', 'Alert',
// Grab the id from summary_fields // Grab the id from summary_fields
var id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id; var id = (data.summary_fields.current_update) ? data.summary_fields.current_update.id : data.summary_fields.last_update.id;
$state.go('jobz', { id: id, type: 'project'}, { reload: true }); $state.go('output', { id: id, type: 'project'}, { reload: true });
} else { } else {
Alert(i18n._('No Updates Available'), i18n._('There is no SCM update information available for this project. An update has not yet been ' + Alert(i18n._('No Updates Available'), i18n._('There is no SCM update information available for this project. An update has not yet been ' +

View File

@@ -27,7 +27,7 @@ export default ['$scope', '$filter',
if (typeof $scope.templateType !== 'undefined' && $scope.templateType === 'workflow_job_template') { if (typeof $scope.templateType !== 'undefined' && $scope.templateType === 'workflow_job_template') {
detailsBaseUrl = '/#/workflows/'; detailsBaseUrl = '/#/workflows/';
} else { } else {
detailsBaseUrl = '/#/jobz/playbook/'; detailsBaseUrl = '/#/jobs/playbook/';
} }
var sparkData = var sparkData =

View File

@@ -898,13 +898,13 @@ export default ['$state','moment', '$timeout', '$window', '$filter', 'Rest', 'Ge
let goToJobResults = function(job_type) { let goToJobResults = function(job_type) {
if(job_type === 'job') { if(job_type === 'job') {
$state.go('jobz', {id: d.job.id, type: 'playbook'}); $state.go('output', {id: d.job.id, type: 'playbook'});
} }
else if(job_type === 'inventory_update') { else if(job_type === 'inventory_update') {
$state.go('jobz', {id: d.job.id, type: 'inventory'}); $state.go('output', {id: d.job.id, type: 'inventory'});
} }
else if(job_type === 'project_update') { else if(job_type === 'project_update') {
$state.go('jobz', {id: d.job.id, type: 'project'}); $state.go('output', {id: d.job.id, type: 'project'});
} }
}; };