Browse Source

AMBARI-2573. Host Check UI: Show hover on what hosts an issue is for. (Aleksandr Kovalenko via srimanth)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1500061 13f79535-47bb-0310-9956-ffa450edef68
Srimanth 12 years ago
parent
commit
8438e60c9a

+ 33 - 0
ambari-web/app/controllers/wizard/step3_controller.js

@@ -678,6 +678,15 @@ App.WizardStep3Controller = Em.Controller.extend({
     var warnings = [];
     var warnings = [];
     var warning;
     var warning;
     var hosts = [];
     var hosts = [];
+    data.items.sort(function (a, b) {
+      if (a.Hosts.host_name > b.Hosts.host_name) {
+        return 1;
+      }
+      if (a.Hosts.host_name < b.Hosts.host_name) {
+        return -1;
+      }
+      return 0;
+    });
     data.items.forEach(function (_host) {
     data.items.forEach(function (_host) {
       var host = {
       var host = {
         name: _host.Hosts.host_name,
         name: _host.Hosts.host_name,
@@ -806,6 +815,13 @@ App.WizardStep3Controller = Em.Controller.extend({
       }
       }
       hosts.push(host);
       hosts.push(host);
     }, this);
     }, this);
+    warnings.forEach(function (warn) {
+      if (warn.hosts.length < 11) {
+        warn.hostsList = warn.hosts.join('<br>')
+      } else {
+        warn.hostsList = warn.hosts.slice(0,10).join('<br>') + '<br> ' + Em.I18n.t('installer.step3.hostWarningsPopup.moreHosts').format(warn.hosts.length - 10);
+      }
+    });
     hosts.unshift({
     hosts.unshift({
       name: 'All Hosts',
       name: 'All Hosts',
       warnings: warnings
       warnings: warnings
@@ -890,6 +906,7 @@ App.WizardStep3Controller = Em.Controller.extend({
             $(this.get('content').filterProperty('isCollapsed').map(function (cat) {
             $(this.get('content').filterProperty('isCollapsed').map(function (cat) {
               return '#' + cat.category
               return '#' + cat.category
             }).join(',')).hide();
             }).join(',')).hide();
+            this.$("[rel='HostsListTooltip']").tooltip({html: true, placement: "right"});
           })
           })
         }.observes('content'),
         }.observes('content'),
         warningsByHost: function () {
         warningsByHost: function () {
@@ -962,6 +979,22 @@ App.WizardStep3Controller = Em.Controller.extend({
             }
             }
           ]
           ]
         }.property('category', 'warningsByHost'),
         }.property('category', 'warningsByHost'),
+
+        showHostsPopup: function (hosts) {
+          $('.tooltip').hide();
+          App.ModalPopup.show({
+            header: Em.I18n.t('installer.step3.hostWarningsPopup.allHosts'),
+            bodyClass: Ember.View.extend({
+              hosts: hosts.context,
+              template: Ember.Handlebars.compile('<ul>{{#each host in view.hosts}}<li>{{host}}</li>{{/each}}</ul>')
+            }),
+            onPrimary: function () {
+              this.hide();
+            },
+            secondary: null
+          });
+        },
+
         onToggleBlock: function (category) {
         onToggleBlock: function (category) {
           this.$('#' + category.context.category).toggle('blind', 500);
           this.$('#' + category.context.category).toggle('blind', 500);
           category.context.isCollapsed = !category.context.isCollapsed;
           category.context.isCollapsed = !category.context.isCollapsed;

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

@@ -354,6 +354,8 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.action.running':'Running on',
   'installer.step3.hostWarningsPopup.action.running':'Running on',
   'installer.step3.hostWarningsPopup.host':'host',
   'installer.step3.hostWarningsPopup.host':'host',
   'installer.step3.hostWarningsPopup.hosts':'hosts',
   'installer.step3.hostWarningsPopup.hosts':'hosts',
+  'installer.step3.hostWarningsPopup.moreHosts':'{0} more hosts...<br>Click on link to view all hosts.',
+  'installer.step3.hostWarningsPopup.allHosts':'List of hosts',
   'installer.step3.hostWarningsPopup.rerunChecks':'Rerun Checks',
   'installer.step3.hostWarningsPopup.rerunChecks':'Rerun Checks',
   'installer.step3.hostWarningsPopup.hostHasWarnings':'Warning: Host checks failed on some of your hosts. It is highly recommended that you fix these problems first before proceeding to prevent potentially major problems with cluster installation. Are you sure you want to ignore these warnings and proceed?',
   'installer.step3.hostWarningsPopup.hostHasWarnings':'Warning: Host checks failed on some of your hosts. It is highly recommended that you fix these problems first before proceeding to prevent potentially major problems with cluster installation. Are you sure you want to ignore these warnings and proceed?',
   'installer.step3.warningsWindow.allHosts':'Warnings across all hosts',
   'installer.step3.warningsWindow.allHosts':'Warnings across all hosts',

+ 1 - 1
ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs

@@ -73,7 +73,7 @@
             <tr>
             <tr>
               <td>{{warning.name}}</td>
               <td>{{warning.name}}</td>
               <td>{{category.action}}
               <td>{{category.action}}
-                <a href="javascript:void(null);">
+                <a href="javascript:void(null);" rel='HostsListTooltip' {{bindAttr data-original-title="warning.hostsList"}} {{action showHostsPopup warning.hosts}}>
                   {{warning.hosts.length}}
                   {{warning.hosts.length}}
                   {{#if warning.onSingleHost}}
                   {{#if warning.onSingleHost}}
                   {{t installer.step3.hostWarningsPopup.host}}
                   {{t installer.step3.hostWarningsPopup.host}}