Browse Source

AMBARI-2584. Host Check UI text and UI cleanup. (Aleksandr Kovalenko via srimanth)

Srimanth Gunturi 12 years ago
parent
commit
e09b47c0b8

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

@@ -921,62 +921,57 @@ App.WizardStep3Controller = Em.Controller.extend({
         category: 'All Hosts',
         content: function () {
           var categoryWarnings = this.get('warningsByHost').findProperty('name', this.get('category')).warnings;
-          var processesIssues = categoryWarnings.filterProperty('category', 'processes');
-          var packagesIssues = categoryWarnings.filterProperty('category', 'packages');
-          var fileFoldersIssues = categoryWarnings.filterProperty('category', 'fileFolders');
-          var servicesIssues = categoryWarnings.filterProperty('category', 'services');
-          var usersIssues = categoryWarnings.filterProperty('category', 'users');
           return [
-            {
-              warnings: processesIssues,
-              title: Em.I18n.t('installer.step3.hostWarningsPopup.process') + ' ' + Em.I18n.t('installer.step3.hostWarningsPopup.issue' + (processesIssues.length !== 1 ? 's' : '')),
+            Ember.Object.create({
+              warnings: categoryWarnings.filterProperty('category', 'processes'),
+              title: Em.I18n.t('installer.step3.hostWarningsPopup.process'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.processes.message'),
               type: Em.I18n.t('common.process'),
               emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.processes'),
               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
               category: 'process',
-              isCollapsed: !processesIssues.length
-            },
-            {
-              warnings: packagesIssues,
-              title: Em.I18n.t('installer.step3.hostWarningsPopup.package') + ' ' + Em.I18n.t('installer.step3.hostWarningsPopup.issue' + (packagesIssues.length !== 1 ? 's' : '')),
+              isCollapsed: true
+            }),
+             Ember.Object.create({
+              warnings: categoryWarnings.filterProperty('category', 'packages'),
+              title: Em.I18n.t('installer.step3.hostWarningsPopup.package'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.packages.message'),
               type: Em.I18n.t('common.package'),
               emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.packages'),
               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.installed'),
               category: 'package',
-              isCollapsed: !packagesIssues.length
-            },
-            {
-              warnings: fileFoldersIssues,
-              title: Em.I18n.t('installer.step3.hostWarningsPopup.fileAndFolder') + ' ' + Em.I18n.t('installer.step3.hostWarningsPopup.issue' + (fileFoldersIssues.length !== 1 ? 's' : '')),
+              isCollapsed: true
+            }),
+             Ember.Object.create({
+              warnings: categoryWarnings.filterProperty('category', 'fileFolders'),
+              title: Em.I18n.t('installer.step3.hostWarningsPopup.fileAndFolder'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.fileFolders.message'),
               type: Em.I18n.t('common.path'),
               emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.filesAndFolders'),
               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
               category: 'fileFolders',
-              isCollapsed: !fileFoldersIssues.length
-            },
-            {
-              warnings: servicesIssues,
-              title: Em.I18n.t('installer.step3.hostWarningsPopup.service') + ' ' + Em.I18n.t('installer.step3.hostWarningsPopup.issue' + (servicesIssues.length !== 1 ? 's' : '')),
+              isCollapsed: true
+            }),
+             Ember.Object.create({
+              warnings: categoryWarnings.filterProperty('category', 'services'),
+              title: Em.I18n.t('installer.step3.hostWarningsPopup.service'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.services.message'),
               type: Em.I18n.t('common.service'),
               emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.services'),
               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.notRunning'),
               category: 'service',
-              isCollapsed: !servicesIssues.length
-            },
-            {
-              warnings: usersIssues,
-              title: Em.I18n.t('installer.step3.hostWarningsPopup.user') + ' ' + Em.I18n.t('installer.step3.hostWarningsPopup.issue' + (usersIssues.length !== 1 ? 's' : '')),
+              isCollapsed: true
+            }),
+             Ember.Object.create({
+              warnings: categoryWarnings.filterProperty('category', 'users'),
+              title: Em.I18n.t('installer.step3.hostWarningsPopup.user'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.users.message'),
               type: Em.I18n.t('common.user'),
               emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.users'),
               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
               category: 'user',
-              isCollapsed: !usersIssues.length
-            }
+              isCollapsed: true
+            })
           ]
         }.property('category', 'warningsByHost'),
 
@@ -997,13 +992,16 @@ App.WizardStep3Controller = Em.Controller.extend({
 
         onToggleBlock: function (category) {
           this.$('#' + category.context.category).toggle('blind', 500);
-          category.context.isCollapsed = !category.context.isCollapsed;
+          category.context.set('isCollapsed', !category.context.isCollapsed);
         },
-        warningsSummary: function () {
+        warningsNotice: function () {
           var warnings = this.get('warnings');
           var warningsByHost = self.get('warningsByHost').slice();
           warningsByHost.shift();
-          return Em.I18n.t('installer.step3.hostWarningsPopup.summary').format(warnings.length, warningsByHost.length - warningsByHost.filterProperty('warnings.length', 0).length);
+          var issues = warnings.length + ' ' + (warnings.length === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.issue') : Em.I18n.t('installer.step3.hostWarningsPopup.issues'));
+          var hostsNumber = warningsByHost.length - warningsByHost.filterProperty('warnings.length', 0).length;
+          var hosts = hostsNumber + ' ' + (hostsNumber === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.host') : Em.I18n.t('installer.step3.hostWarningsPopup.hosts'));
+          return Em.I18n.t('installer.step3.hostWarningsPopup.summary').format(issues, hosts);
         }.property('warnings', 'warningsByHost'),
         /**
          * generate detailed content to show it in new window

+ 8 - 7
ambari-web/app/messages.js

@@ -328,17 +328,18 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.report.service': '<br><br>######################################<br># Services<br>#<br># A space delimited list of services which should be up and running.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: services start ntpd httpd<br>######################################<br>SERVICES<br>',
   'installer.step3.hostWarningsPopup.report.user': '<br><br>######################################<br># Users<br>#<br># A space delimited list of users who should not exist.<br># Provided so that administrators can easily copy paths into scripts, email etc.<br># Example: userdel hdfs<br>######################################<br>USERS<br>',
   'installer.step3.hostWarningsPopup.report.folder': '\\ /folder',
-  'installer.step3.hostWarningsPopup.notice':'The following issues were detected on some hosts. Click the Rerun Checks button after manually resolve the issues. To resolve the warnings, run /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py on each host.',
-  'installer.step3.hostWarningsPopup.summary':'{0} issues on {1} hosts',
-  'installer.step3.hostWarningsPopup.process':'process',
+  'installer.step3.hostWarningsPopup.checks': 'Host Checks found',
+  'installer.step3.hostWarningsPopup.notice':'After manually resolving the issues, click <b>Rerun Checks</b>. To manually resolve issues on <b>each host</b> run the HostCleanup script:<br><code>python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py</code>',
+  'installer.step3.hostWarningsPopup.summary':'{0} on {1}',
+  'installer.step3.hostWarningsPopup.process':'Process Issues',
   'installer.step3.hostWarningsPopup.processes.message':'The following processes should not be running',
-  'installer.step3.hostWarningsPopup.fileAndFolder':'file and folder',
+  'installer.step3.hostWarningsPopup.fileAndFolder':'File and Folder Issues',
   'installer.step3.hostWarningsPopup.fileFolders.message':'The following files and folders should not exist',
-  'installer.step3.hostWarningsPopup.package':'package',
+  'installer.step3.hostWarningsPopup.package':'Package Issues',
   'installer.step3.hostWarningsPopup.packages.message':'The following packages should be uninstalled',
-  'installer.step3.hostWarningsPopup.user':'user',
+  'installer.step3.hostWarningsPopup.user':'User Issues',
   'installer.step3.hostWarningsPopup.users.message':'The following users should be removed',
-  'installer.step3.hostWarningsPopup.service':'service',
+  'installer.step3.hostWarningsPopup.service':'Service Issues',
   'installer.step3.hostWarningsPopup.services.message':'The following services should be up',
   'installer.step3.hostWarningsPopup.issue':'issue',
   'installer.step3.hostWarningsPopup.issues':'issues',

+ 3 - 5
ambari-web/app/styles/application.less

@@ -2579,13 +2579,10 @@ table.graphs {
   .notice {
     padding-bottom: 10px;
   }
-  .summary {
-    padding-left: 17px;
-  }
   .warnings-list {
     .block {
-      .title {
-        padding-left: 15px;
+      .accordion-heading {
+        background-color: #f0f0f0;
       }
       table {
         width: 100%;
@@ -2597,6 +2594,7 @@ table.graphs {
           font-weight: normal;
         }
       }
+    margin-top: 10px;
     }
   }
 }

+ 9 - 17
ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs

@@ -19,7 +19,7 @@
 
 <div id="host-warnings">
   <div class="notice">
-    <span>{{t installer.step3.hostWarningsPopup.notice}}</span>
+    <span>{{t installer.step3.hostWarningsPopup.checks}} <b>{{view.warningsNotice}}</b>. {{t installer.step3.hostWarningsPopup.notice}}</span>
   </div>
   <div class="row-fluid">
     <div class="span7">
@@ -34,26 +34,18 @@
               class="icon-external-link"></i> {{t installer.step3.hostWarningsPopup.report}}</a>
     </div>
   </div>
-  <div class="summary">
-    <span>
-      {{#if view.warnings.length}}
-        <i class="icon-warning-sign"></i>
-      {{else}}
-        <i class="icon-ok"></i>
-      {{/if}}
-      &nbsp;{{view.warningsSummary}}</span>
-  </div>
   <div class="accordion warnings-list" id="accordion2">
     {{#each category in view.content}}
     <div class="accordion-group block">
-      <div class="accordion-heading title">
+      <div class="accordion-heading">
+        <i {{bindAttr class=":pull-left :accordion-toggle category.isCollapsed:icon-caret-right:icon-caret-down"}}></i>
+        {{#if category.warnings.length}}
+        <i class="pull-right accordion-toggle icon-warning-sign"></i>
+        {{else}}
+        <i class="pull-right accordion-toggle icon-ok"></i>
+        {{/if}}
         <a class="accordion-toggle" {{action onToggleBlock category}}>
-          {{#if category.warnings.length}}
-          <i class="icon-warning-sign"></i>
-          {{else}}
-          <i class="icon-ok"></i>
-          {{/if}}
-          &nbsp;{{category.warnings.length}} {{category.title}}
+          {{category.title}} ({{category.warnings.length}})
         </a>
       </div>
       <div id="{{unbound category.category}}" class="accordion-body collapse in">