Browse Source

AMBARI-1226. On Dashboard, links to host components are missing. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1435453 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
1efc30be0f

+ 2 - 0
CHANGES.txt

@@ -75,6 +75,8 @@ Trunk (unreleased changes):
 
 
  BUG FIXES
  BUG FIXES
 
 
+ AMBARI-1226. On Dashboard, links to host components are missing. (yusaku)
+
  AMBARI-1219. After adding hosts, the number of live TaskTrackers is not
  AMBARI-1219. After adding hosts, the number of live TaskTrackers is not
  updated. (yusaku)
  updated. (yusaku)
 
 

+ 11 - 0
ambari-web/app/messages.js

@@ -381,6 +381,17 @@ Em.I18n.translations = {
   'dashboard.services.hbase.masterStarted':'Master Started',
   'dashboard.services.hbase.masterStarted':'Master Started',
   'dashboard.services.hbase.masterActivated':'Master Activated',
   'dashboard.services.hbase.masterActivated':'Master Activated',
 
 
+  'dashboard.services.hive.client': '{0} Hive Client',
+  'dashboard.services.hive.clients': '{0} Hive Clients',
+
+  'dashboard.services.oozie.client': '{0} Oozie Client',
+  'dashboard.services.oozie.clients': '{0} Oozie Clients',
+  'dashboard.services.oozie.webUi': 'Oozie Web UI',
+
+  'dashboard.services.zookeeper.prefix': '{0} of',
+  'dashboard.services.zookeeper.title': '{0} ZooKeepers',
+  'dashboard.services.zookeeper.postfix': 'running',
+
   'dashboard.services.configs.popup.stopService.header':'Stop service',
   'dashboard.services.configs.popup.stopService.header':'Stop service',
   'dashboard.services.configs.popup.stopService.body' : 'Service needs to be stopped for reconfiguration',
   'dashboard.services.configs.popup.stopService.body' : 'Service needs to be stopped for reconfiguration',
   'dashboard.services.configs.popup.restartService.header' : 'Restart service',
   'dashboard.services.configs.popup.restartService.header' : 'Restart service',

+ 1 - 1
ambari-web/app/styles/application.less

@@ -775,7 +775,7 @@ a:focus {
     .clearfix {
     .clearfix {
       padding-bottom: 8px;
       padding-bottom: 8px;
     }
     }
-    #hdfs-info, #mapreduce-info, #hbase-info {
+    .service-body {
       display: none;
       display: none;
       position: relative;
       position: relative;
     }
     }

+ 1 - 1
ambari-web/app/templates/main/dashboard/service/hbase.hbs

@@ -36,7 +36,7 @@
     {{view.summaryHeader}}
     {{view.summaryHeader}}
   </div>
   </div>
 </div>
 </div>
-<div id="hbase-info">
+<div class="service-body">
   <div class="span4">
   <div class="span4">
     <table class="table no-borders">
     <table class="table no-borders">
       <tbody>
       <tbody>

+ 1 - 1
ambari-web/app/templates/main/dashboard/service/hdfs.hbs

@@ -36,7 +36,7 @@
     {{view.summaryHeader}}
     {{view.summaryHeader}}
   </div>
   </div>
 </div>
 </div>
-<div id="hdfs-info">
+<div class="service-body">
   <div class="span4">
   <div class="span4">
     <table class="table no-borders">
     <table class="table no-borders">
       <tbody>
       <tbody>

+ 5 - 7
ambari-web/app/templates/main/dashboard/service/hive.hbs

@@ -28,12 +28,10 @@
     {{/if}}
     {{/if}}
   </div>
   </div>
   <div class="summary span">
   <div class="summary span">
-    {{#each component in view.service.components}}
-    {{#if component.type}}
-    <a href="#" {{action selectHost component.host}}>{{component.displayName}}</a>,
-    {{else}}
-    <a href="#" {{action filterHosts component}}>{{component.displayName}}</a>
-    {{/if}}
+    {{#each component in view.titleMasters}}
+      <a href="#" {{action showDetails component.host}}>{{component.displayName}}</a>,
     {{/each}}
     {{/each}}
+
+    <a href="#" {{action filterHosts view.clients.component}}>{{view.clients.title}}</a>
   </div>
   </div>
-</div>
+</div>

+ 1 - 1
ambari-web/app/templates/main/dashboard/service/mapreduce.hbs

@@ -36,7 +36,7 @@
     {{view.summaryHeader}}
     {{view.summaryHeader}}
   </div>
   </div>
 </div>
 </div>
-<div id="mapreduce-info">
+<div class="service-body">
   <div class="span4">
   <div class="span4">
     <table class="table no-borders">
     <table class="table no-borders">
       <tbody>
       <tbody>

+ 8 - 7
ambari-web/app/templates/main/dashboard/service/oozie.hbs

@@ -28,12 +28,13 @@
     {{/if}}
     {{/if}}
   </div>
   </div>
   <div class="summary span">
   <div class="summary span">
-    {{#each component in view.service.components}}
-    {{#if component.type}}
-    <a href="#" {{action selectHost component.host}}>{{component.displayName}}</a>,
-    {{else}}
-    <a href="#" {{action filterHosts component}}>{{component.displayName}}</a>
-    {{/if}}
+    {{#each component in view.masters}}
+      <a href="#" {{action showDetails component.host}}>{{component.displayName}}</a>,
     {{/each}}
     {{/each}}
+
+    <a href="#" {{action filterHosts view.clients.component}}>{{view.clients.title}}</a>,
+
+    <a href="{{unbound view.webUi}}" target="_blank">{{t dashboard.services.oozie.webUi}}</a>
+
   </div>
   </div>
-</div>
+</div>

+ 4 - 8
ambari-web/app/templates/main/dashboard/service/zookeeper.hbs

@@ -28,12 +28,8 @@
     {{/if}}
     {{/if}}
   </div>
   </div>
   <div class="summary span">
   <div class="summary span">
-    {{#each component in view.service.components}}
-    {{#if component.type}}
-    <a href="#" {{action selectHost component.host}}>{{component.displayName}}</a>,
-    {{else}}
-    <a href="#" {{action filterHosts component}}>{{component.displayName}}</a>
-    {{/if}}
-    {{/each}}
+    {{view.titleInfo.pre}}
+    <a href="#" {{action filterHosts view.titleInfo.component}}>{{view.titleInfo.title}}</a>
+    {{t dashboard.services.zookeeper.postfix}}
   </div>
   </div>
-</div>
+</div>

+ 26 - 1
ambari-web/app/views/main/dashboard/service.js

@@ -93,6 +93,31 @@ App.MainDashboardServiceView = Em.View.extend({
   criticalAlertsCount: function () {
   criticalAlertsCount: function () {
     var alerts = App.router.get('clusterController.alerts');
     var alerts = App.router.get('clusterController.alerts');
     return alerts.filterProperty('serviceType', this.get('service.id')).filterProperty('isOk', false).length;
     return alerts.filterProperty('serviceType', this.get('service.id')).filterProperty('isOk', false).length;
-  }.property('App.router.clusterController.alerts')
+  }.property('App.router.clusterController.alerts'),
+
+  isCollapsed: false,
+
+  toggleInfoView: function () {
+    this.$('.service-body').toggle('blind', 200);
+    this.set('isCollapsed', !this.isCollapsed);
+  },
+
+  masters: function(){
+    return this.get('service.hostComponents').filterProperty('isMaster', true);
+  }.property('service'),
+
+  clients: function(){
+    var clients = this.get('service.hostComponents').filterProperty('isClient', true);
+    var len = clients.length;
+    var template = 'dashboard.services.{0}.client'.format(this.get('serviceName').toLowerCase());
+    if(len > 1){
+      template += 's';
+    }
+
+    return {
+      title: this.t(template).format(len),
+      component: clients.objectAt(0)
+    };
+  }.property('service')
 
 
 });
 });

+ 1 - 7
ambari-web/app/views/main/dashboard/service/hbase.js

@@ -83,12 +83,6 @@ App.MainDashboardServiceHbaseView = App.MainDashboardServiceView.extend({
 
 
   regionServerComponent: function () {
   regionServerComponent: function () {
     return App.HostComponent.find().findProperty('componentName', 'HBASE_REGIONSERVER');
     return App.HostComponent.find().findProperty('componentName', 'HBASE_REGIONSERVER');
-  }.property('components'),
+  }.property()
 
 
-  isCollapsed: false,
-
-  toggleInfoView: function () {
-    $('#hbase-info').toggle('blind', 200);
-    this.set('isCollapsed', !this.isCollapsed);
-  }
 });
 });

+ 0 - 7
ambari-web/app/views/main/dashboard/service/hdfs.js

@@ -112,13 +112,6 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
     return App.HostComponent.find().findProperty('componentName', 'DATANODE');
     return App.HostComponent.find().findProperty('componentName', 'DATANODE');
   }.property('+'),
   }.property('+'),
 
 
-  isCollapsed: false,
-
-  toggleInfoView: function () {
-    $('#hdfs-info').toggle('blind', 200);
-    this.set('isCollapsed', !this.isCollapsed);
-  },
-
   isSafeMode: function () {
   isSafeMode: function () {
     var safeMode = this.get('service.safeModeStatus');
     var safeMode = this.get('service.safeModeStatus');
     return safeMode != null && safeMode.length > 0;
     return safeMode != null && safeMode.length > 0;

+ 6 - 1
ambari-web/app/views/main/dashboard/service/hive.js

@@ -20,5 +20,10 @@ var App = require('app');
 
 
 App.MainDashboardServiceHiveView = App.MainDashboardServiceView.extend({
 App.MainDashboardServiceHiveView = App.MainDashboardServiceView.extend({
   templateName: require('templates/main/dashboard/service/hive'),
   templateName: require('templates/main/dashboard/service/hive'),
-  serviceName: 'hive'
+  serviceName: 'hive',
+
+  titleMasters: function(){
+    var masters = this.get('masters');
+    return [masters.findProperty('componentName', 'HIVE_SERVER'), masters.findProperty('componentName', 'HIVE_METASTORE')];
+  }.property('service')
 });
 });

+ 1 - 8
ambari-web/app/views/main/dashboard/service/mapreduce.js

@@ -118,12 +118,5 @@ App.MainDashboardServiceMapreduceView = App.MainDashboardServiceView.extend({
 
 
   taskTrackerComponent: function () {
   taskTrackerComponent: function () {
     return App.HostComponent.find().findProperty('componentName', 'TASKTRACKER');
     return App.HostComponent.find().findProperty('componentName', 'TASKTRACKER');
-  }.property('components'),
-
-  isCollapsed: false,
-
-  toggleInfoView: function() {
-    $('#mapreduce-info').toggle('blind', 200);
-    this.set('isCollapsed', !this.isCollapsed);
-  }
+  }.property()
 });
 });

+ 6 - 1
ambari-web/app/views/main/dashboard/service/oozie.js

@@ -21,5 +21,10 @@ var App = require('app');
 App.MainDashboardServiceOozieView = App.MainDashboardServiceView.extend({
 App.MainDashboardServiceOozieView = App.MainDashboardServiceView.extend({
   classNames: ['no-borders'],
   classNames: ['no-borders'],
   serviceName: 'oozie',
   serviceName: 'oozie',
-  templateName: require('templates/main/dashboard/service/oozie')
+  templateName: require('templates/main/dashboard/service/oozie'),
+
+  webUi: function () {
+    var hostName = this.get('service.hostComponents').findProperty('componentName', 'OOZIE_SERVER').get('host.publicHostName');
+    return "http://{0}:11000/oozie".format(hostName);
+  }.property('service')
 });
 });

+ 17 - 1
ambari-web/app/views/main/dashboard/service/zookeeper.js

@@ -20,5 +20,21 @@ var App = require('app');
 
 
 App.MainDashboardServiceZookeperView = App.MainDashboardServiceView.extend({
 App.MainDashboardServiceZookeperView = App.MainDashboardServiceView.extend({
   templateName: require('templates/main/dashboard/service/zookeeper'),
   templateName: require('templates/main/dashboard/service/zookeeper'),
-  serviceName: 'zookeeper'
+  serviceName: 'zookeeper',
+
+  titleInfo: function(){
+    var components = this.get('service.hostComponents').filterProperty('componentName', 'ZOOKEEPER_SERVER');
+    var running = 0;
+    components.forEach(function(item){
+      if(item.get('workStatus') === App.HostComponentStatus.started){
+        running += 1;
+      }
+    });
+
+    return {
+      pre: this.t('dashboard.services.zookeeper.prefix').format(running),
+      title: this.t('dashboard.services.zookeeper.title').format(components.length),
+      component: components.objectAt(0)
+    };
+  }.property('service')
 });
 });