Selaa lähdekoodia

AMBARI-383. Do not force the user to look at the error logs before given choices to go back/continue, etc (Contributed by Yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347146 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 vuotta sitten
vanhempi
commit
fc290a2858
3 muutettua tiedostoa jossa 43 lisäystä ja 48 poistoa
  1. 2 0
      CHANGES.txt
  2. 31 33
      hmc/js/addNodesProgress.js
  3. 10 15
      hmc/js/deployProgress.js

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-383. Do not force the user to look at the error logs before given choices to go back/continue, etc (Yusaku via Vikram)
+
   AMBARI-382. Make sure install/uninstall/reinstall preserves data on HDFS/ZK/others. (Ramya via Vikram)
 
   AMBARI-377. Uninstall does not handle component dependencies. (Jitendra via Vikram)

+ 31 - 33
hmc/js/addNodesProgress.js

@@ -213,6 +213,37 @@ function renderProgress (discoverProgressInfo) {
             '</a>' 
           '</p>';
           installationStatusDivCssClass = 'statusError';
+          var linkInfo = '<a href="javascript:void(null)"' +
+          'id="errorBackNavLinkId">Back to Add Nodes</a>';
+          if (totalFailure == false) {
+            linkInfo += ' <a href=' + 
+            '"javascript:void(null)" id="errorFwdNavLinkId" style="margin-left:20px">Ignore and Continue</a>';
+          }
+  
+          globalYui.one("#txnProgressStatusActionsDivId").setContent(linkInfo);
+
+          // now can add the on-click feature for the links
+          globalYui.one("#errorBackNavLinkId").on( "click", function(e) {
+            cleanUpTxnProgress();
+            errorInfoPanel.destroy();
+            // give cleanup option
+            // cleanupInstall();
+            globalYui.one("#txnProgressStatusActionsDivId").setContent("");
+            globalYui.one('#txnProgressCoreDivId').setStyle('display', 'none');
+            globalYui.one("#addNodesCoreDivId").setStyle('display', 'block');
+           });
+
+          if (totalFailure == false) {
+            globalYui.one("#errorFwdNavLinkId").on( "click", function(e) {
+              cleanUpTxnProgress();
+              errorInfoPanel.destroy();
+              //REZYYY globalYui.one("#progressErrorInfoNavigateDivId").setContent("");
+              globalYui.one("#txnProgressStatusActionsDivId").setContent("");
+              transitionToNextStage( "#txnProgressCoreDivId", discoverProgressInfo, 
+                "#selectServicesCoreDivId", discoverProgressInfo, renderSelectServicesBlock);
+            });
+          }
+
         } else {
           installationStatusDivContent =             
           '<p>' +
@@ -271,39 +302,6 @@ function renderProgress (discoverProgressInfo) {
                 //errorInfoPanel.set( 'bodyContent', '<pre>' + 
                 //  globalYui.JSON.stringify( e.response.meta.stateInfo, null, 4) + '</pre>' );
                 errorInfoPanel.show();
-                var linkInfo = '<a href="javascript:void(null)"' +
-                  'id="errorBackNavLinkId">Back to Add Nodes</a>';
-                if (totalFailure == false) {
-                  linkInfo += ' <a href=' + 
-                  '"javascript:void(null)" id="errorFwdNavLinkId" style="margin-left:20px">Ignore and Continue</a>';
-                }
-
-                  //REZYYY globalYui.one("#progressErrorInfoNavigateDivId").setContent(linkInfo);
-                  globalYui.one("#txnProgressStatusActionsDivId").setContent(linkInfo);
-
-                  // now can add the on-click feature for the links
-                  globalYui.one("#errorBackNavLinkId").on( "click", function(e) {
-                    cleanUpTxnProgress();
-                    errorInfoPanel.destroy();
-                    // give cleanup option
-                    // cleanupInstall();
-                    //REZYYY globalYui.one("#progressErrorInfoNavigateDivId").setContent("");
-                    globalYui.one("#txnProgressStatusActionsDivId").setContent("");
-                    globalYui.one('#txnProgressCoreDivId').setStyle('display', 'none');
-                    globalYui.one("#addNodesCoreDivId").setStyle('display', 'block');
-                   });
-
-                  if (totalFailure == false) {
-                    globalYui.one("#errorFwdNavLinkId").on( "click", function(e) {
-                      cleanUpTxnProgress();
-                      errorInfoPanel.destroy();
-                      //REZYYY globalYui.one("#progressErrorInfoNavigateDivId").setContent("");
-                      globalYui.one("#txnProgressStatusActionsDivId").setContent("");
-                      transitionToNextStage( "#txnProgressCoreDivId", discoverProgressInfo, 
-                        "#selectServicesCoreDivId", discoverProgressInfo, renderSelectServicesBlock);
-                    });
-                  }
-
                 //REZYYY globalYui.one("#progressErrorInfoNavigateDivId").setStyle( 'display', 'block' );
             });
           } else {

+ 10 - 15
hmc/js/deployProgress.js

@@ -117,6 +117,15 @@ function renderDeployProgress (deployProgressInfo) {
     },
 
     failure: function( txnProgressWidget ) {
+      globalYui.one('#txnProgressStatusActionsDivId').setContent(  
+          '<a href="javascript:void(null)" id=restartInstallationWizardLinkId>' + 
+            'Reinstall Cluster' +
+          '</a>'
+      );          
+      globalYui.one("#restartInstallationWizardLinkId").on( "click", function(e) {
+        document.location.href = 'reinstall.php';
+      });
+      globalYui.one('#txnProgressStatusActionsDivId').setStyle('display','block');
 
       /* Create the panel that'll display our error info. */
       var errorInfoPanel = 
@@ -164,8 +173,6 @@ function renderDeployProgress (deployProgressInfo) {
         }
       });
 
-      var firstTimeShowingErrorInfoPanel = true;
-
       /* Register a click-handler for #showDeployTxnLogsLinkId to render 
        * the contents inside errorInfoPanel (and make it visible). 
        */
@@ -174,24 +181,12 @@ function renderDeployProgress (deployProgressInfo) {
         errorInfoPanel.set( 'bodyContent', errorInfoPanelBodyContent );
         errorInfoPanel.show();
 
-        if( firstTimeShowingErrorInfoPanel ) {
-          globalYui.one('#txnProgressStatusActionsDivId').setContent(  
-              '<a href="javascript:void(null)" id=restartInstallationWizardLinkId>' + 
-                'Reinstall Cluster' +
-              '</a>'
-          );          
-          globalYui.one("#restartInstallationWizardLinkId").on( "click", function(e) {
-            document.location.href = 'reinstall.php';
-          });
-          
-          firstTimeShowingErrorInfoPanel = false;
-        }
       });
     }
   };
 
   var deployProgressWidget = new TxnProgressWidget
     ( deployProgressInfo, deployProgressStatusMessage, deployProgressPostCompletionFixup );
-
+  
   deployProgressWidget.show();
 }