mirror of
https://github.com/ansible/awx.git
synced 2026-03-25 12:55:04 -02:30
account for existence of 'check' project update jobs
This commit is contained in:
@@ -184,7 +184,6 @@ function getInventoryDetails () {
|
|||||||
|
|
||||||
function getProjectDetails () {
|
function getProjectDetails () {
|
||||||
const project = resource.model.get('summary_fields.project');
|
const project = resource.model.get('summary_fields.project');
|
||||||
const projectUpdate = resource.model.get('summary_fields.project_update');
|
|
||||||
|
|
||||||
if (!project) {
|
if (!project) {
|
||||||
return null;
|
return null;
|
||||||
@@ -195,17 +194,32 @@ function getProjectDetails () {
|
|||||||
const value = $filter('sanitize')(project.name);
|
const value = $filter('sanitize')(project.name);
|
||||||
const tooltip = strings.get('resourceTooltips.PROJECT');
|
const tooltip = strings.get('resourceTooltips.PROJECT');
|
||||||
|
|
||||||
if (projectUpdate) {
|
return { label, link, value, tooltip };
|
||||||
const update = {
|
}
|
||||||
link: `/#/jobz/project/${projectUpdate.id}`,
|
|
||||||
tooltip: strings.get('resourceTooltips.PROJECT_UPDATE'),
|
|
||||||
status: projectUpdate.status,
|
|
||||||
};
|
|
||||||
|
|
||||||
return { label, link, value, tooltip, update };
|
function getProjectStatusDetails (projectStatus) {
|
||||||
|
const project = resource.model.get('summary_fields.project');
|
||||||
|
const jobStatus = projectStatus || resource.model.get('summary_fields.project_update.status');
|
||||||
|
|
||||||
|
if (!project) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { label, link, value, tooltip };
|
return jobStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getProjectUpdateDetails (updateId) {
|
||||||
|
const project = resource.model.get('summary_fields.project');
|
||||||
|
const jobId = updateId || resource.model.get('summary_fields.project_update.id');
|
||||||
|
|
||||||
|
if (!project) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const link = `/#/jobz/project/${jobId}`;
|
||||||
|
const tooltip = strings.get('resourceTooltips.PROJECT_UPDATE');
|
||||||
|
|
||||||
|
return { link, tooltip };
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSCMRevisionDetails () {
|
function getSCMRevisionDetails () {
|
||||||
@@ -495,6 +509,8 @@ function AtJobDetailsController (
|
|||||||
vm.sourceWorkflowJob = getSourceWorkflowJobDetails();
|
vm.sourceWorkflowJob = getSourceWorkflowJobDetails();
|
||||||
vm.inventory = getInventoryDetails();
|
vm.inventory = getInventoryDetails();
|
||||||
vm.project = getProjectDetails();
|
vm.project = getProjectDetails();
|
||||||
|
vm.projectUpdate = getProjectUpdateDetails();
|
||||||
|
vm.projectStatus = getProjectStatusDetails();
|
||||||
vm.scmRevision = getSCMRevisionDetails();
|
vm.scmRevision = getSCMRevisionDetails();
|
||||||
vm.playbook = getPlaybookDetails();
|
vm.playbook = getPlaybookDetails();
|
||||||
vm.resultTraceback = getResultTracebackDetails();
|
vm.resultTraceback = getResultTracebackDetails();
|
||||||
@@ -533,16 +549,15 @@ function AtJobDetailsController (
|
|||||||
vm.deleteJob = deleteJob;
|
vm.deleteJob = deleteJob;
|
||||||
vm.toggleLabels = toggleLabels;
|
vm.toggleLabels = toggleLabels;
|
||||||
|
|
||||||
$scope.$watch(status.getStarted, value => { vm.started = getStartDetails(value); });
|
const observe = (getter, transform, key) => {
|
||||||
$scope.$watch(status.getJobStatus, value => { vm.status = getStatusDetails(value); });
|
$scope.$watch(getter, value => { vm[key] = transform(value); });
|
||||||
$scope.$watch(status.getFinished, value => { vm.finished = getFinishDetails(value); });
|
};
|
||||||
|
|
||||||
$scope.$watch(status.getProjectStatus, value => {
|
observe(status.getStarted, getStartDetails, 'started');
|
||||||
if (!value) return;
|
observe(status.getJobStatus, getStatusDetails, 'status');
|
||||||
|
observe(status.getFinished, getFinishDetails, 'finished');
|
||||||
vm.project.update = vm.project.update || {};
|
observe(status.getProjectUpdateId, getProjectUpdateDetails, 'projectUpdate');
|
||||||
vm.project.update.status = value;
|
observe(status.getProjectStatus, getProjectStatusDetails, 'projectStatus');
|
||||||
});
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,11 +119,11 @@
|
|||||||
<div class="JobResults-resultRow" ng-if="vm.project">
|
<div class="JobResults-resultRow" ng-if="vm.project">
|
||||||
<label class="JobResults-resultRowLabel">{{ vm.project.label }}</label>
|
<label class="JobResults-resultRowLabel">{{ vm.project.label }}</label>
|
||||||
<div class="JobResults-resultRowText">
|
<div class="JobResults-resultRowText">
|
||||||
<a href="{{ vm.project.update.link }}"
|
<a href="{{ vm.projectUpdate.link }}"
|
||||||
ng-if="vm.project.update"
|
ng-if="vm.projectUpdate"
|
||||||
aw-tool-tip="{{ vm.project.update.tooltip }}"
|
aw-tool-tip="{{ vm.projectUpdate.tooltip }}"
|
||||||
data-placement="top">
|
data-placement="top">
|
||||||
<i class="JobResults-statusResultIcon fa icon-job-{{ vm.project.update.status }}"></i>
|
<i ng-if="vm.projectStatus" class="JobResults-statusResultIcon fa icon-job-{{ vm.projectStatus }}"></i>
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ vm.project.link }}"
|
<a href="{{ vm.project.link }}"
|
||||||
aw-tool-tip="{{ vm.project.tooltip }}"
|
aw-tool-tip="{{ vm.project.tooltip }}"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ function JobsStrings (BaseString) {
|
|||||||
|
|
||||||
ns.status = {
|
ns.status = {
|
||||||
RUNNING: t.s('The host status bar will update when the job is complete.'),
|
RUNNING: t.s('The host status bar will update when the job is complete.'),
|
||||||
UNAVAILABLE: t.s('Host status information for this job unavailable.'),
|
UNAVAILABLE: t.s('Host status information for this job is unavailable.'),
|
||||||
};
|
};
|
||||||
|
|
||||||
ns.resourceTooltips = {
|
ns.resourceTooltips = {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ function JobStatusService (_moment_) {
|
|||||||
this.finished = resource.model.get('finished');
|
this.finished = resource.model.get('finished');
|
||||||
this.jobStatus = resource.model.get('status');
|
this.jobStatus = resource.model.get('status');
|
||||||
this.projectStatus = resource.model.get('summary_fields.project_update.status');
|
this.projectStatus = resource.model.get('summary_fields.project_update.status');
|
||||||
|
this.projectUpdateId = resource.model.get('summary_fields.project_update.id');
|
||||||
|
|
||||||
this.latestTime = null;
|
this.latestTime = null;
|
||||||
this.playCount = null;
|
this.playCount = null;
|
||||||
@@ -43,6 +44,7 @@ function JobStatusService (_moment_) {
|
|||||||
this.setJobStatus(data.status);
|
this.setJobStatus(data.status);
|
||||||
} else if (isProjectEvent) {
|
} else if (isProjectEvent) {
|
||||||
this.setProjectStatus(data.status);
|
this.setProjectStatus(data.status);
|
||||||
|
this.setProjectUpdateId(data.unified_job_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isCommand()) {
|
if (this.isCommand()) {
|
||||||
@@ -130,6 +132,7 @@ function JobStatusService (_moment_) {
|
|||||||
this.getHostStatusCounts = () => this.hostStatusCounts || {};
|
this.getHostStatusCounts = () => this.hostStatusCounts || {};
|
||||||
this.getJobStatus = () => this.jobStatus;
|
this.getJobStatus = () => this.jobStatus;
|
||||||
this.getProjectStatus = () => this.projectStatus;
|
this.getProjectStatus = () => this.projectStatus;
|
||||||
|
this.getProjectUpdateId = () => this.projectUpdateId;
|
||||||
this.getElapsed = () => this.elapsed;
|
this.getElapsed = () => this.elapsed;
|
||||||
this.getStatsEvent = () => this.statsEvent;
|
this.getStatsEvent = () => this.statsEvent;
|
||||||
this.getStarted = () => this.started;
|
this.getStarted = () => this.started;
|
||||||
@@ -153,6 +156,10 @@ function JobStatusService (_moment_) {
|
|||||||
this.projectStatus = status;
|
this.projectStatus = status;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setProjectUpdateId = id => {
|
||||||
|
this.projectUpdateId = id;
|
||||||
|
};
|
||||||
|
|
||||||
this.setFinished = time => {
|
this.setFinished = time => {
|
||||||
this.finished = time;
|
this.finished = time;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user