From 897fb96f940b154866f9943d45fa19c0e3b88169 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Tue, 14 Aug 2018 17:09:59 -0400 Subject: [PATCH] hide counter badges for output only jobs --- awx/ui/client/features/output/constants.js | 1 + .../client/features/output/stats.component.js | 3 +++ .../client/features/output/stats.partial.html | 18 +++++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/awx/ui/client/features/output/constants.js b/awx/ui/client/features/output/constants.js index 5d3b29aab8..06c782b4fe 100644 --- a/awx/ui/client/features/output/constants.js +++ b/awx/ui/client/features/output/constants.js @@ -17,6 +17,7 @@ export const OUTPUT_ELEMENT_CONTAINER = '.at-Stdout-container'; export const OUTPUT_ELEMENT_TBODY = '#atStdoutResultTable'; export const OUTPUT_ELEMENT_LAST = '#atStdoutMenuLast'; export const OUTPUT_MAX_LAG = 120; +export const OUTPUT_NO_COUNT_JOB_TYPES = ['ad_hoc_command', 'system_job', 'inventory_update']; export const OUTPUT_ORDER_BY = 'counter'; export const OUTPUT_PAGE_CACHE = true; export const OUTPUT_PAGE_LIMIT = 5; diff --git a/awx/ui/client/features/output/stats.component.js b/awx/ui/client/features/output/stats.component.js index 31285cfbf1..61f86d6709 100644 --- a/awx/ui/client/features/output/stats.component.js +++ b/awx/ui/client/features/output/stats.component.js @@ -1,3 +1,5 @@ +import { OUTPUT_NO_COUNT_JOB_TYPES } from './constants'; + const templateUrl = require('~features/output/stats.partial.html'); let vm; @@ -21,6 +23,7 @@ function JobStatsController (strings, { subscribe }) { }; vm.$onInit = () => { + vm.hideCounts = OUTPUT_NO_COUNT_JOB_TYPES.includes(vm.resource.model.get('type')); vm.download = vm.resource.model.get('related.stdout'); vm.tooltips.toggleExpand = vm.expanded ? strings.get('tooltips.COLLAPSE_OUTPUT') : diff --git a/awx/ui/client/features/output/stats.partial.html b/awx/ui/client/features/output/stats.partial.html index fa27beb97b..a9b2dffa8c 100644 --- a/awx/ui/client/features/output/stats.partial.html +++ b/awx/ui/client/features/output/stats.partial.html @@ -1,16 +1,16 @@
- plays - ... - {{ vm.plays || 0 }} + plays + ... + {{ vm.plays || 0 }} - tasks - ... - {{ vm.tasks || 0 }} + tasks + ... + {{ vm.tasks || 0 }} - {{:: vm.strings.get('stats.HOSTS')}} - ... - {{ vm.hosts || 1 }} + {{:: vm.strings.get('stats.HOSTS')}} + ... + {{ vm.hosts || 1 }} {{:: vm.strings.get('stats.ELAPSED') }} ...