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:05:00 UTC
[14/50] [abbrv] git commit: Now rendering schedulingDetails using
cell template.
Now rendering schedulingDetails using cell template.
Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/940b6c61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/940b6c61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/940b6c61
Branch: refs/heads/mansu/job_page
Commit: 940b6c6196189959020b4f99e4997624f9b36ac9
Parents: 419ff53
Author: Suman Karumuri <sk...@twitter.com>
Authored: Fri Mar 28 00:22:17 2014 -0700
Committer: Suman Karumuri <sk...@twitter.com>
Committed: Fri Mar 28 00:22:17 2014 -0700
----------------------------------------------------------------------
.../aurora/scheduler/http/ServletModule.java | 1 +
.../apache/aurora/scheduler/http/ui/css/app.css | 4 ++++
.../aurora/scheduler/http/ui/js/controllers.js | 16 +++++++++------
.../aurora/scheduler/http/ui/js/directives.js | 8 +++++++-
.../scheduler/http/ui/schedulingDetail.html | 21 ++++++++++++++++++++
5 files changed, 43 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/940b6c61/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java b/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
index 1286c76..1531ed8 100644
--- a/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
+++ b/src/main/java/org/apache/aurora/scheduler/http/ServletModule.java
@@ -203,6 +203,7 @@ public class ServletModule extends AbstractModule {
registerAsset("ui/taskSandbox.html", "/taskSandbox.html");
registerAsset("ui/taskStatus.html", "/taskStatus.html");
registerAsset("ui/taskLink.html", "/taskLink.html");
+ registerAsset("ui/schedulingDetail.html", "/schedulingDetail.html");
registerAsset("ui/css/app.css", "/css/app.css");
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/940b6c61/src/main/resources/org/apache/aurora/scheduler/http/ui/css/app.css
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/css/app.css b/src/main/resources/org/apache/aurora/scheduler/http/ui/css/app.css
index e327dc9..151a98e 100644
--- a/src/main/resources/org/apache/aurora/scheduler/http/ui/css/app.css
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/css/app.css
@@ -29,3 +29,7 @@ ul.breadcrumb {
margin: 0px auto;
float: none;
}
+
+.undecorated-list {
+ list-style: none;
+}
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/940b6c61/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 45a522d..3bed4b8 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
@@ -287,8 +287,12 @@ auroraUIControllers.controller('JobController',
$scope.taskSummary = [];
$scope.taskSummaryTableColumns = [
- {label: 'Instances', map: 'range', isSortable: false},
- {label: 'Details', map: 'schedulingDetails', isSortable: false}
+ {label: 'Instances', map: 'range', isSortable: false,
+ formatFunction: function (range) {
+ return range.start === range.end ? range.start : range.start + '-' + range.end;
+ }},
+ {label: 'Details', map: 'schedulingDetail', isSortable: false,
+ cellTemplateUrl: '/schedulingDetail.html'}
];
//TODO: Share?
@@ -460,18 +464,18 @@ auroraUIControllers.controller('JobController',
.map(function (task) {
return {
instanceId: task.assignedTask.instanceId,
- schedulingDetails: configToDetails(task.assignedTask.task)
+ schedulingDetail: configToDetails(task.assignedTask.task)
};
})
.groupBy(function (task) {
- return JSON.stringify(task.schedulingDetails);
+ return JSON.stringify(task.schedulingDetail);
})
.map(function (tasks, schedulingDetail) {
- var schedulingDetails = _.first(tasks).schedulingDetails;
+ var schedulingDetail = _.first(tasks).schedulingDetail;
return _.map(toRanges(_.pluck(tasks, 'instanceId')), function (range) {
return {
range: range,
- schedulingDetails: schedulingDetails
+ schedulingDetail: schedulingDetail
}
});
})
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/940b6c61/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 4c03133..3f84594 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
@@ -56,4 +56,10 @@ auroraUI.directive('taskLink', function () {
template:
'<a ng-href="/scheduler/structdump/task/{{formatedValue}}"><i class="icon-cog"></i></a>'
};
-});
\ No newline at end of file
+});
+
+auroraUI.directive('schedulingDetail', function () {
+ return {
+ restrict : 'C'
+ };
+})
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/940b6c61/src/main/resources/org/apache/aurora/scheduler/http/ui/schedulingDetail.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/aurora/scheduler/http/ui/schedulingDetail.html b/src/main/resources/org/apache/aurora/scheduler/http/ui/schedulingDetail.html
new file mode 100644
index 0000000..0ce7505
--- /dev/null
+++ b/src/main/resources/org/apache/aurora/scheduler/http/ui/schedulingDetail.html
@@ -0,0 +1,21 @@
+<div class='scheduling-detail'>
+ <ul class='undecorated-list'>
+ <li>resources: cpu: {{dataRow.schedulingDetail.numCpus}} ram: {{dataRow.schedulingDetail.ramMb}}
+ disk: {{dataRow.schedulingDetail.diskMb}}
+ </li>
+ <li ng-if='dataRow.schedulingDetail.constraints'>
+ constraints : {{dataRow.schedulingDetail.constraints}}
+ </li>
+ <li>production : {{dataRow.schedulingDetail.production}}</li>
+ <li>service : {{dataRow.schedulingDetail.isService}}</li>
+ <li ng-if='dataRow.schedulingDetail.ports'>
+ ports : {{dataRow.schedulingDetail.ports}}
+ </li>
+ <li ng-if='dataRow.schedulingDetail.packages'>
+ packages : {{dataRow.schedulingDetail.packages}}
+ </li>
+ <li ng-if='dataRow.schedulingDetail.contact'>
+ contact : {{dataRow.schedulingDetail.contact}}
+ </li>
+ </ul>
+</div>
\ No newline at end of file