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