You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2014/05/30 00:33:03 UTC
git commit: AMBARI-5946. Populate summary section of Slider App
(alexantonenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 48e3201ef -> 36439d08c
AMBARI-5946. Populate summary section of Slider App (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/36439d08
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/36439d08
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/36439d08
Branch: refs/heads/trunk
Commit: 36439d08c2eaa81910f301e037800c53f8f4b4ea
Parents: 48e3201
Author: Alex Antonenko <hi...@gmail.com>
Authored: Fri May 30 00:05:00 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Fri May 30 01:32:33 2014 +0300
----------------------------------------------------------------------
.../slider_app/summary_controller.js | 6 ++--
.../ui/app/mappers/slider_apps_mapper.js | 15 +++++++---
.../ui/app/templates/slider_app/summary.hbs | 30 ++++++++++++++++++++
.../src/main/resources/ui/app/translations.js | 7 ++++-
4 files changed, 50 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/36439d08/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
index 7e8d6e6..23bf2a6 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
@@ -17,7 +17,7 @@
*/
App.SliderAppSummaryController = Ember.Controller.extend({
-
-
-
+ appType: function () {
+ return this.get('model.appType.displayName');
+ }.property('model.appType')
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/36439d08/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
index 488390b..dbe62bf 100644
--- a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
+++ b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js
@@ -134,8 +134,15 @@ App.SliderAppsMapper = App.Mapper.createWithMixins(App.RunPeriodically, {
var componentsId = app.components ? self.parseComponents(app) : [],
configs = app.configs ? self.parseConfigs(app) : {},
quickLinks = self.parseQuickLinks(app),
- jmx = self.parseObject(app.jmx);
-
+ jmx = self.parseObject(app.jmx),
+ masterActiveTime = jmx.findProperty('key', 'MasterActiveTime'),
+ masterStartTime = jmx.findProperty('key', 'MasterStartTime');
+ if(masterActiveTime){
+ masterActiveTime.value = new Date(Date.now() - masterActiveTime.value).getHours() + "h:" + new Date(Date.now() - masterActiveTime.value).getMinutes() + "m";
+ }
+ if(masterStartTime){
+ masterStartTime.value = (new Date(masterStartTime.value).toUTCString());
+ }
apps.push(
Ember.Object.create({
id: app.id,
@@ -143,10 +150,10 @@ App.SliderAppsMapper = App.Mapper.createWithMixins(App.RunPeriodically, {
name: app.name,
status: app.state,
user: app.user,
- started: (new Date(app.startTime).toUTCString()),
+ started: app.startTime ? (new Date(app.startTime).toUTCString()) : "-",
ended: app.endTime ? (new Date(app.endTime).toUTCString()) : "-",
appType: app.type.toUpperCase(),
- diagnostics: app.diagnostics,
+ diagnostics: app.diagnostics ? app.diagnostics : "-",
components: componentsId,
quickLinks: quickLinks,
configs: configs,
http://git-wip-us.apache.org/repos/asf/ambari/blob/36439d08/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
index dbf6f62..da4f15e 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_app/summary.hbs
@@ -20,6 +20,36 @@
<div class="row">
<div class="col-md-6">
{{#bs-panel heading="Summary"}}
+ <table class="table table-striped table-bordered table-condensed">
+ <tbody>
+ <tr>
+ <td>{{t common.status}}</td>
+ <td>{{controller.model.status}}</td>
+ </tr>
+ <tr>
+ <td>{{t common.type}}</td>
+ <td>{{controller.appType}}</td>
+ </tr>
+ <tr>
+ <td>{{t common.started}}</td>
+ <td>{{formatWordBreak controller.model.started}}</td>
+ </tr>
+ <tr>
+ <td>{{t common.finished}}</td>
+ <td>{{formatWordBreak controller.model.ended}}</td>
+ </tr>
+ <tr>
+ <td>{{t common.diagnostics}}</td>
+ <td>{{formatWordBreak controller.model.diagnostics}}</td>
+ </tr>
+ {{#each controller.model.jmx}}
+ <tr>
+ <td>{{key}}</td>
+ <td>{{formatWordBreak value}}</td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
{{/bs-panel}}
</div>
<div class="col-md-6">
http://git-wip-us.apache.org/repos/asf/ambari/blob/36439d08/contrib/views/slider/src/main/resources/ui/app/translations.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/translations.js b/contrib/views/slider/src/main/resources/ui/app/translations.js
index de9a5b7..f687abb 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -38,7 +38,12 @@ Em.I18n.translations = {
'confirmation': 'Confirmation',
'configuration': 'Configuration',
'finish': 'Finish',
- 'components': 'Components'
+ 'components': 'Components',
+ 'type': 'Type',
+ 'status': 'Status',
+ 'started': 'Started',
+ 'finished': 'Finished',
+ 'diagnostics': 'Diagnostics'
},
'popup.confirmation.commonHeader': 'Confirmation',