mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
handle finished job run with incomplete status info
This commit is contained in:
parent
979eaeddfa
commit
2ba0319e79
@ -26,10 +26,18 @@ function getStatusDetails (jobStatus) {
|
||||
}
|
||||
|
||||
const choices = mapChoices(resource.model.options('actions.GET.status.choices'));
|
||||
|
||||
const label = strings.get('labels.STATUS');
|
||||
const icon = `fa icon-job-${unmapped}`;
|
||||
const value = choices[unmapped];
|
||||
|
||||
let icon;
|
||||
let value;
|
||||
|
||||
if (unmapped === 'unknown') {
|
||||
icon = 'fa icon-job-pending';
|
||||
value = strings.get('details.UNKNOWN');
|
||||
} else {
|
||||
icon = `fa icon-job-${unmapped}`;
|
||||
value = choices[unmapped];
|
||||
}
|
||||
|
||||
return { label, icon, value };
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ function OutputStrings (BaseString) {
|
||||
NOT_STARTED: t.s('Not Started'),
|
||||
SHOW_LESS: t.s('Show Less'),
|
||||
SHOW_MORE: t.s('Show More'),
|
||||
UNKNOWN: t.s('Finished'),
|
||||
};
|
||||
|
||||
ns.labels = {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<span class="at-Panel-label">{{:: vm.strings.get('stats.HOSTS')}}</span>
|
||||
<span ng-show="vm.running" class="at-Panel-headingTitleBadge">...</span>
|
||||
<span ng-show="!vm.running" class="at-Panel-headingTitleBadge">{{ vm.hosts || 0 }}</span>
|
||||
<span ng-show="!vm.running" class="at-Panel-headingTitleBadge">{{ vm.hosts || 1 }}</span>
|
||||
|
||||
<span class="at-Panel-label">{{:: vm.strings.get('stats.ELAPSED') }}</span>
|
||||
<span ng-show="vm.running" class="at-Panel-headingTitleBadge">...</span>
|
||||
|
||||
@ -5,7 +5,7 @@ const PLAY_START = 'playbook_on_play_start';
|
||||
const TASK_START = 'playbook_on_task_start';
|
||||
|
||||
const HOST_STATUS_KEYS = ['dark', 'failures', 'changed', 'ok', 'skipped'];
|
||||
const COMPLETE = ['successful', 'failed'];
|
||||
const COMPLETE = ['successful', 'failed', 'unknown'];
|
||||
const INCOMPLETE = ['canceled', 'error'];
|
||||
const UNSUCCESSFUL = ['failed'].concat(INCOMPLETE);
|
||||
const FINISHED = COMPLETE.concat(INCOMPLETE);
|
||||
@ -26,10 +26,11 @@ function JobStatusService (moment, message) {
|
||||
|
||||
this.state = {
|
||||
running: false,
|
||||
anyFailed: false,
|
||||
counts: {
|
||||
plays: 0,
|
||||
tasks: 0,
|
||||
hosts: 0,
|
||||
hosts: 1,
|
||||
},
|
||||
hosts: {},
|
||||
status: model.get('status'),
|
||||
@ -124,6 +125,10 @@ function JobStatusService (moment, message) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (data.failed) {
|
||||
this.state.anyFailed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
this.dispatch();
|
||||
}
|
||||
@ -149,6 +154,10 @@ function JobStatusService (moment, message) {
|
||||
} else {
|
||||
this.setJobStatus('successful');
|
||||
}
|
||||
} else if (this.state.counter > -1) {
|
||||
this.setJobStatus(this.state.anyFailed ? 'failed' : 'unknown');
|
||||
} else {
|
||||
this.setJobStatus('unknown');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user