incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject svn commit: r1499030 - in /incubator/ambari/trunk/ambari-web/app: controllers/wizard/step3_controller.js messages.js templates/wizard/step3_host_warnings_popup.hbs
Date Tue, 02 Jul 2013 17:32:08 GMT
Author: srimanth
Date: Tue Jul  2 17:32:07 2013
New Revision: 1499030

URL: http://svn.apache.org/r1499030
Log:
AMBARI-2540. Host Check UI: Show details action should provide appropriate content. (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=1499030&r1=1499029&r2=1499030&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 Tue Jul 
2 17:32:07 2013
@@ -915,31 +915,36 @@ App.WizardStep3Controller = Em.Controlle
               warnings: categoryWarnings.filterProperty('category', 'processes'),
               title: Em.I18n.t('installer.step3.hostWarningsPopup.processes'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.processes.message'),
-              type: Em.I18n.t('common.process')
+              type: Em.I18n.t('common.process'),
+              category: 'process'
             },
             {
               warnings: categoryWarnings.filterProperty('category', 'packages'),
               title: Em.I18n.t('installer.step3.hostWarningsPopup.packages'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.packages.message'),
-              type: Em.I18n.t('common.package')
+              type: Em.I18n.t('common.package'),
+              category: 'package'
             },
             {
               warnings: categoryWarnings.filterProperty('category', 'fileFolders'),
               title: Em.I18n.t('installer.step3.hostWarningsPopup.fileFolders'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.fileFolders.message'),
-              type: Em.I18n.t('common.path')
+              type: Em.I18n.t('common.path'),
+              category: 'fileFolders'
             },
             {
               warnings: categoryWarnings.filterProperty('category', 'services'),
               title: Em.I18n.t('installer.step3.hostWarningsPopup.services'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.services.message'),
-              type: Em.I18n.t('common.service')
+              type: Em.I18n.t('common.service'),
+              category: 'service'
             },
             {
               warnings: categoryWarnings.filterProperty('category', 'users'),
               title: Em.I18n.t('installer.step3.hostWarningsPopup.users'),
               message: Em.I18n.t('installer.step3.hostWarningsPopup.users.message'),
-              type: Em.I18n.t('common.user')
+              type: Em.I18n.t('common.user'),
+              category: 'user'
             }
           ]
         }.property('category', 'warningsByHost'),
@@ -952,38 +957,44 @@ App.WizardStep3Controller = Em.Controlle
         /**
          * generate detailed content to show it in new window
          */
-        contentInDetails: function(){
+        contentInDetails: function () {
           var content = this.get('content');
+          var warningsByHost = this.get('warningsByHost').slice();
+          warningsByHost.shift();
           var newContent = '';
-          if(content.hostName == 'All Hosts'){
-            newContent += '<h4>'+Em.I18n.t('installer.step3.warningsWindow.allHosts')+'</h4>';
-          } else {
-            newContent += '<h4>' + Em.I18n.t('installer.step3.warningsWindow.warningsOn')
+ content.hostName + '</h4>';
+          newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.header') + new
Date;
+          newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hosts');
+          newContent += warningsByHost.mapProperty('name').join(' ');
+          if (content.findProperty('category', 'fileFolders').warnings.length) {
+            newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.fileFolders');
+            newContent += content.findProperty('category', 'fileFolders').warnings.mapProperty('name').join('
') +  Em.I18n.t('installer.step3.hostWarningsPopup.report.folder');
+          }
+          if (content.findProperty('category', 'process').warnings.length) {
+            newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.process');
+            content.findProperty('category', 'process').warnings.forEach(function (process,
i) {
+              process.hosts.forEach(function (host, j) {
+                if (!!i || !!j) {
+                  newContent += ',';
+                }
+                newContent += '(' + host + ',' + process.user + ',' + process.pid + ')';
+              });
+            });
           }
-          newContent += '<div>' + Em.I18n.t('installer.step3.warningsWindow.directoriesAndFiles')
+ '</div><div>';
-          content.directoriesFiles.filterProperty('isWarn', true).forEach(function(path){
-              newContent += path.name + '&nbsp;'
-          });
-          if(content.directoriesFiles.filterProperty('isWarn', true).length == 0){
-            newContent += Em.I18n.t('installer.step3.warningsWindow.noWarnings');
+          if (content.findProperty('category', 'package').warnings.length) {
+            newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.package');
+            newContent += content.findProperty('category', 'package').warnings.mapProperty('name').join('
');
           }
-          newContent += '</div><br/><div>PACKAGES</div><div>';
-          content.packages.filterProperty('isWarn', true).forEach(function(_package){
-              newContent += _package.name + '&nbsp;'
-          });
-          if(content.packages.filterProperty('isWarn', true).length == 0){
-            newContent += Em.I18n.t('installer.step3.warningsWindow.noWarnings');
+          if (content.findProperty('category', 'service').warnings.length) {
+            newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.service');
+            newContent += content.findProperty('category', 'service').warnings.mapProperty('name').join('
');
           }
-          newContent += '</div><br/><div>PROCESSES</div><div>';
-          content.processes.filterProperty('isWarn', true).forEach(function(process, index){
-              newContent += '(' + content.hostName + ',' + process.pid + ',' + process.user
+ ')';
-              newContent += (index != (content.processes.filterProperty('isWarn', true).length-1))
? ',' : '';
-          })
-          if(content.processes.filterProperty('isWarn', true).length == 0){
-            newContent += Em.I18n.t('installer.step3.warningsWindow.noWarnings');
+          if (content.findProperty('category', 'user').warnings.length) {
+            newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.user');
+            newContent += content.findProperty('category', 'user').warnings.mapProperty('name').join('
');
           }
+          newContent += '</p>';
           return newContent;
-        }.property('content'),
+        }.property('content', 'warningsByHost'),
         /**
          * open new browser tab with detailed content
          */

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1499030&r1=1499029&r2=1499030&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Tue Jul  2 17:32:07 2013
@@ -309,7 +309,15 @@ Em.I18n.translations = {
   'installer.step3.hosts.remove.popup.body':'Are you sure you want to remove the selected
host(s)?',
   'installer.step3.hostInformation.popup.header':'Error in retrieving host Information',
   'installer.step3.hostInformation.popup.body' : 'All bootstrapped hosts registered but unable
to retrieve cpu and memory related information',
-  'installer.step3.hostWarningsPopup.details':'Show Details',
+  'installer.step3.hostWarningsPopup.report':'Show Report',
+  'installer.step3.hostWarningsPopup.report.header': '<p style="font-family: monospace">######################################<br>#
Host Checks Report<br>#<br># Generated: ',
+  'installer.step3.hostWarningsPopup.report.hosts': '<br>######################################<br><br>######################################<br>#
Hosts<br>#<br># A space delimited list of hosts which have issues.<br>#
Provided so that administrators can easily copy hostnames into scripts, email etc.<br>######################################<br>HOSTS<br>',
+  'installer.step3.hostWarningsPopup.report.fileFolders': '<br><br>######################################<br>#
Files and Folders<br>#<br># A space delimited list of files and folders which
should not exist.<br># Provided so that administrators can easily copy paths into scripts,
email etc.<br># Example: rm -r /etc/hadoop /etc/hbase /etc/some\\ /folder<br>######################################<br>FILES
AND FOLDERS<br>',
+  'installer.step3.hostWarningsPopup.report.process': '<br><br>######################################<br>#
Processes<br>#<br># A comma separated list of process tuples which should not
be running.<br># Provided so that administrators can easily copy paths into scripts,
email etc.<br>######################################<br>PROCESSES<br>',
+  'installer.step3.hostWarningsPopup.report.package': '<br><br>######################################<br>#
Packages<br>#<br># A space delimited list of software packages which should be
uninstalled.<br># Provided so that administrators can easily copy paths into scripts,
email etc.<br># Example: yum remove hadoop-hdfs nagios<br>######################################<br>PACKAGES<br>',
+  '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.processes':'process issues',

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=1499030&r1=1499029&r2=1499030&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 Tue
Jul  2 17:32:07 2013
@@ -31,7 +31,7 @@
     <div class="span3 offset2">
       <a href="javascript.void(0)" title="Show Details" {{action openWarningsInDialog
target="view"}}
          class="task-detail-open-dialog"><i
-              class="icon-external-link"></i> {{t installer.step3.hostWarningsPopup.details}}</a>
+              class="icon-external-link"></i> {{t installer.step3.hostWarningsPopup.report}}</a>
     </div>
   </div>
   <div class="summary">



Mime
View raw message