Bladeren bron

AMBARI-293: Invoking browser back action on any step after the Add Hosts step in the Cluster Init Wizard launches the host discovery process again by Yusaku sako

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1342945 13f79535-47bb-0310-9956-ffa450edef68
Suhas 13 jaren geleden
bovenliggende
commit
cba6a3e2f6
2 gewijzigde bestanden met toevoegingen van 12 en 0 verwijderingen
  1. 4 0
      CHANGES.txt
  2. 8 0
      hmc/js/addNodes.js

+ 4 - 0
CHANGES.txt

@@ -6,6 +6,10 @@ characters wide.
 
 Release 0.1.x - unreleased
   
+  AMBARI-293. Invoking browser "back" action on any step after the Add 
+              Hosts step in the Cluster Init Wizard launches the host 
+              discovery process again (Yusaku Sako via vgogate)
+
   AMBARI-289. Hive dependency on hcat (jitendra via vgogate)
 
   AMBARI-288. Add description for Nagios config (vgogate)

+ 8 - 0
hmc/js/addNodes.js

@@ -156,6 +156,7 @@ globalYui.one('#addNodesSubmitButtonId').on('click',function (e) {
   addNodesFilesForm.set('target', 'fileUploadTarget');
 
   /* And then programmatically submit the first of the 2 forms. */
+  doPostUpload = true;
   addNodesFilesForm.submit();
   globalYui.log("Files submitted to server.");
 
@@ -163,11 +164,17 @@ globalYui.one('#addNodesSubmitButtonId').on('click',function (e) {
 });
 
 var setupNodesJson = "";
+var doPostUpload = false; // this flag is to prevent the #fileUploadTargetId iframe onload event from being invoked on browser back action
 
 globalYui.one("#fileUploadTargetId").on('load', function (e) {
 
+    if (!doPostUpload) {
+  	  return;
+    }
     globalYui.log("File upload finished");
 
+    doPostUpload = false;
+    
     var repoFile = '';
     var artifactsUrl = '';
     var gplArtifactsUrl = '';
@@ -196,6 +203,7 @@ globalYui.one("#fileUploadTargetId").on('load', function (e) {
       timeout : 10000,
       on: {
         success: function (x,o) {
+          	
           globalYui.log("RAW JSON DATA: " + o.responseText);
           // Process the JSON data returned from the server
           try {