You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/07/05 18:31:55 UTC

svn commit: r1500061 - in /incubator/ambari/trunk/ambari-web/app: controllers/wizard/step3_controller.js messages.js templates/wizard/step3_host_warnings_popup.hbs

Author: srimanth
Date: Fri Jul  5 16:31:55 2013
New Revision: 1500061

URL: http://svn.apache.org/r1500061
Log:
AMBARI-2573. Host Check UI: Show hover on what hosts an issue is for. (Aleksandr Kovalenko via srimanth)

Modified:
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js?rev=1500061&r1=1500060&r2=1500061&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js Fri Jul  5 16:31:55 2013
@@ -678,6 +678,15 @@ App.WizardStep3Controller = Em.Controlle
     var warnings = [];
     var warning;
     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) {
       var host = {
         name: _host.Hosts.host_name,
@@ -806,6 +815,13 @@ App.WizardStep3Controller = Em.Controlle
       }
       hosts.push(host);
     }, 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({
       name: 'All Hosts',
       warnings: warnings
@@ -890,6 +906,7 @@ App.WizardStep3Controller = Em.Controlle
             $(this.get('content').filterProperty('isCollapsed').map(function (cat) {
               return '#' + cat.category
             }).join(',')).hide();
+            this.$("[rel='HostsListTooltip']").tooltip({html: true, placement: "right"});
           })
         }.observes('content'),
         warningsByHost: function () {
@@ -962,6 +979,22 @@ App.WizardStep3Controller = Em.Controlle
             }
           ]
         }.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) {
           this.$('#' + category.context.category).toggle('blind', 500);
           category.context.isCollapsed = !category.context.isCollapsed;

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1500061&r1=1500060&r2=1500061&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Fri Jul  5 16:31:55 2013
@@ -354,6 +354,8 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.action.running':'Running on',
   'installer.step3.hostWarningsPopup.host':'host',
   '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.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',

Modified: incubator/ambari/trunk/ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs?rev=1500061&r1=1500060&r2=1500061&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs Fri Jul  5 16:31:55 2013
@@ -73,7 +73,7 @@
             <tr>
               <td>{{warning.name}}</td>
               <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}}
                   {{#if warning.onSingleHost}}
                   {{t installer.step3.hostWarningsPopup.host}}