You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ma...@apache.org on 2014/04/05 02:04:54 UTC
[08/50] [abbrv] git commit: Now rendering task events.
Now rendering task events.
Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/cd3f9509
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/cd3f9509
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/cd3f9509
Branch: refs/heads/mansu/job_page
Commit: cd3f9509b7a2118768331ab3f1f5900d23bb1235
Parents: 118973d
Author: Suman Karumuri <sk...@twitter.com>
Authored: Thu Mar 27 00:16:49 2014 -0700
Committer: Suman Karumuri <sk...@twitter.com>
Committed: Thu Mar 27 00:16:49 2014 -0700
----------------------------------------------------------------------
.../apache/aurora/scheduler/http/ui/js/controllers.js | 14 ++++++++++++--
.../apache/aurora/scheduler/http/ui/js/directives.js | 3 +--
.../apache/aurora/scheduler/http/ui/taskStatus.html | 12 +++++++++++-
3 files changed, 24 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/cd3f9509/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
index d8182be..fc01d06 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/controllers.js
@@ -295,7 +295,7 @@ auroraUIControllers.controller('JobController',
var taskColumns = [
{label: 'Instance', map: 'instanceId'},
- {label: 'Status', map: 'status'},
+ {label: 'Status', map: 'status', cellTemplateUrl: '/taskStatus.html'},
{label: 'Last Active', map: 'latestActivity',
formatFunction: function (date) {
return fromNow(date);
@@ -361,7 +361,7 @@ auroraUIControllers.controller('JobController',
: lastTaskTimestamp - runningTaskEvent.timestamp,
isActive: isActive,
taskId: task.assignedTask.taskId,
- taskEvents: sortedTaskEvents
+ taskEvents: toTaskEvents(sortedTaskEvents)
};
})
.value();
@@ -400,5 +400,15 @@ auroraUIControllers.controller('JobController',
function fromNow(date, dropSuffix) {
return moment(date).fromNow(dropSuffix);
}
+
+ function toTaskEvents(taskEvents) {
+ return _.map(taskEvents, function (taskEvent) {
+ return {
+ date: moment(taskEvent.timestamp).format('MM DD h:mm:ss z'),
+ status: _.invert(ScheduleStatus)[taskEvent.status],
+ message: taskEvent.message
+ };
+ });
+ }
}
);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/cd3f9509/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
index b8a22aa..4c03133 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/js/directives.js
@@ -46,8 +46,7 @@ auroraUI.directive('taskSandboxLink', function () {
auroraUI.directive('taskStatus', function () {
return {
- restrict: 'C',
- template: '<span title="TEST">{{formatedValue}}</span>'
+ restrict: 'E'
};
});
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/cd3f9509/src/main/resources/org/apache/aurora/scheduler/http/ui/taskStatus.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/taskStatus.html b/src/main/resources/org/apache/aurora/scheduler/http/ui/taskStatus.html
index 4205db4..ff2693e 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/taskStatus.html
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/taskStatus.html
@@ -1 +1,11 @@
-<div class='task-status task-status-tooltip'></div>
\ No newline at end of file
+<task-status>
+ <div>
+ {{formatedValue}}
+ <ul>
+ <li ng-repeat='taskEvent in dataRow.taskEvents'>
+ {{taskEvent.date}} - {{taskEvent.status}}
+ <span ng-if='taskEvent.message'> - {{taskEvent.message}}</span>
+ </li>
+ </ul>
+ </div>
+</task-status>
\ No newline at end of file