Parcourir la source

AMBARI-2439. Widget tweaks for hover info. (Xi Wang via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1495221 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako il y a 12 ans
Parent
commit
e0ce9f3181

+ 1 - 1
ambari-web/app/templates/main/dashboard/widgets/simple_text.hbs

@@ -26,7 +26,7 @@
       <i class="icon-edit"></i>
       <i class="icon-edit"></i>
     </a>
     </a>
 
 
-    <div class="hidden-info">
+    <div {{bindAttr class="view.hiddenInfoClass" }}>
       <table align="center">
       <table align="center">
         {{#each line in view.hiddenInfo}}
         {{#each line in view.hiddenInfo}}
           <tr><td>{{line}}</td></tr>
           <tr><td>{{line}}</td></tr>

+ 1 - 1
ambari-web/app/templates/main/dashboard/widgets/uptime.hbs

@@ -22,7 +22,7 @@
       <i class="icon-remove-sign icon-large"></i>
       <i class="icon-remove-sign icon-large"></i>
     </a>
     </a>
     <div class="caption span11"> {{view.title}} </div>
     <div class="caption span11"> {{view.title}} </div>
-    <div class="hidden-info-three-line">
+    <div {{bindAttr class="view.hiddenInfoClass"}}>
       <table align="center">
       <table align="center">
         {{#each line in view.hiddenInfo}}
         {{#each line in view.hiddenInfo}}
           <tr>
           <tr>

+ 1 - 0
ambari-web/app/views/main/dashboard/widget.js

@@ -45,6 +45,7 @@ App.DashboardWidgetView = Em.View.extend({
   isLinks: false,
   isLinks: false,
   content: null, // widget content pieChart/ text/ progress bar/links/ metrics. etc
   content: null, // widget content pieChart/ text/ progress bar/links/ metrics. etc
   hiddenInfo: null, // more info details
   hiddenInfo: null, // more info details
+  hiddenInfoClass: "hidden-info",
 
 
   thresh1: null, //num not string
   thresh1: null, //num not string
   thresh2: null,
   thresh2: null,

+ 4 - 3
ambari-web/app/views/main/dashboard/widgets/datanode_live.js

@@ -31,11 +31,12 @@ App.DataNodeUpView = App.DashboardWidgetView.extend({
 
 
   hiddenInfo: function () {
   hiddenInfo: function () {
     var result = [];
     var result = [];
-    result.pushObject(this.get('model.liveDataNodes.length') + ' ' + this.t('dashboard.services.hdfs.nodes.live') + '/ ' +
-      this.get('model.deadDataNodes.length') + ' ' + this.t('dashboard.services.hdfs.nodes.dead') + '/ ' +
-      this.get('model.decommissionDataNodes.length')+ ' ' + this.t('dashboard.services.hdfs.nodes.decom'));
+    result.pushObject(this.get('model.liveDataNodes.length') + ' ' + this.t('dashboard.services.hdfs.nodes.live'));
+    result.pushObject(this.get('model.deadDataNodes.length') + ' ' + this.t('dashboard.services.hdfs.nodes.dead'));
+    result.pushObject(this.get('model.decommissionDataNodes.length')+ ' ' + this.t('dashboard.services.hdfs.nodes.decom'));
     return result;
     return result;
   }.property('model.liveDataNodes.length','model.deadDataNodes.length','model.decommissionDataNodes.length'),
   }.property('model.liveDataNodes.length','model.deadDataNodes.length','model.decommissionDataNodes.length'),
+  hiddenInfoClass: "hidden-info-three-line",
 
 
   classNameBindings: ['isRed', 'isOrange', 'isGreen'],
   classNameBindings: ['isRed', 'isOrange', 'isGreen'],
   isRed: function () {
   isRed: function () {

+ 1 - 0
ambari-web/app/views/main/dashboard/widgets/hbase_master_uptime.js

@@ -30,6 +30,7 @@ App.HBaseMasterUptimeView = App.DashboardWidgetView.extend({
   isProgressBar: false,
   isProgressBar: false,
   model_type: 'hbase',
   model_type: 'hbase',
   hiddenInfo: [],
   hiddenInfo: [],
+  hiddenInfoClass: "hidden-info-three-line",
 
 
   classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'],
   classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'],
   isGreen: function () {
   isGreen: function () {

+ 1 - 0
ambari-web/app/views/main/dashboard/widgets/jobtracker_uptime.js

@@ -30,6 +30,7 @@ App.JobTrackerUptimeView = App.DashboardWidgetView.extend({
   isProgressBar: false,
   isProgressBar: false,
   model_type: 'mapreduce',
   model_type: 'mapreduce',
   hiddenInfo: [],
   hiddenInfo: [],
+  hiddenInfoClass: "hidden-info-three-line",
 
 
   classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'],
   classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'],
   isGreen: function () {
   isGreen: function () {

+ 5 - 2
ambari-web/app/views/main/dashboard/widgets/mapreduce_slots.js

@@ -31,12 +31,15 @@ App.MapReduceSlotsView = App.DashboardWidgetView.extend({
   hiddenInfo: function (){
   hiddenInfo: function (){
     var result = [];
     var result = [];
     if(this.get('isViewExist')){
     if(this.get('isViewExist')){
-      result.pushObject('Occupied Slots/ Reserved Slots/ Total Slots');
+      var line1 = "Map: " + this.get('model.mapSlotsOccupied') + " Occupied / " + this.get('model.mapSlotsReserved') + " Reserved / " + this.get('model.mapSlots') + " Total";
+      result.pushObject(line1);
+      var line2 = "Reduce: " + this.get('model.reduceSlotsOccupied') + " Occupied / " + this.get('model.reduceSlotsReserved') + " Reserved / " + this.get('model.reduceSlots') + " Total";
+      result.pushObject(line2);
     }else{
     }else{
       result.pushObject('MapReduce Not Started');
       result.pushObject('MapReduce Not Started');
     }
     }
     return result;
     return result;
-  }.property('isViewExist'),
+  }.property('isViewExist', 'map_display_text', 'reduce_display_text'),
   isViewExist: function () {
   isViewExist: function () {
     return this.get('model.mapSlotsOccupied') != null && this.get('model.mapSlotsReserved') != null && this.get('model.reduceSlotsOccupied') != null && this.get('model.reduceSlotsReserved') != null;
     return this.get('model.mapSlotsOccupied') != null && this.get('model.mapSlotsReserved') != null && this.get('model.reduceSlotsOccupied') != null && this.get('model.reduceSlotsReserved') != null;
   }.property('model.mapSlotsReserved', 'model.mapSlotsOccupied', 'model.reduceSlotsReserved', 'model.reduceSlotsOccupied'),
   }.property('model.mapSlotsReserved', 'model.mapSlotsOccupied', 'model.reduceSlotsReserved', 'model.reduceSlotsOccupied'),

+ 1 - 0
ambari-web/app/views/main/dashboard/widgets/namenode_uptime.js

@@ -30,6 +30,7 @@ App.NameNodeUptimeView = App.DashboardWidgetView.extend({
   isProgressBar: false,
   isProgressBar: false,
   model_type: 'hdfs',
   model_type: 'hdfs',
   hiddenInfo: [],
   hiddenInfo: [],
+  hiddenInfoClass: "hidden-info-three-line",
 
 
   classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'],
   classNameBindings: ['isRed', 'isOrange', 'isGreen', 'isNA'],
   isGreen: function () {
   isGreen: function () {

+ 2 - 2
ambari-web/app/views/main/dashboard/widgets/tasktracker_live.js

@@ -33,9 +33,9 @@ App.TaskTrackerUpView = App.DashboardWidgetView.extend({
     var svc = this.get('model');
     var svc = this.get('model');
     var liveCount = svc.get('aliveTrackers').get('length');
     var liveCount = svc.get('aliveTrackers').get('length');
     var totalCount = svc.get('taskTrackers').get('length');
     var totalCount = svc.get('taskTrackers').get('length');
-    var template = this.t('dashboard.services.mapreduce.trackersSummary');
     var result = [];
     var result = [];
-    result.pushObject(template.format(liveCount, totalCount));
+    result.pushObject(liveCount + " live");
+    result.pushObject(totalCount + " total");
     return result;
     return result;
   }.property('model.aliveTrackers.length', 'model.taskTrackers.length'),
   }.property('model.aliveTrackers.length', 'model.taskTrackers.length'),