Browse Source

AMBARI-399. Cannot uninstall - the page hangs with the spinning icon (Contributed by Yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347178 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 năm trước cách đây
mục cha
commit
80c1dcf032

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-399. Cannot uninstall - the page hangs with the spinning icon (Yusaku via Vikram)
+
   AMBARI-398. if hbase is not installed, nagios sends alerts for "ganglia collector for hbasemaster" being down (Suhas via Vikram)
 
   AMBARI-397. Clean up descriptions and titles of mapreduce memory related configs (Vinod via Vikram)

+ 3 - 5
hmc/html/head.inc

@@ -37,6 +37,7 @@ if (sizeof($clusters) == 0) {
   $clusterState = 'NOT_CONFIGURED';
 } else {
   foreach ($clusters as $cluster) {
+    $clusterName = $cluster['clusterName'];
     $state = json_decode($cluster['state'], true);    
     $logger->log_trace('cluster state='.print_r($state,1));
     switch ($state['state']) {
@@ -53,19 +54,16 @@ if (sizeof($clusters) == 0) {
         break;
       case 'CONFIGURATION_IN_PROGRESS':
         if ($requestPage != 'reinstall.php' && $requestPage != 'initializeCluster.php') {
-          $targetPage = 'reinstall.php';
           eval(redirectToPage($requestPage, 'reinstall.php'));
           exit;
         }
         $clusterState = 'CONFIGURATION_IN_PROGRESS';
         break;      
       case 'DEPLOYMENT_IN_PROGRESS':
-        if ($requestPage != 'showDeployProgress.php') {
-          $targetPage = 'showDeployProgress.php?clusterName=' . $cluster['clusterName'];
-          $_GET['clusterName'] = $cluster['clusterName'];
+        if ($requestPage != 'showDeployProgress.php') {
           eval(redirectToPage($requestPage, 'showDeployProgress.php'));
           exit;
-        }          
+        }     
         $clusterState = 'DEPLOYMENT_IN_PROGRESS';
         break;
     } 

+ 1 - 1
hmc/html/installFailed.php

@@ -20,7 +20,7 @@
         <div class="alert alert-important" style="margin-top:40px;padding:20px">
           <h2 style="margin-bottom:10px"><?php echo $RES['installFailed.header'] ?></h2>
           <p><?php echo $RES['installFailed.body'] ?></p>
-          <a id="submitLinkId" class='btn btn-large' style='margin-top:20px' href='uninstallWizard.php'><?php echo $RES['installFailed.submit.label'] ?></a>
+          <a id="submitLinkId" class="btn btn-large" style="margin-top:20px" href="uninstallWizard.php?clusterName=<?php echo $clusterName ?>"><?php echo $RES['installFailed.submit.label'] ?></a>          
         </div>
       </div>
     </div>

+ 1 - 1
hmc/html/showDeployProgress.php

@@ -29,7 +29,7 @@
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
       /* Minimal data required to bootstrap clusters.js. */
-      var clusterName = '<?php echo $_GET['clusterName']; ?>';
+      var clusterName = '<?php echo $clusterName; ?>';
 
       var jsFilesToLoad = [ 
         '../js/utils.js',

+ 7 - 17
hmc/html/topnav.htmli

@@ -1,29 +1,19 @@
 <!-- START TOPNAV -->
-    <?php 
-		if (basename($_SERVER['REQUEST_URI']) == 'initializeCluster.php') {
-			$logoUrl = '/hmc/html';
-		}
+ <?php 
+    $homeUrl = '/hmc/html';
 	?>
 	<div class="navbar">
 		<div class="navbar-inner">
 			<div class="container">
-				<a href="<?php echo $logoUrl ?>"><img id="logo" src="../images/logo-small.gif"></a>
-				<a class="brand" href="<?php echo $logoUrl ?>"><?php echo $RES['app.name'] ?></a>
-				<?php if ($clusterState == 'OPERATIONAL') { ?> 
+				<a href="<?php echo $homeUrl ?>"><img id="logo" src="../images/logo-small.gif"></a>
+				<a class="brand" href="<?php echo $homeUrl ?>"><?php echo $RES['app.name'] ?></a>
+				<?php if (isset($clusterState) && $clusterState == 'OPERATIONAL') { ?> 
 				<ul class="nav">
-					<li class="active"><a href="/hmc/html">Cluster Management</a>
+					<li class="active"><a href="<?php echo $homeUrl ?>">Cluster Management</a>
 					</li>
 					<li><a href="/hdp/dashboard/ui/home.html">Monitoring</a></li>
+        </ul>					
 				<?php } ?>
-				<?php /*
-					<li>
-						<form class="navbar-search pull-left">
-							<input style="margin-left: 20px" type="text" class="search-query"
-								placeholder="Search">
-						</form>
-					</li>
-				*/ ?>
-				</ul>
 			</div>
 		</div>
 	</div>

+ 10 - 11
hmc/js/uninstallProgress.js

@@ -69,28 +69,27 @@ function renderUninstallProgress (uninstallProgressInfo) {
       && uninstallProgressInfo.nagiosGangliaCoHosted) {
     hmcRestartMsg = '<strong>Note:</strong> We detected that you need to restart HMC as'
         + ' Nagios/Ganglia are co-hosted on this server. <br/>Please restart'
-        + ' HMC using \"service hmc restart\" and then head ';
+        + ' HMC using \"service hmc restart\". ';
   } else {
-    hmcRestartMsg = 'May we be so bold as to suggest heading ';
+    hmcRestartMsg = '';
   }
 
-  hmcRestartMsg += 'on over to the ' +
+  hmcRestartMsg += '' +
       '<a href="javascript:void(null)" id=clustersListLinkId>' +
-        'Cluster information' +
-      '</a>' +
-      ' page?';
+        'Continue' +
+      '</a>';
 
   var uninstallProgressStatusMessage = {
 
     success:
       '<p style=\"text-align:center\">' +
-        'All done with the uninstall! <br/>' + hmcRestartMsg +
+        'Uninstalled the cluster successfully.<br/>' + hmcRestartMsg +
       '</p>',
     failure:
       '<p>' +
-        'We made a boo-boo! Take a look at the ' +
+        'There was a problem with uninstall.  Take a look at ' +
           '<a href="javascript:void(null)" id=showUninstallTxnLogsLinkId>Uninstall Logs</a>' +
-        '?' +
+        ' to see what might have happened.' +
       '</p>'
   };
 
@@ -157,7 +156,7 @@ function renderUninstallProgress (uninstallProgressInfo) {
        * the contents inside errorInfoPanel (and make it visible). 
        */
       globalYui.one("#showUninstallTxnLogsLinkId").on( "click", function(e) {
-
+        errorInfoPanel.set( 'centered', true);
         errorInfoPanel.set( 'bodyContent', errorInfoPanelBodyContent );
         errorInfoPanel.show();
 
@@ -169,7 +168,7 @@ function renderUninstallProgress (uninstallProgressInfo) {
             '</a>' );
 
           globalYui.one("#clustersListLinkId").on( "click", function(e) {
-            window.open( generateClustersListUrl(txnProgressWidget.txnProgressContext.clusterName) );
+            document.location.href = generateClustersListUrl(txnProgressWidget.txnProgressContext.clusterName);
           });
 
           firstTimeShowingErrorInfoPanel = false;