From 450eaeca96cfc57f04a63c833c8bf9fa76924118 Mon Sep 17 00:00:00 2001 From: Jake McDermott Date: Fri, 23 Mar 2018 11:38:20 -0400 Subject: [PATCH] add event processing for stats and host status components --- awx/ui/client/features/output/_index.less | 7 +- .../features/output/details.directive.js | 34 +++-- .../features/output/details.partial.html | 5 +- .../features/output/index.controller.js | 127 ++++++++++++------ awx/ui/client/features/output/index.js | 8 +- awx/ui/client/features/output/index.view.html | 9 +- .../client/features/output/render.service.js | 1 - ...status.directive.js => stats.directive.js} | 43 ++++-- ...status.partial.html => stats.partial.html} | 0 .../client/features/output/stream.service.js | 44 +++--- .../client/lib/components/panel/_index.less | 12 ++ .../relaunchButton.component.js | 3 +- awx/ui/client/lib/models/Base.js | 7 +- awx/ui/client/lib/models/Job.js | 1 - awx/ui/client/lib/models/ProjectUpdate.js | 9 +- awx/ui/client/lib/theme/_global.less | 11 ++ awx/ui/client/lib/theme/_utility.less | 8 ++ .../host-status-bar.block.less | 10 +- .../src/standard-out/standard-out.block.less | 6 +- 19 files changed, 227 insertions(+), 118 deletions(-) rename awx/ui/client/features/output/{status.directive.js => stats.directive.js} (65%) rename awx/ui/client/features/output/{status.partial.html => stats.partial.html} (100%) diff --git a/awx/ui/client/features/output/_index.less b/awx/ui/client/features/output/_index.less index ab4e589213..e44be3b39f 100644 --- a/awx/ui/client/features/output/_index.less +++ b/awx/ui/client/features/output/_index.less @@ -206,12 +206,11 @@ display: flex; flex: 0 0 auto; width: 100%; - margin-top: 10px; } .HostStatusBar-ok, .HostStatusBar-changed, -.HostStatusBar-unreachable, +.HostStatusBar-dark, .HostStatusBar-failed, .HostStatusBar-skipped, .HostStatusBar-noData { @@ -231,7 +230,7 @@ flex: 0 0 auto; } -.HostStatusBar-unreachable { +.HostStatusBar-dark { background-color: @default-unreachable; flex: 0 0 auto; } @@ -265,7 +264,7 @@ background-color: @default-succ; } -.HostStatusBar-tooltipBadge--unreachable { +.HostStatusBar-tooltipBadge--dark { background-color: @default-unreachable; } diff --git a/awx/ui/client/features/output/details.directive.js b/awx/ui/client/features/output/details.directive.js index 309c50612d..22c66d12cc 100644 --- a/awx/ui/client/features/output/details.directive.js +++ b/awx/ui/client/features/output/details.directive.js @@ -441,7 +441,7 @@ function AtDetailsController ( vm.init = _$scope_ => { $scope = _$scope_; - resource = $scope.resource; + resource = $scope.resource; // eslint-disable-line prefer-destructuring vm.status = getStatusDetails(); vm.started = getStartTimeDetails(); @@ -466,27 +466,35 @@ function AtDetailsController ( vm.extraVars = getExtraVarsDetails(); vm.labels = getLabelDetails(); + // Relaunch Component + vm.job = _.get(resource.model, 'model.GET', {}); + + // XX - Codemirror + if (vm.extraVars) { + const cm = { + parseType: 'yaml', + $apply: $scope.$apply, + variables: vm.extraVars.value, + }; + + ParseTypeChange({ + field_id: 'cm-extra-vars', + readOnly: true, + scope: cm, + }); + } + vm.cancelJob = cancelJob; vm.deleteJob = deleteJob; vm.toggleLabels = toggleLabels; const observe = (key, transform) => { - $scope.$watch(key, value => { this[key] = transform(value); }); + $scope.$watch(key, value => { vm[key] = transform(value); }); }; + observe('finished', getFinishTimeDetails); observe('status', getStatusDetails); observe('started', getStartTimeDetails); - observe('finished', getFinishTimeDetails); - - // relaunch component - $scope.job = _.get(resource.model, 'model.GET', {}); - this.job = $scope.job; - - // codemirror - if (this.extraVars) { - const cm = { parseType: 'yaml', variables: this.extraVars.value, $apply: $scope.$apply }; - ParseTypeChange({ scope: cm, field_id: 'cm-extra-vars', readOnly: true }); - } }; } diff --git a/awx/ui/client/features/output/details.partial.html b/awx/ui/client/features/output/details.partial.html index bb80346a7b..e72b682e6e 100644 --- a/awx/ui/client/features/output/details.partial.html +++ b/awx/ui/client/features/output/details.partial.html @@ -1,11 +1,10 @@ - - +
DETAILS
- +