ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject git commit: AMBARI-5946. Populate summary section of Slider App (alexantonenko)
Date Thu, 29 May 2014 22:51:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.0.slider d0236071f -> a7839a120


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/a7839a12
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a7839a12
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a7839a12

Branch: refs/heads/branch-1.6.0.slider
Commit: a7839a120ece456a8cde4f063d220c00136cf5d3
Parents: d023607
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri May 30 01:51:33 2014 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Fri May 30 01:51:33 2014 +0300

----------------------------------------------------------------------
 .../slider_app/summary_controller.js            |  6 ++--
 .../ui/app/mappers/slider_apps_mapper.js        | 15 ++++++---
 .../ui/app/templates/slider_app/summary.hbs     | 32 +++++++++++++++++++-
 .../src/main/resources/ui/app/translations.js   |  9 ++++--
 4 files changed, 52 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a7839a12/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/a7839a12/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/a7839a12/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..b6628c9 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">
@@ -38,4 +68,4 @@
       {{/each}}
     {{/bs-panel}}
   {{/if}}
-</div>
\ No newline at end of file
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a7839a12/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..54f98a9 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',
@@ -76,4 +81,4 @@ Em.I18n.translations = {
   'wizard.step4.name': 'Deploy',
   'wizard.step4.appName': 'App Name',
   'wizard.step4.appType': 'App Type'
-};
\ No newline at end of file
+};


Mime
View raw message