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 2016/05/25 20:19:25 UTC
aurora git commit: Removing requestedPorts usage from the UI
Repository: aurora
Updated Branches:
refs/heads/master 3cf6e4e2b -> 310180fcd
Removing requestedPorts usage from the UI
Reviewed at https://reviews.apache.org/r/47846/
Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/310180fc
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/310180fc
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/310180fc
Branch: refs/heads/master
Commit: 310180fcdb1c427ef6fd3a5d21bdd1b6878069b3
Parents: 3cf6e4e
Author: Maxim Khutornenko <ma...@apache.org>
Authored: Wed May 25 13:19:18 2016 -0700
Committer: Maxim Khutornenko <ma...@apache.org>
Committed: Wed May 25 13:19:18 2016 -0700
----------------------------------------------------------------------
.../scheduler/assets/configSummary.html | 8 +++---
.../scheduler/assets/js/controllers.js | 4 +--
.../resources/scheduler/assets/js/filters.js | 26 ++++++++++++++------
.../resources/scheduler/assets/js/services.js | 1 -
4 files changed, 24 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/aurora/blob/310180fc/src/main/resources/scheduler/assets/configSummary.html
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/configSummary.html b/src/main/resources/scheduler/assets/configSummary.html
index 97104de..36df616 100644
--- a/src/main/resources/scheduler/assets/configSummary.html
+++ b/src/main/resources/scheduler/assets/configSummary.html
@@ -23,11 +23,11 @@
</tr>
<tr>
<td>ram</td>
- <td>{{group.summary.schedulingDetail.resources | toResourceValue:'RAM'}}</td>
+ <td>{{group.summary.schedulingDetail.resources | toResourceValue:'RAM_MB'}}</td>
</tr>
<tr>
<td>disk</td>
- <td>{{group.summary.schedulingDetail.resources | toResourceValue:'Disk'}}</td>
+ <td>{{group.summary.schedulingDetail.resources | toResourceValue:'DISK_MB'}}</td>
</tr>
<tr>
<td class="cellLabel">constraints</td>
@@ -41,9 +41,9 @@
<td class="cellLabel">service</td>
<td colspan="2">{{group.summary.schedulingDetail.isService}}</td>
</tr>
- <tr ng-if='group.summary.schedulingDetail.ports'>
+ <tr ng-if='(group.summary.schedulingDetail.resources | toResourceValue:"PORTS").length > 0'>
<td class="cellLabel">ports</td>
- <td colspan="2">{{group.summary.schedulingDetail.ports}}</td>
+ <td colspan="2">{{group.summary.schedulingDetail.resources | toResourceValue:'PORTS'}}</td>
</tr>
<tr ng-if='group.summary.schedulingDetail.metadata'>
<td class="cellLabel">metadata</td>
http://git-wip-us.apache.org/repos/asf/aurora/blob/310180fc/src/main/resources/scheduler/assets/js/controllers.js
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/js/controllers.js b/src/main/resources/scheduler/assets/js/controllers.js
index 2131c42..f7ebe6c 100644
--- a/src/main/resources/scheduler/assets/js/controllers.js
+++ b/src/main/resources/scheduler/assets/js/controllers.js
@@ -181,8 +181,8 @@
return {
resource: name,
cpus: $filter('toResourceValue')(consumption[vector].resources, 'CPUS'),
- ram: $filter('toResourceValue')(consumption[vector].resources, 'RAM'),
- disk: $filter('toResourceValue')(consumption[vector].resources, 'Disk')
+ ram: $filter('toResourceValue')(consumption[vector].resources, 'RAM_MB'),
+ disk: $filter('toResourceValue')(consumption[vector].resources, 'DISK_MB')
};
}
http://git-wip-us.apache.org/repos/asf/aurora/blob/310180fc/src/main/resources/scheduler/assets/js/filters.js
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/js/filters.js b/src/main/resources/scheduler/assets/js/filters.js
index 34fc185..98f786e 100644
--- a/src/main/resources/scheduler/assets/js/filters.js
+++ b/src/main/resources/scheduler/assets/js/filters.js
@@ -96,22 +96,32 @@
var RESOURCE_MAP = {
'CPUS': {
filter: function (e) { return e.numCpus !== null; },
- format: function (v) { return v.numCpus + ' cores'; }
+ format: function (v) { return _.first(v).numCpus + ' cores'; }
},
- 'RAM': {
+ 'RAM_MB': {
filter: function (e) { return e.ramMb !== null; },
- format: function (v) { return formatMem(v.ramMb); }
+ format: function (v) { return formatMem(_.first(v).ramMb); }
},
- 'Disk': {
+ 'DISK_MB': {
filter: function (e) { return e.diskMb !== null; },
- format: function (v) { return formatMem(v.diskMb); }
+ format: function (v) { return formatMem(_.first(v).diskMb); }
+ },
+ 'PORTS': {
+ filter: function (e) { return e.namedPort !== null; },
+ format: function (v) {
+ return _.chain(v)
+ .map(function (r) { return r.namedPort; })
+ .sortBy()
+ .value()
+ .join(', ');
+ }
}
};
if (RESOURCE_MAP.hasOwnProperty(type)) {
- var resource = _.find(resources, RESOURCE_MAP[type].filter);
- if (resource) {
- return RESOURCE_MAP[type].format(resource);
+ var match = _.filter(resources, RESOURCE_MAP[type].filter);
+ if (match && !_.isEmpty(match)) {
+ return RESOURCE_MAP[type].format(match);
}
}
http://git-wip-us.apache.org/repos/asf/aurora/blob/310180fc/src/main/resources/scheduler/assets/js/services.js
----------------------------------------------------------------------
diff --git a/src/main/resources/scheduler/assets/js/services.js b/src/main/resources/scheduler/assets/js/services.js
index a633396..b3a0a99 100644
--- a/src/main/resources/scheduler/assets/js/services.js
+++ b/src/main/resources/scheduler/assets/js/services.js
@@ -436,7 +436,6 @@
isService: task.isService,
production: task.production,
contact: task.contactEmail || '',
- ports: _.sortBy(task.requestedPorts).join(', '),
constraints: constraints,
metadata: metadata,
container: container