From 93f0895c74915a7dda1d1fa4ccd937f3671d5e7a Mon Sep 17 00:00:00 2001 From: Kyle Ellrott Date: Fri, 19 Aug 2016 11:26:22 -0700 Subject: [PATCH] Adding in web veiwer code --- share/app.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ share/index.html | 15 +++++++++++++ share/jobs.html | 36 +++++++++++++++++++++++++++++++ share/list.html | 12 +++++++++++ share/tasks.html | 41 +++++++++++++++++++++++++++++++++++ 5 files changed, 160 insertions(+) create mode 100644 share/app.js create mode 100644 share/index.html create mode 100644 share/jobs.html create mode 100644 share/list.html create mode 100644 share/tasks.html diff --git a/share/app.js b/share/app.js new file mode 100644 index 0000000..e899262 --- /dev/null +++ b/share/app.js @@ -0,0 +1,56 @@ +app = angular.module('TESApp', ['ngRoute']) + +app.controller('JobListController', function($scope, $http) { + "use strict"; + + $scope.url = "/v1/jobs"; + $scope.tasks = []; + + $scope.fetchContent = function() { + $http.get($scope.url).then(function(result){ + $scope.jobs = result.data.jobs; + }); + } + + $scope.fetchContent(); +}); + +app.controller('WorkerListController', function($scope, $http) { + "use strict"; + + $scope.url = "/v1/jobs-service"; + $scope.workers = []; + + $scope.fetchContent = function() { + $http.get($scope.url).then(function(result){ + $scope.workers = result.data; + }); + } + + $scope.fetchContent(); +}); + +app.controller('JobInfoController', + function($scope, $http, $routeParams) { + $scope.url = "/v1/jobs/" + $routeParams.job_id + + $scope.job_info = {}; + $scope.fetchContent = function() { + $http.get($scope.url).then(function(result){ + $scope.job_info = result.data + }) + } + $scope.fetchContent(); + } +); + +app.config(['$routeProvider', + function($routeProvider) { + $routeProvider.when('/', { + templateUrl: 'static/list.html', + }). + when('/jobs/:job_id', { + templateUrl: 'static/jobs.html' + }) + } +]); \ No newline at end of file diff --git a/share/index.html b/share/index.html new file mode 100644 index 0000000..a9c8259 --- /dev/null +++ b/share/index.html @@ -0,0 +1,15 @@ + + + + + + + + +
+

TES

+
+
+
+ + \ No newline at end of file diff --git a/share/jobs.html b/share/jobs.html new file mode 100644 index 0000000..a1c8cc1 --- /dev/null +++ b/share/jobs.html @@ -0,0 +1,36 @@ +
+ <--- +

Job {{job_info.jobId}}

+ +
{{job_info.task.name}}
+
{{job_info.task.description}}
+ +
+
Commands
+
+
Container: {{item.imageName}}
+
Container: {{item.cmd}}
+
+
+ +
Requirements
+
+ {{item}} +
+ +
State: {{job_info.state}}
+ +
+
Logs
+
+
ExitCode
+
{{item.exitCode}}
+ +
STDERR
+
{{item.stderr}}
+ +
STDOUT
+
{{item.stdout}}
+
+
+
\ No newline at end of file diff --git a/share/list.html b/share/list.html new file mode 100644 index 0000000..e9185d7 --- /dev/null +++ b/share/list.html @@ -0,0 +1,12 @@ + +

Tasks

+
+ + + + + + + +
{{item.jobId}}{{item.state}}
+
diff --git a/share/tasks.html b/share/tasks.html new file mode 100644 index 0000000..27de329 --- /dev/null +++ b/share/tasks.html @@ -0,0 +1,41 @@ +
+<--- +

Task {{task_info.id}}

+ +
Command
+
{{task_info.command}}
+ +
Depends
+
{{task_info.task_depends}}
+ +
Container
+
{{task_info.container}}
+ +
Arguments
+
+ {{item}} +
+ +
Tags
+
+ {{item}} +
+ +
Requirements
+
+ {{item}} +
+ +
State
+
{{task_info.state}}
+ +
Max Retries
+
{{task_info.max_retry}}
+ + +
Jobs
+
+ {{item}} +
+ +
\ No newline at end of file