From 455e40562b7c879f05e9af0a665df570b8a78d97 Mon Sep 17 00:00:00 2001 From: Ethan Rogers Date: Mon, 20 Nov 2017 14:06:23 -0500 Subject: [PATCH] feat(provider/kubernetes): runJob logs add support for displaying logs for runJob --- .../runJob/runJobExecutionDetails.controller.js | 13 ++++++++++++- .../stages/runJob/runJobExecutionDetails.html | 4 ++++ .../src/pipeline/stages/runJob/runJobLogs.html | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobLogs.html diff --git a/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.controller.js b/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.controller.js index 27985bfc271..7206c00f170 100644 --- a/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.controller.js +++ b/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.controller.js @@ -6,7 +6,7 @@ module.exports = angular .module('spinnaker.kubernetes.pipeline.stage.disableCluster.runJobExecutionDetails.controller', [ require('@uirouter/angularjs').default, ]) - .controller('kubernetesRunJobExecutionDetailsCtrl', function ($scope, $stateParams, executionDetailsSectionService) { + .controller('kubernetesRunJobExecutionDetailsCtrl', function ($scope, $stateParams, executionDetailsSectionService, $uibModal) { $scope.configSections = ['runJobConfig', 'taskStatus']; @@ -25,4 +25,15 @@ module.exports = angular $scope.$on('$stateChangeSuccess', initialize); + $scope.displayLogs = () => { + $scope.logs = $scope.stage.context.jobStatus.logs || ''; + $scope.jobName = $scope.stage.context.jobStatus.name || ''; + return $uibModal.open({ + templateUrl: require('./runJobLogs.html'), + controller: 'CloseableModalCtrl', + scope: $scope, + size: 'lg' + }); + }; + }); diff --git a/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.html b/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.html index 936056f3b43..259d3fce301 100644 --- a/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.html +++ b/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobExecutionDetails.html @@ -17,6 +17,10 @@ {{[container.imageDescription.repository, execution.trigger.tag].join(':')}} +
Logs
+
+
Console Output (Raw)
+
diff --git a/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobLogs.html b/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobLogs.html new file mode 100644 index 00000000000..52530ba490e --- /dev/null +++ b/app/scripts/modules/kubernetes/src/pipeline/stages/runJob/runJobLogs.html @@ -0,0 +1,14 @@ +
+ + +
+ + +
+