ソースを参照

AMBARI-1879. Show error message when hostname is undefined for quick_links. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1467028 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年 前
コミット
f525b88a84

+ 3 - 0
CHANGES.txt

@@ -241,6 +241,9 @@ Trunk (unreleased changes):
 
  IMPROVEMENTS
 
+ AMBARI-1879. Show error message when hostname is undefined for quick_links.
+ (yusaku)
+
  AMBARI-1877. Reassign Master Wizard, Step 2: prevent proceed next without
  changing target host. (yusaku)
 

+ 5 - 1
ambari-web/app/messages.js

@@ -1091,6 +1091,10 @@ Em.I18n.translations = {
   'common.combobox.placeholder': 'Filter...',
   'common.combobox.dropdown.1': 'Overridden properties',
   'common.combobox.dropdown.2': 'Modified properties',
-  'common.combobox.dropdown.3': 'Properties needing restart'
+  'common.combobox.dropdown.3': 'Properties needing restart',
+
+  'quick.links.error.label': 'Hostname is undefined',
+
+  'contact.administrator': 'Contact System Administrator for more information!'
 
 };

+ 9 - 8
ambari-web/app/views/common/quick_view_link_view.js

@@ -23,8 +23,6 @@ App.QuickViewLinks = Em.View.extend({
   /**
    * Updated quick links. Here we put correct hostname to url
    */
-  errorFlag: false,
-
   quickLinks: function () {
     var serviceName = this.get('content.serviceName');
     var components = this.get('content.hostComponents');
@@ -35,15 +33,18 @@ App.QuickViewLinks = Em.View.extend({
     } else if (serviceName === 'MAPREDUCE') {
       host = components.findProperty('componentName', 'JOBTRACKER').get('host.publicHostName');
     } else if (serviceName === 'HBASE') {
-      if (components.filterProperty('componentName', 'HBASE_MASTER').someProperty('haStatus', 'active')) {
-        host = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active').get('host.publicHostName');
-      }
-      else {
-        this.set('errorFlag', true);
+      var component = components.filterProperty('componentName', 'HBASE_MASTER').findProperty('haStatus', 'active');
+      if(component){
+        host = component.get('host.publicHostName');
       }
     }
     if (!host) {
-      return [];
+      return [
+        {
+          label: this.t('quick.links.error.label'),
+          url: 'javascript:alert("' + this.t('contact.administrator') + '");return false;'
+        }
+      ];
     }
     return this.get('content.quickLinks').map(function (item) {
       if (item.get('url')) {