From eca530c788d9b78b16931a67d2d9cf243e54d9be Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Mon, 28 Jan 2019 13:48:50 -0500 Subject: [PATCH 1/2] Add execution node field to job details panel --- awx/ui/client/features/output/details.component.js | 14 ++++++++++++++ awx/ui/client/features/output/details.partial.html | 7 ++++++- awx/ui/client/features/output/output.strings.js | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/features/output/details.component.js b/awx/ui/client/features/output/details.component.js index 3cece3143a..8cc6762a77 100644 --- a/awx/ui/client/features/output/details.component.js +++ b/awx/ui/client/features/output/details.component.js @@ -481,6 +481,19 @@ function getLimitDetails () { return { label, value }; } +function getExecutionNodeDetails () { + const executionNode = resource.model.get('execution_node'); + + if (!executionNode) { + return null; + } + + const label = strings.get('labels.EXECUTION_NODE'); + const value = $filter('sanitize')(executionNode); + + return { label, value }; +} + function getInstanceGroupDetails () { const instanceGroup = resource.model.get('summary_fields.instance_group'); @@ -761,6 +774,7 @@ function JobDetailsController ( vm.credentials = getCredentialDetails(); vm.forks = getForkDetails(); vm.limit = getLimitDetails(); + vm.executionNode = getExecutionNodeDetails(); vm.instanceGroup = getInstanceGroupDetails(); vm.jobTags = getJobTagDetails(); vm.skipTags = getSkipTagDetails(); diff --git a/awx/ui/client/features/output/details.partial.html b/awx/ui/client/features/output/details.partial.html index dc979923dd..b73b0c943e 100644 --- a/awx/ui/client/features/output/details.partial.html +++ b/awx/ui/client/features/output/details.partial.html @@ -295,6 +295,12 @@
{{ vm.environment.value }}
+ +
+ +
{{ vm.executionNode.value }}
+
+
@@ -320,7 +326,6 @@
- Date: Tue, 29 Jan 2019 15:23:43 -0500 Subject: [PATCH 2/2] Update execution node field from job status subscriber --- .../client/features/output/details.component.js | 15 ++++++++++++--- awx/ui/client/features/output/status.service.js | 7 +++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/features/output/details.component.js b/awx/ui/client/features/output/details.component.js index 8cc6762a77..000b78c437 100644 --- a/awx/ui/client/features/output/details.component.js +++ b/awx/ui/client/features/output/details.component.js @@ -481,8 +481,8 @@ function getLimitDetails () { return { label, value }; } -function getExecutionNodeDetails () { - const executionNode = resource.model.get('execution_node'); +function getExecutionNodeDetails (node) { + const executionNode = node || resource.model.get('execution_node'); if (!executionNode) { return null; @@ -796,12 +796,21 @@ function JobDetailsController ( vm.toggleLabels = toggleLabels; vm.showLabels = showLabels; - unsubscribe = subscribe(({ status, started, finished, scm, inventoryScm, environment }) => { + unsubscribe = subscribe(({ + status, + started, + finished, + scm, + inventoryScm, + environment, + executionNode + }) => { vm.started = getStartDetails(started); vm.finished = getFinishDetails(finished); vm.projectUpdate = getProjectUpdateDetails(scm.id); vm.projectStatus = getProjectStatusDetails(scm.status); vm.environment = getEnvironmentDetails(environment); + vm.executionNode = getExecutionNodeDetails(executionNode); vm.inventoryScm = getInventoryScmDetails(inventoryScm.id, inventoryScm.status); vm.status = getStatusDetails(status); vm.job.status = status; diff --git a/awx/ui/client/features/output/status.service.js b/awx/ui/client/features/output/status.service.js index 5dbef7d821..17c3655a4f 100644 --- a/awx/ui/client/features/output/status.service.js +++ b/awx/ui/client/features/output/status.service.js @@ -279,6 +279,12 @@ function JobStatusService (moment, message) { this.state.environment = env; }; + this.setExecutionNode = node => { + if (!node) return; + + this.state.executionNode = node; + }; + this.setStatsEvent = data => { if (!data) return; @@ -321,6 +327,7 @@ function JobStatusService (moment, message) { this.setStarted(model.get('started')); this.setJobStatus(model.get('status')); this.setEnvironment(model.get('custom_virtualenv')); + this.setExecutionNode(model.get('execution_node')); this.initHostStatusCounts({ model }); this.initPlaybookCounts({ model });