Ver Fonte

AMBARI-6228. host checks 'Show Report' link is missing from dialog.(xiwang)

Xi Wang há 11 anos atrás
pai
commit
1e906dd0e4

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

@@ -453,6 +453,10 @@ Em.I18n.translations = {
   '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.jdk': '<br><br>######################################<br># JDK Check <br>#<br># A newline delimited list of JDK issues.<br>######################################<br>JDK ISSUES<br>',
+  'installer.step3.hostWarningsPopup.report.disk': '<br><br>######################################<br># Disk <br>#<br># A newline delimited list of disk issues.<br>######################################<br>DISK ISSUES<br>',
+  'installer.step3.hostWarningsPopup.report.repositories': '<br><br>######################################<br># Repositories <br>#<br># A newline delimited list of repositories issues.<br>######################################<br>REPOSITORIES ISSUES<br>',
+  'installer.step3.hostWarningsPopup.report.hostNameResolution': '<br><br>######################################<br># Hostname Resolution<br>#<br># A space delimited list of host names on which hostname resolution failed.<br>######################################<br>HOSTNAME RESOLUTION ISSUES<br>',
   'installer.step3.hostWarningsPopup.report.firewall': '<br><br>######################################<br># Firewall<br>#<br># A newline delimited list of firewall issues.<br>######################################<br>FIREWALL<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<br>######################################<br>FILES AND FOLDERS<br>',
   'installer.step3.hostWarningsPopup.report.reverseLookup': '<br><br>######################################<br># Reverse Lookup<br># <br># The hostname was not found in the reverse DNS lookup. This may result in incorrect behavior. <br># Please check the DNS setup and fix the issue.<br>######################################<br>REVERSE LOOKUP<br>',

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

@@ -25,7 +25,7 @@
     <div class="span7">
       {{t common.hosts}}&nbsp;{{view view.hostSelectView}}
     </div>
-    {{#if view.categoryWarnings.length}}
+    {{#if view.totalWarningsCount}}
       <div class="span3 offset2">
         <a href="javascript:void(null)" title="Show Details" {{action openWarningsInDialog target="view"}}
            class="task-detail-open-dialog"><i

+ 21 - 5
ambari-web/app/views/wizard/step3/hostWarningPopupBody_view.js

@@ -134,7 +134,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
   categoryWarnings: function () {
     var warningsByHost = this.get('warningsByHost');
     if (Em.isNone(warningsByHost)) return [];
-    return warningsByHost.findProperty('name', this.get('category')).warnings
+    return warningsByHost.findProperty('name', this.get('category')).warnings;
   }.property('warningsByHost', 'category'),
 
   /**
@@ -286,6 +286,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
   warningsNotice: function () {
     var issuesNumber = this.get('warnings.length') + this.get('bodyController.repoCategoryWarnings.length') + this.get('bodyController.diskCategoryWarnings.length')
       + this.get('bodyController.jdkCategoryWarnings.length') + this.get('bodyController.hostCheckWarnings.length');
+    this.set('totalWarningsCount', issuesNumber);
     var issues = issuesNumber + ' ' + (issuesNumber.length === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.issue') : Em.I18n.t('installer.step3.hostWarningsPopup.issues'));
     var hostsCnt = this.warningHostsNamesCount();
     var hosts = hostsCnt + ' ' + (hostsCnt === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.host') : Em.I18n.t('installer.step3.hostWarningsPopup.hosts'));
@@ -298,12 +299,26 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
    */
   contentInDetails: function () {
     var content = this.get('content');
-    var warningsByHost = this.get('warningsByHost').slice();
-    warningsByHost.shift();
     var newContent = '';
     newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.header') + new Date;
     newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hosts');
-    newContent += warningsByHost.filterProperty('warnings.length').mapProperty('name').join(' ');
+    newContent += this.get('hostNamesWithWarnings').join(' ');
+    if (content.findProperty('category', 'jdk').warnings.length) {
+      newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.jdk');
+      newContent += content.findProperty('category', 'jdk').warnings[0].hosts.join('<br>');
+    }
+    if (content.findProperty('category', 'disk').warnings.length) {
+      newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.disk');
+      newContent += content.findProperty('category', 'disk').warnings[0].hosts.join('<br>');
+    }
+    if (content.findProperty('category', 'repositories').warnings.length) {
+      newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.repositories');
+      newContent += content.findProperty('category', 'repositories').warnings[0].hosts.join('<br>');
+    }
+    if (content.findProperty('category', 'hostNameResolution').warnings.length) {
+      newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hostNameResolution');
+      newContent += content.findProperty('category', 'hostNameResolution').warnings[0].hosts.join(' ');
+    }
     if (content.findProperty('category', 'firewall').warnings.length) {
       newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.firewall');
       newContent += content.findProperty('category', 'firewall').warnings.mapProperty('name').join('<br>');
@@ -341,7 +356,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
     }
     newContent += '</p>';
     return newContent;
-  }.property('content', 'warningsByHost'),
+  }.property('content', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings'),
 
   didInsertElement: function () {
     Em.run.next(this, function () {
@@ -426,6 +441,7 @@ App.WizardStep3HostWarningPopupBody = Em.View.extend({
         }
       });
     }
+    this.set('hostNamesWithWarnings', Em.keys(hostNameMap));
     return Em.keys(hostNameMap).length;
   },