Explorar o código

AMBARI-605. Add UI flow/groundwork for handling Ambari / Hadoop stack version upgrades (Contributed by yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1358041 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako %!s(int64=13) %!d(string=hai) anos
pai
achega
17e010dc01
Modificáronse 45 ficheiros con 1228 adicións e 862 borrados
  1. 3 0
      CHANGES.txt
  2. 3 0
      NOTICE.txt
  3. 50 254
      hmc/css/app.css
  4. 4 4
      hmc/html/_bootstrapJs.php
  5. 0 0
      hmc/html/_footer.php
  6. 4 4
      hmc/html/_head.php
  7. 71 51
      hmc/html/_router.php
  8. 0 0
      hmc/html/_subnav.php
  9. 4 4
      hmc/html/_topnav.php
  10. 0 0
      hmc/html/_txnUtils.php
  11. 1 1
      hmc/html/_utils.php
  12. 10 10
      hmc/html/addNodesWizard.php
  13. 10 15
      hmc/html/index.php
  14. 9 9
      hmc/html/initializeCluster.php
  15. 5 5
      hmc/html/installFailed.php
  16. 10 60
      hmc/html/manageServices.php
  17. 8 8
      hmc/html/showDeployAddedNodesProgress.php
  18. 8 8
      hmc/html/showDeployProgress.php
  19. 8 8
      hmc/html/showManageServicesProgress.php
  20. 8 8
      hmc/html/showUninstallProgress.php
  21. 5 5
      hmc/html/uninstallFailed.php
  22. 11 15
      hmc/html/uninstallWizard.php
  23. 61 0
      hmc/html/upgradeStack/_stageMenu.php
  24. 77 0
      hmc/html/upgradeStack/deploy.php
  25. 19 16
      hmc/html/upgradeStack/index.php
  26. 88 0
      hmc/html/upgradeStack/reconfigure.php
  27. 68 0
      hmc/html/upgradeStack/uninstall.php
  28. 0 26
      hmc/html/welcome.inc
  29. 5 5
      hmc/html/welcome.php
  30. 1 1
      hmc/js/assignMasters.js
  31. 25 34
      hmc/js/clustersList.js
  32. 10 12
      hmc/js/configureServices.js
  33. 361 281
      hmc/js/configureServicesUtils.js
  34. 3 3
      hmc/js/deployProgress.js
  35. 33 0
      hmc/js/ext/sinon.min.js
  36. 3 3
      hmc/js/manageServices.js
  37. 1 0
      hmc/js/txnUtils.js
  38. 68 0
      hmc/js/upgradeStack/deploy.js
  39. 74 0
      hmc/js/upgradeStack/reconfigure.js
  40. 68 0
      hmc/js/upgradeStack/uninstall.js
  41. 9 10
      hmc/js/utils.js
  42. 1 0
      hmc/php/conf/Config.inc
  43. 13 0
      hmc/php/conf/MessageResources-en.inc
  44. 7 1
      hmc/php/frontend/configUtils.php
  45. 1 1
      hmc/php/util/selectNodes.php

+ 3 - 0
CHANGES.txt

@@ -6,6 +6,9 @@ characters wide.
 
 Release 1.0.0 - unreleased
 
+  AMBARI-605. Add UI flow/groundwork for handling Ambari / Hadoop stack version
+  upgrades (yusaku) 
+
   AMBARI-600. Fix lzo installs to work correctly on RHEL6 (hitesh)
 
   AMBARI-598. Set state to UNKNOWN and not 0 to avoid issues when using === matches

+ 3 - 0
NOTICE.txt

@@ -17,3 +17,6 @@ Copyright (c) 2007-2012 jQuery Grid Plugin - jqGrid
 
 This product includes raphael (http://raphaeljs.com/)
 Copyright (c) 2008 Dmitry Baranovskiy
+
+This product includes Sinon.JS (http://sinonjs.org - BSD license)
+Copyright (c) 2010 - 2012, Christian Johansen.

+ 50 - 254
hmc/css/app.css

@@ -23,13 +23,6 @@ header, footer, aside, nav, article, section {
   display: block;
 }
 
-header {
-	margin:10px 0;
-  height:100px;
-  background-color:white;
-  font-size:300%;
-}
-
 body { 
   font:13px/1.231 Helvetica,Arial,sans-serif;
   *font-size:small; 
@@ -47,26 +40,16 @@ h1 {
   text-align: center; 
 }
 
-header img {
-        height:93px;
-        width:241px;
-	float:left;
-}
-#headerText {
-        font-weight:bold;
-        padding:30px 0 0 400px;
-}
-
 footer {
 	border-top:1px solid #e5e5e5;
 	padding:40px 0;
 	background-color:#fff;
-    color:#666666;
+  color:#666666;
 }
 
 footer a:link, footer a:visited {
-    color:#666666;
-    text-decoration:underline;
+  color:#666666;
+  text-decoration:underline;
 }
 
 a:link {
@@ -151,13 +134,6 @@ table {
   border:1px solid #DBDBDB;
 }
 
-caption {
-  font-weight:bold;
-  font-size:1.3em;
-  padding:10px;
-  color:green;
-}
-
 thead {
   font-size:13px;
   font-weight:bold;
@@ -229,7 +205,7 @@ td {
   margin:0 auto;
 }
 
-#ContentDivId {
+#content {
   width:980px;
   margin:0 auto;
   padding:0;
@@ -301,7 +277,11 @@ label.unit {
 }
 
 a.btn {
-	color:#333;
+	color: #333;
+}
+
+a.btn-success {
+  color: #fff;
 }
 
 .btn-large .iconic-stop:before {
@@ -422,13 +402,14 @@ div.separator {
 #serviceLegend {
   float:right;
 }
-#clusterHostRoleMappingDivId {
-  margin-top:20px;
-  width:500px;
-  margin-left:20px;
+#clusterHostRoleMapping {
+  margin-top: 20px;
+  width: 500px;
+  margin-left: 20px;
+  float: left;
 }
 
-#clusterHostRoleMappingDivId h2 {
+#clusterHostRoleMapping h2 {
   font-size:16px;
   float:left;
   margin-bottom:10px;
@@ -661,38 +642,6 @@ legend {
   text-align:left;
 }
 
-.submitButton:hover {
-  background-color:#00CC00;
-  cursor:pointer;
-  border:1px solid green;
-  color:white;
-}
-
-.submitButton {
-  -moz-box-shadow:inset 0px 1px 20px -2px #caefab;
-  -webkit-box-shadow:inset 0px 1px 20px -2px #caefab;
-  box-shadow:inset 0px 1px 20px -2px #caefab;
-  background-color: #39E639;
-  -moz-border-radius:6px;
-  -webkit-border-radius:6px;
-  border-radius:6px;
-  border:1px solid grey;
-  color:black;
-  margin-top:6px;
-  margin-bottom:6px;
-  font-family:Arial;
-  font-size:14px;
-  font-weight:bold;
-  padding:6px 20px;
-  text-decoration:none;
-  float:right;
-}
-
-.submitButton:active {
-  position:relative;
-  top:1px;
-}
-
 input[readonly] {
   width:300px;
   /*
@@ -704,9 +653,6 @@ input[readonly] {
   vertical-align:top;
 }
 
-#formElement {
-  height: 35px;
-}
 /* END common2 */
 /* BEGIN common3 */
 span.installationWizardStageNumber {
@@ -806,7 +752,6 @@ span.installationWizardStageNumber {
 #txnProgressStatusDivId {
   width: auto;
   max-width:500px;
-  /-*height: 2em;*-/
   border-style: solid;
   border-width: 2px;
   border-radius:2px;
@@ -831,13 +776,6 @@ span.installationWizardStageNumber {
     text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
 }
 
-.formStatusBarZeroOpacity {
-  visibility: hidden;
-  opacity: 0;
-  transition: visibility 0s 5s, opacity 3s linear;
-  -moz-transition: visibility 0s 5s, opacity 3s linear;
-}
-
 #txnProgressCoreDivId {
   /* Float above all else*/
   z-index:15;
@@ -1021,7 +959,6 @@ span.installationWizardStageNumber {
 
 #informationalPanelContainerDivId .yui3-widget-ft .yui3-button:active {
   background-color: #e6e6e6;
-  background-color: #d9d9d9 \9;
   background-image: none;
   outline: 0;
   -webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);
@@ -1088,12 +1025,6 @@ span.installationWizardStageNumber {
   margin: auto;
 }
 
-.centered {
-  position: fixed; 
-  left: 50%; 
-  top: 50%;
-}
-
 #configureClusterInputContainerDivId {
   float:left;
   width:400px;
@@ -1144,181 +1075,11 @@ span.installationWizardStageNumber {
     margin-left: 320px;
 }
 /* END common3 */
-/* BEGIN selectHosts */
-#serviceMastersLinksDivId {
-  width:40%;
-  float:left;
-}
-
-.aServiceMasterLink {
-  display:block;
-  border: 1px solid #B2B299;
-  clear:left;
-  float: left;
-  width:100%;
-  height:35px;
-  background-color: #DBDBDB;
-  color:white;
-  margin-bottom:15px;
-}
-
-.aServiceMasterLinkVisited {
-  display:block;
-  border: 1px solid #B2B299;
-  clear:left;
-  float: left;
-  width:100%;
-  height:35px;
-  background-color: green;
-  color:white;
-  margin-bottom:15px;
-  font-weight:bold;
-}
-
-#nodeGroupsCoreDivId {
-  border: 1px solid #B2B299;
-  float:left;
-  width:100%;
-}
-
-#nodeListDynamicId {
-  border: 1px solid #B2B299;
-  text-align:center;
-  /* display:inline-block; */
-}
-
-#nodeGroupsTable {
-  margin:5px;
-  overflow:auto;
-}
-
-.nodeGroupTitle {
-  font-weight:bold;
-  font-size:1.2em;
-  padding:5px;
-  background-color:#B2B299;
-  color:white;
-}
-
-.nodeList {
-  display:block;
-  margin:5px;
-  width:40%;
-  margin-left:50%;
-}
-
-.aNodeGroup {
-  /*overflow:auto;*/
-  padding:10px;
-  width:500px;
-  float:left;
-}
-
-.slotBucket {
-  margin:5px;
-  display:block;
-  float:left;
-}
-
-.slotTitle {
-  display:block;
-}
-
-.slot {
-  border: 1px solid #B2B299;
-  min-height:50px;
-
-  /* Color transition */
-  transition: background-color 1s cubic-bezier(.09, .99, .37, .98);
-  -moz-transition: background-color 1s cubic-bezier(.09, .99, .37, .98);    /* FF3.7+ */
-  -o-transition: background-color 1s cubic-bezier(.09, .99, .37, .98) ;      /* Opera 10.5 */
-  -webkit-transition: background-color 1s cubic-bezier(.09, .99, .37, .98) ; /* Saf3.2+, Chrome */
-}
-
-.slotHover {
-  border: 1px solid #B2B299;
-  min-height:50px;
- /* background-color: #00CC00; */
-  background-color:#F0F0E8;
-}
-
-.yui3-dd-drop-over {
- /* background-color: #00CC00; */
-  background-color:#F0F0E8;
-}
-
-.masterDiv {
-  border:1px solid green;
-  margin:3px;
-  padding:10px;
-  cursor:move;
-  /* background-color: #00CC00; */
-  background-color:#65B642;
-  border-radius:4px 4px 4px 4px;
-  color:white;
-  font-weight:bold;
-  width:180px;
-}
 
 #selectServiceMastersSubmitButtonId {
   clear:both;
 }
 
-.nodeAssignmentWrapper {
-  display:block;
-  padding:3px;
-
-  /* Color transition */
-  transition: background-color 0.5s cubic-bezier(.09, .99, .37, .98);
-  -moz-transition: background-color 0.5s cubic-bezier(.09, .99, .37, .98);    /* FF3.7+ */
-  -o-transition: background-color 0.5s cubic-bezier(.09, .99, .37, .98) ;      /* Opera 10.5 */
-  -webkit-transition: background-color 0.5s cubic-bezier(.09, .99, .37, .98) ; /* Saf3.2+, Chrome */
-}
-
-.nodeAssignmentWrapperHover {
-  display:block;
-  padding:3px;
-  /* background-color: #00CC00; */
-  background-color: #F0F0E8;
-}
-
-.nodeAssignment {
-  display:inline-block;
-}
-
-.nodeAssignmentHover {
-  display:inline-block;
-}
-/* END selectHosts */
-/* BEGIN clusters */
-#clustersNavigationLinksDivId {
-  width: 100%;
-  text-align: center;
-  margin: 0px auto;
-  margin-bottom: 8px;
-}
-
-#clustersNavigationLinksListId {
-  margin:0;
-  padding:0;
-  text-align:center;
-  height:50px;
-}
-
-#clustersNavigationLinksListId li {
-  display: inline-block;
-  width: auto;
-  padding: 5px;
-  margin: 2px;
-  cursor: default;
-}
-
-#clustersHostRoleMappingFieldsetId {
-  margin-left: auto;
-  margin-right: auto;
-  width: 300px;
-}
-/* END clusters */
 /* BEGIN manageServices */
 #serviceManagementCoreDivId {
   width: 400px;
@@ -1444,3 +1205,38 @@ ul#serviceManagementListId,
   margin:0;
 }
 /* END manageServices */
+
+#stageTabsContainer {
+
+}
+
+#stageTabs {
+  margin: 30px 0 30px 0;
+}
+
+#stageTabs li {
+  display: inline-block;
+  width: auto;
+  padding: 10px;
+  margin: 0 4px 0 0;
+  cursor: default;
+  color: white;
+  font-size: 12px;
+  border-radius: 4px;
+  -moz-border-radius: 4px;
+  -webkit-border-radius: 4px;
+}
+
+#stageTabs li.current {
+  background-color: #65B642;
+  font-weight: bolder;
+  font-size: 14px;
+}
+
+#stageTabs li.unvisited {
+  background-color: rgb(190, 190, 190);
+}
+#stageTabs li.visited {
+  background-color: grey;
+  cursor: pointer;
+}

+ 4 - 4
hmc/html/bootstrapJs.htmli → hmc/html/_bootstrapJs.php

@@ -18,9 +18,9 @@
  under the License.
 */
 ?>
-<link type="text/css" rel="stylesheet" href="../css/yuiCombined.css">
-<script src="../js/ext/yui-min.js"></script>
-<script src="../js/ext/yuiCombined.js"></script>
+<link type="text/css" rel="stylesheet" href="/hmc/css/yuiCombined.css">
+<script src="/hmc/js/ext/yui-min.js"></script>
+<script src="/hmc/js/ext/yuiCombined.js"></script>
 
 <script type="text/javascript">
   var globalYui, Y;
@@ -29,7 +29,7 @@
     for (var jsFile in jsFilesToLoad) {
       var dynamicJsScript = document.createElement("script");
       dynamicJsScript.type = "text/javascript";
-      dynamicJsScript.src = '../' + jsFilesToLoad[jsFile];
+      dynamicJsScript.src = '/hmc/' + jsFilesToLoad[jsFile];
       dynamicJsScript.async = false;
       document.getElementsByTagName("head")[0].appendChild(dynamicJsScript);
     }

+ 0 - 0
hmc/html/footer.htmli → hmc/html/_footer.php


+ 4 - 4
hmc/html/head.htmli → hmc/html/_head.php

@@ -19,7 +19,7 @@
 */
 ?>
     <title id="pageTitleId"><?php echo $RES['page.title'] ?></title>
-    <link type="text/css" rel="stylesheet" href="../css/cssreset-min.css">
-    <link type="text/css" rel="stylesheet" href="../css/bootstrap.css" media="screen"/>
-    <link type="text/css" rel="stylesheet" href="../css/app.css" media="screen"/>
-    <link rel="shortcut icon" href="../images/logo-micro.gif">
+    <link type="text/css" rel="stylesheet" href="/hmc/css/cssreset-min.css">
+    <link type="text/css" rel="stylesheet" href="/hmc/css/bootstrap.css" media="screen"/>
+    <link type="text/css" rel="stylesheet" href="/hmc/css/app.css" media="screen"/>
+    <link rel="shortcut icon" href="/hmc/images/logo-micro.gif">

+ 71 - 51
hmc/html/head.inc → hmc/html/_router.php

@@ -1,5 +1,6 @@
 <?php
 /*
+
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
@@ -16,120 +17,139 @@
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
+
 */
 
-require_once '../php/conf/MessageResources-en.inc';
-require_once '../php/util/Logger.php';
-require_once '../php//conf/Config.inc';
-require_once "../php/util/lock.php";
-require_once '../php/db/HMCDBAccessor.php';
-require_once "../php/util/clusterState.php";
+// Do not cache pages.  Otherwise handling browser back/forward
+// can cause problems due to stale content.
+header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
+header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
+
+$BASE_DIR = dirname(__FILE__);
+require_once $BASE_DIR.'/../php/conf/MessageResources-en.inc';
+require_once $BASE_DIR.'/../php/util/Logger.php';
+require_once $BASE_DIR.'/../php/conf/Config.inc';
+require_once $BASE_DIR.'/../php/util/lock.php';
+require_once $BASE_DIR.'/../php/db/HMCDBAccessor.php';
+require_once $BASE_DIR.'/../php/util/clusterState.php';
 
-/* 
- * due to the way include files are scoped,
+/*
+ * Due to the way include files are scoped,
  * we return the string to be eval'd, rather than
  * executing them.
  */
-function redirectToPage($requestPage, $targetPage) {
-  // if the page is index.php or the root app directory, don't redirect... simply include
-  if ($requestPage != 'index.php' && $requestPage != 'html') {
-    return "header('Location: /hmc/html/$targetPage');";
+function redirectToPage($requestPage, $targetPage)
+{
+  $bypassRouter = $GLOBALS['BYPASS_ROUTER'] || (isset($_GET['bypassRouter']) && $_GET['bypassRouter']);
+  if (!$bypassRouter) {
+    // if the page is index.php or the root app directory, don't redirect... simply include
+    if ($requestPage != 'index.php' && $requestPage != 'html') {
+      return "header('Location: /hmc/html/$targetPage'); exit;";
+    } else {
+      return "require('$targetPage'); exit;";
+    }
   } else {
-    return "require('$targetPage');";
+    // do not redirect/forward.  fall through
+    return "";
   }
 }
 
-$logger = new HMCLogger("Interceptor");
+$logger = new HMCLogger("Router");
 $db = new HMCDBAccessor($GLOBALS["DB_PATH"]);
 $appDir = "/hmc/html";
 
-/* If bypassRouter parameter is 1, don't do any routing */
-
-$bypassRouter = (isset($_GET['bypassRouter']) && $_GET['bypassRouter']);
-
 $res = $db->getAllClusters();
 $clusters = $res['clusters'];
 $requestPage = basename(preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']));
-$logger->log_trace('requestPage='.$requestPage);
+$logger->log_trace('requestPage=' . $requestPage);
 
 if (sizeof($clusters) == 0) {
   if ($requestPage != 'welcome.php' && $requestPage != 'initializeCluster.php') {
     eval(redirectToPage($requestPage, 'welcome.php'));
-    exit;
   }
   $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));
+    $state = json_decode($cluster['state'], true);
+    $logger->log_trace('cluster state=' . print_r($state, 1));
     switch ($state['state']) {
       case 'NOT_CONFIGURED':
-        if ($requestPage != 'welcome.php' && 
-            $requestPage != 'initializeCluster.php') {
+        if ($requestPage != 'welcome.php' &&
+          $requestPage != 'initializeCluster.php'
+        ) {
           eval(redirectToPage($requestPage, 'welcome.php'));
-          exit;
         }
         $clusterState = 'NOT_CONFIGURED';
         break;
       case 'DEPLOYED':
         if ($state['context']['status']) {
-          if (!$bypassRouter && $requestPage == 'initializeCluster.php') {
+          if ($requestPage == 'initializeCluster.php') {
             eval(redirectToPage($requestPage, 'index.php'));
-            exit;
           }
           $clusterState = 'OPERATIONAL';
         } else {
-          if (!$bypassRouter && $requestPage != 'installFailed.php' && $requestPage != 'uninstallWizard.php') {
+          if ($requestPage != 'installFailed.php' && $requestPage != 'uninstallWizard.php') {
             eval(redirectToPage($requestPage, 'installFailed.php'));
-            exit; 
           }
-          $clusterState = 'DEPLOY_FAILED';            
+          $clusterState = 'DEPLOY_FAILED';
         }
         break;
       case 'CONFIGURATION_IN_PROGRESS':
-        if (!$bypassRouter && $requestPage != 'welcome.php' && $requestPage != 'initializeCluster.php') {
+        if ($requestPage != 'welcome.php' && $requestPage != 'initializeCluster.php') {
           eval(redirectToPage($requestPage, 'welcome.php'));
-          exit;
         }
         $clusterState = 'CONFIGURATION_IN_PROGRESS';
-        break;      
+        break;
       case 'DEPLOYMENT_IN_PROGRESS':
-        if (!$bypassRouter && $requestPage != 'showDeployProgress.php') {
+        if ($requestPage != 'showDeployProgress.php') {
           eval(redirectToPage($requestPage, 'showDeployProgress.php'));
-          exit;
-        }     
+        }
         $clusterState = 'DEPLOYMENT_IN_PROGRESS';
         break;
       case 'NODE_ADDITION_IN_PROGRESS':
-        if (!$bypassRouter && $requestPage != 'showDeployAddedNodesProgress.php') {
+        if ($requestPage != 'showDeployAddedNodesProgress.php') {
           eval(redirectToPage($requestPage, 'showDeployAddedNodesProgress.php'));
-          exit;
-        }     
+        }
         $clusterState = 'NODE_ADDITION_IN_PROGRESS';
         break;
       case 'SERVICE_MANAGEMENT_IN_PROGRESS':
-        if (!$bypassRouter && $requestPage != 'showManageServicesProgress.php') {
+        if ($requestPage != 'showManageServicesProgress.php') {
           eval(redirectToPage($requestPage, 'showManageServicesProgress.php'));
-          exit;
-        }     
+        }
         $clusterState = 'SERVICE_MANAGEMENT_IN_PROGRESS';
-        break;        
+        break;
       case 'UNINSTALLATION_IN_PROGRESS':
-        if (!$bypassRouter && $requestPage != 'showUninstallProgress.php') {
+        if ($requestPage != 'showUninstallProgress.php') {
           eval(redirectToPage($requestPage, 'showUninstallProgress.php'));
-          exit;
-        }     
+        }
         $clusterState = 'UNINSTALLATION_IN_PROGRESS';
         break;
       case 'UNINSTALLED':
-        if (!$bypassRouter && $requestPage != 'uninstallFailed.php') {
+        if ($requestPage != 'uninstallFailed.php') {
           eval(redirectToPage($requestPage, 'uninstallFailed.php'));
-          exit;
         }
         $clusterState = 'UNINSTALL_FAILED';
-        break;        
-    } 
-  }  
+        break;
+      case 'UPGRADE_STACK_PENDING':
+        if ($requestPage != 'upgradeStack/index.php') {
+          eval(redirectToPage($requestPage, 'upgradeStack/index.php'));
+        }
+        $clusterState = 'UPGRADE_STACK_PENDING';
+        break;
+      case 'UPGRADE_STACK_UNINSTALL_IN_PROGRESS':
+        if ($requestPage != 'upgradeStack/uninstall.php') {
+          eval(redirectToPage($requestPage, 'upgradeStack/uninstall.php'));
+        }
+        $clusterState = 'UPGRADE_STACK_UNINSTALL_IN_PROGRESS';
+        break;
+      case 'UPGRADE_STACK_DEPLOY_IN_PROGRESS':
+        if ($requestPage != 'upgradeStack/deploy.php') {
+          eval(redirectToPage($requestPage, 'upgradeStack/deploy.php'));
+        }
+        $clusterState = 'UPGRADE_STACK_DEPLOY_IN_PROGRESS';
+        break;
+    }
+  }
 }
 ?>

+ 0 - 0
hmc/html/subnav.htmli → hmc/html/_subnav.php


+ 4 - 4
hmc/html/topnav.htmli → hmc/html/_topnav.php

@@ -19,13 +19,13 @@
 */
 ?>
 <!-- START TOPNAV -->
- <?php 
-    $homeUrl = '/hmc/html';
-	?>
+<?php
+  $homeUrl = '/hmc/html';
+?>
 	<div class="navbar">
 		<div class="navbar-inner">
 			<div class="container">
-				<a href="<?php echo $homeUrl ?>"><img id="logo" src="../images/logo-small.gif"></a>
+				<a href="<?php echo $homeUrl ?>"><img id="logo" src="/hmc/images/logo-small.gif"></a>
 				<a class="brand" href="<?php echo $homeUrl ?>"><?php echo $RES['app.name'] ?></a>
         <ul class="nav">
 				<?php if (isset($clusterState) && $clusterState == 'OPERATIONAL') { ?> 

+ 0 - 0
hmc/html/txnUtils.htmli → hmc/html/_txnUtils.php


+ 1 - 1
hmc/html/utils.htmli → hmc/html/_utils.php

@@ -28,7 +28,7 @@
      hideLoadingImg() method from utils.js. -->
 <div id="loadingDivId">
   <div id="loadingBlackScreenDivId"></div>
-  <img id="loadingImgId" src="../images/loadingLarge.gif"/>
+  <img id="loadingImgId" src="/hmc/images/loadingLarge.gif"/>
 </div>
 
 <!-- Placeholder for our informational YUI panel. -->

+ 10 - 10
hmc/html/addNodesWizard.php

@@ -18,17 +18,17 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="ContentDivId"> 
-      <?php require "./subnav.htmli"; ?>
+    <div id="content">
+      <?php require "./_subnav.php"; ?>
       
       <!-- Installation Wizard -->
       <div name="installationWizardDiv" id="installationWizardDivId" style="display:block">
@@ -53,7 +53,7 @@
           </ol>
         </div>
 
-        <?php require "./utils.htmli"; ?>
+        <?php require "./_utils.php"; ?>
 
         <div name="installationMainFormsDiv" id="installationMainFormsDivId">
           <div id="addNodesCoreDivId" style="display:block">
@@ -103,20 +103,20 @@
             <button class="btn btn-large" id="deployAddedNodesSubmitButtonId"><?php echo $RES['addNodesWizard.selectServices.submit.label'] ?></button>
           </div>
 
-          <?php require "./txnUtils.htmli"; ?>
+          <?php require "./_txnUtils.php"; ?>
 
         </div>
       </div>
       <!-- End of installation Wizard -->
 
     </div>
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
 
     var freshInstall = false;
-    var clusterName = "<?php echo $_GET['clusterName']; ?>";
+    var clusterName = "<?php echo $clusterName; ?>";
     var nodesAction = "addNodes";
 
     var InstallationWizard = {
@@ -142,7 +142,7 @@
       ];
     </script>
   
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
 
   </body>

+ 10 - 15
hmc/html/index.php

@@ -18,32 +18,27 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
       
-    <div id="ContentDivId">
-      <?php require "./subnav.htmli"; ?>
-      <?php require "./utils.htmli"; ?>            
+    <div id="content">
+      <?php require "./_subnav.php"; ?>
+      <?php require "./_utils.php"; ?>
 
-      <!-- List of clusters -->
-      <div id="clustersListDivId" style="display:none">
-      </div>
-
-      <div id="clusterHostRoleMappingDivId" style="display:none">
-        <div id="clusterHostRoleMappingDynamicRenderDivId">
+      <div id="clusterHostRoleMapping" style="display:none">
+        <div id="clusterHostRoleMappingContent">
         </div>      
       </div>
-
     </div>        
     <!-- End of contentDivId -->
     
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
@@ -54,7 +49,7 @@
       ];
     </script>
 
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
   </body>
 </html> 

+ 9 - 9
hmc/html/initializeCluster.php

@@ -18,18 +18,18 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc"; ?>
+<?php require_once "./_router.php"; ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
     <script src="../js/ext/jquery.min.js"></script>
     <script src="../js/ext/bootstrap.min.js"></script>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="ContentDivId">
+    <div id="content">
 
       <!-- List of clusters
       <div name="clustersListDiv" id="clustersListDivId">
@@ -99,7 +99,7 @@
           </ol>
         </div>
 
-        <?php require "./utils.htmli"; ?>
+        <?php require "./_utils.php"; ?>
 
         <div id="installationMainFormsDivId">
               <div id="createClusterCoreDivId">
@@ -184,7 +184,7 @@
                   </div>
                 </div>
                 </fieldset>
-                <a href="javascript:void 0" class="btn btn-large" style="margin:10px 0 0 60px" id="selectServicesSubmitButtonId" class="submitButton"><?php echo $RES['initWizard.selectServices.submit.label'] ?></a>
+                <a href="javascript:void 0" class="btn btn-large" style="margin:10px 0 0 60px" id="selectServicesSubmitButtonId"><?php echo $RES['initWizard.selectServices.submit.label'] ?></a>
 
               </div>
               <!-- End of selectServicesCoreDivId -->
@@ -287,13 +287,13 @@
                   <a href="javascript:void 0" class="btn btn-large" id="deploySubmitButtonId" value="Deploy"><?php echo $RES['initWizard.reviewAndDeploy.submit.label'] ?></a>
                 </div>
 
-                <?php require "./txnUtils.htmli"; ?>
+                <?php require "./_txnUtils.php"; ?>
 
               </div>
             </div>
             <!-- End of installation Wizard -->
     </div>
-            <?php require "./footer.htmli"; ?>
+            <?php require "./_footer.php"; ?>
 
             <!-- Javascript Scaffolding -->
             <script type="text/javascript">
@@ -343,7 +343,7 @@
             // jsFilesToLoad.push('js/test/initializeClusterTest.js');
             </script>
 
-            <?php require "./bootstrapJs.htmli"; ?>
+            <?php require "./_bootstrapJs.php"; ?>
             <!-- End of Javascript Scaffolding -->
 
           </body>

+ 5 - 5
hmc/html/installFailed.php

@@ -18,14 +18,14 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
-    <div id="ContentDivId"> 
+    <?php require "./_topnav.php"; ?>
+    <div id="content">
       <div class="container">
         <div class="alert alert-important" style="margin-top:40px;padding:20px">
           <h2 style="margin-bottom:10px"><?php echo $RES['installFailed.header'] ?></h2>
@@ -34,6 +34,6 @@
         </div>
       </div>
     </div>
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
   </body>
 </html>

+ 10 - 60
hmc/html/manageServices.php

@@ -18,93 +18,43 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="ContentDivId">
-      <?php require "./subnav.htmli"; ?>
-      <?php require "./utils.htmli"; ?>
+    <div id="content">
+      <?php require "./_subnav.php"; ?>
+      <?php require "./_utils.php"; ?>
 
       <!-- Service Management: The Main Event -->
       <div id="serviceManagementCoreDivId">
         <ul id="serviceManagementListId">
           <div id="serviceManagementDynamicRenderDivId">
-            <!--
-            <li class="serviceManagementEntry serviceManagementEntryStopped">
-              <div>
-                <span class="serviceManagementEntryNameContainer">
-                  <a href="javascript:void(null)" class="serviceManagementEntryName">HDFS</a>
-                </span>
-                <div class="serviceManagementEntryActionsContainer">
-                  <a href="javascript:void(null)" title="Start" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionStart"></a>
-                  <a href="javascript:void(null)" title="Stop" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionStop"></a>
-                  <a href="javascript:void(null)" title="Reconfigure" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionReconfigure"></a>
-                </div>
-              </div>
-            </li>
-            <li class="serviceManagementEntry serviceManagementEntryStarted">
-              <div>
-                <span class="serviceManagementEntryNameContainer">
-                  <a href="javascript:void(null)" class="serviceManagementEntryName">MapReduce</a>
-                </span>
-                <div class="serviceManagementEntryActionsContainer">
-                  <a href="javascript:void(null)" title="Start" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionStart"></a>
-                  <a href="javascript:void(null)" title="Stop" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionStop"></a>
-                  <a href="javascript:void(null)" title="Reconfigure" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionReconfigure"></a>
-                </div>
-              </div>
-            </li>
-            <li class="serviceManagementEntry serviceManagementEntryStarted">
-              <div>
-                <span class="serviceManagementEntryNameContainer">
-                  <a href="javascript:void(null)" class="serviceManagementEntryName">HBase</a>
-                </span>
-                <div class="serviceManagementEntryActionsContainer">
-                  <a href="javascript:void(null)" title="Start" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionStart"></a>
-                  <a href="javascript:void(null)" title="Stop" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionStop"></a>
-                  <a href="javascript:void(null)" title="Reconfigure" 
-                     class="serviceManagementEntryAction serviceManagementEntryActionReconfigure"></a>
-                </div>
-              </div>
-            </li>
-            -->
           </div>
         </ul>
         <div id="serviceManagementGlobalActionsDivId" style="display:none">
           <button class="btn btn-large" id="serviceManagementGlobalActionsStartAllButtonId" name="startAll" style="margin-right:10px"><i class="iconic-play" style="margin-right:10px"></i>Start All</button>
           <button class="btn btn-large" id="serviceManagementGlobalActionsStopAllButtonId" name="stopAll"><i class="iconic-stop" style="margin-right:10px"></i>Stop All</button>
         </div>
-
-        <br/>
-
       </div>
       <!-- End of serviceManagementCoreDivId -->
 
-      <?php require "./txnUtils.htmli"; ?>
+      <?php require "./_txnUtils.php"; ?>
 
     </div>
     <!-- End of contentDivId -->
 
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
       /* Minimal data required to bootstrap manageServices.js. */
-      var clusterName = '<?php echo $_GET['clusterName']; ?>';
+      var clusterName = '<?php echo $clusterName; ?>';
 
       var jsFilesToLoad = [ 
         'js/utils.js',
@@ -115,7 +65,7 @@
       ];
     </script>
 
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
 
   </body>

+ 8 - 8
hmc/html/showDeployAddedNodesProgress.php

@@ -18,24 +18,24 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="contentDivId"> 
+    <div id="content">
 
-      <?php require "./utils.htmli"; ?>
-      <?php require "./txnUtils.htmli"; ?>
+      <?php require "./_utils.php"; ?>
+      <?php require "./_txnUtils.php"; ?>
 
     </div>
     <!-- End of contentDivId -->
 
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
@@ -50,7 +50,7 @@
       ];
     </script>
 
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
   </body>
 </html> 

+ 8 - 8
hmc/html/showDeployProgress.php

@@ -18,24 +18,24 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="contentDivId"> 
+    <div id="content">
 
-      <?php require "./utils.htmli"; ?>
-      <?php require "./txnUtils.htmli"; ?>
+      <?php require "./_utils.php"; ?>
+      <?php require "./_txnUtils.php"; ?>
 
     </div>
     <!-- End of contentDivId -->
 
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
@@ -50,7 +50,7 @@
       ];
     </script>
 
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
   </body>
 </html> 

+ 8 - 8
hmc/html/showManageServicesProgress.php

@@ -18,24 +18,24 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="contentDivId"> 
+    <div id="content">
 
-      <?php require "./utils.htmli"; ?>
-      <?php require "./txnUtils.htmli"; ?>
+      <?php require "./_utils.php"; ?>
+      <?php require "./_txnUtils.php"; ?>
 
     </div>
     <!-- End of contentDivId -->
 
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
@@ -50,7 +50,7 @@
       ];
     </script>
 
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
   </body>
 </html> 

+ 8 - 8
hmc/html/showUninstallProgress.php

@@ -18,24 +18,24 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="contentDivId"> 
+    <div id="content">
 
-      <?php require "./utils.htmli"; ?>
-      <?php require "./txnUtils.htmli"; ?>
+      <?php require "./_utils.php"; ?>
+      <?php require "./_txnUtils.php"; ?>
 
     </div>
     <!-- End of contentDivId -->
 
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
@@ -50,7 +50,7 @@
       ];
     </script>
 
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
   </body>
 </html> 

+ 5 - 5
hmc/html/uninstallFailed.php

@@ -18,14 +18,14 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
-    <div id="ContentDivId"> 
+    <?php require "./_topnav.php"; ?>
+    <div id="content">
       <div class="container">
         <div class="alert alert-important" style="margin-top:40px;padding:20px">
           <h2 style="margin-bottom:10px"><?php echo $RES['uninstallFailed.header'] ?></h2>
@@ -36,6 +36,6 @@
         </div>
       </div>
     </div>
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
   </body>
 </html>

+ 11 - 15
hmc/html/uninstallWizard.php

@@ -18,26 +18,22 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once "./_router.php" ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
-    <?php 
-     include_once ("../php/util/clusterState.php"); 
-    // $clusterName = "m4v1";
-    // $clusterState = needWipeOut($clusterName); 
-    ?>
+    <?php require "./_topnav.php"; ?>
+    <?php include_once "../php/util/clusterState.php"; ?>
     
-    <div id="ContentDivId"> 
-      <?php require "./subnav.htmli"; ?>
+    <div id="content">
+      <?php require "./_subnav.php"; ?>
 
       <!-- Uninstallation Wizard -->
       <div id="installationWizardDivId" style="display:block">
-        <?php require "./utils.htmli"; ?>
+        <?php require "./_utils.php"; ?>
         <div class="pageSummary" style="margin-top:0px">
           <h2><?php echo $RES['uninstallWizard.pageSummary.header'] ?></h2>
           <p><?php echo $RES['uninstallWizard.pageSummary.body'] ?></p>
@@ -67,20 +63,20 @@
               </fieldset>
             </div>
           </div>
-          <?php require "./txnUtils.htmli"; ?>
+          <?php require "./_txnUtils.php"; ?>
 
         </div>
       </div>
       <!-- End of Uninstallation Wizard -->
     </div>            
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
 
     <!-- Javascript Scaffolding -->
     <script type="text/javascript">
 
     var freshInstall = false;
     var nodesAction = "uninstall";
-    var clusterName = "<?php echo $_GET['clusterName']; ?>";
+    var clusterName = "<?php echo $clusterName; ?>";
 
     var InstallationWizard = {
 
@@ -98,7 +94,7 @@
       ];
     </script>
 
-    <?php require "./bootstrapJs.htmli"; ?>
+    <?php require "./_bootstrapJs.php"; ?>
     <!-- End of Javascript Scaffolding -->
 
   </body>

+ 61 - 0
hmc/html/upgradeStack/_stageMenu.php

@@ -0,0 +1,61 @@
+<?php
+/*
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+*/
+
+switch ($requestPage) {
+  case 'uninstall.php':
+    $uninstallStageClass = 'current';
+    $reconfigureStageClass = 'unvisited';
+    $deployStageClass = 'unvisited';
+    break;
+  case 'reconfigure.php':
+    $uninstallStageClass = 'visited';
+    $reconfigureStageClass = 'current';
+    $deployStageClass = 'unvisited';
+    break;
+  case 'deploy.php':
+    $uninstallStageClass = 'visited';
+    $reconfigureStageClass = 'visited';
+    $deployStageClass = 'current';
+    break;
+}
+
+?>
+  <div id="stageTabsContainer">
+    <ul id="stageTabs">
+      <li id="uninstallStage" class="<?php echo $uninstallStageClass ?>">
+        <div>
+          <span class="stageNumber">1.</span>
+          Uninstall Services
+        </div>
+      </li>
+      <li id="reconfigureStage" class="<?php echo $reconfigureStageClass ?>">
+        <div>
+          <span class="stageNumber">2.</span>
+          Reconfigure Services
+        </div>
+      </li>
+      <li id="deployStage" class="<?php echo $deployStageClass ?>">
+        <div>
+          <span class="stageNumber">3.</span>
+          Deploy New Version
+        </div>
+      </li>
+    </ul>
+  </div>

+ 77 - 0
hmc/html/upgradeStack/deploy.php

@@ -0,0 +1,77 @@
+<?php
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+?>
+<?php require_once '../_router.php' ?>
+<html>
+<head>
+  <?php require "../_head.php" ?>
+  <script src="/hmc/js/ext/jquery.min.js"></script>
+</head>
+
+<body class="yui3-skin-sam">
+  <?php require "../_topnav.php"; ?>
+
+  <div id="content">
+    <?php require '_stageMenu.php'; ?>
+
+    <!-- Begin Wizard -->
+    <div id="upgradeStackWizard">
+      <?php require "../_utils.php"; ?>
+      <div id="deployPanel">
+        <div class="pageSummary" style="margin-top:0px">
+          <h2><?php echo $RES['upgradeStack.deploy.pageSummary.header'] ?></h2>
+          <p><?php echo $RES['upgradeStack.deploy.pageSummary.body'] ?></p>
+        </div>
+        <div id="formStatusDivId" class="alert alert-error" style="display:none">
+        </div>
+        <form id="deployFormId">
+          <fieldset id="deployFieldSetId">
+            <!--<legend>Review your settings</legend>-->
+            <div id="deployDynamicRenderDivId"></div>
+          </fieldset>
+        </form>
+        <!--<a href="reconfigure.php" class="btn btn-large" id="backToReconfigureButton"><?php echo $RES['upgradeStack.deploy.backButton.label'] ?></a>-->
+        <a href="javascript:void 0" class="btn btn-large btn-success" id="deploySubmitButton" style="margin:0 0 40px 320px"><?php echo $RES['upgradeStack.deploy.submit.label'] ?></a>
+      </div>
+      <?php require "../_txnUtils.php"; ?>
+    </div>
+    <!-- End Wizard -->
+  </div>
+  <?php require "../_footer.php"; ?>
+
+  <!-- Javascript Scaffolding -->
+  <script type="text/javascript">
+
+    var clusterName = '<?php echo $clusterName; ?>';
+
+    var jsFilesToLoad = [
+      'js/ext/sinon.min.js',
+      'js/utils.js',
+      'js/txnUtils.js',
+      'js/configureServicesUtils.js',
+      'js/upgradeStack/deploy.js'
+    ];
+  </script>
+
+  <?php require "../_bootstrapJs.php"; ?>
+  <!-- End of Javascript Scaffolding -->
+
+</body>
+</html> 

+ 19 - 16
hmc/html/reinstall.php → hmc/html/upgradeStack/index.php

@@ -18,22 +18,25 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc" ?>
+<?php require_once '../_router.php' ?>
 <html>
-  <head>
-    <?php require "./head.htmli" ?>
-  </head>
-  <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
-    <div id="ContentDivId"> 
-      <div class="container">
-        <div class="alert alert-important" style="margin-top:40px;padding:20px">
-          <h2 style="margin-bottom:10px"><?php echo $RES['reinstall.header'] ?></h2>
-          <p><?php echo $RES['reinstall.body'] ?></p>
-          <a id="submitLinkId" class='btn btn-large' style='margin-top:20px' href='initializeCluster.php'><?php echo $RES['reinstall.submit.label'] ?></a>
-        </div>
+<head>
+  <?php require "../_head.php" ?>
+  <script src="/hmc/js/ext/jquery.min.js"></script>
+</head>
+<body class="yui3-skin-sam">
+  <?php require "../_topnav.php"; ?>
+
+  <div id="content">
+      <div class="alert alert-info" style="margin-top:40px;padding:20px">
+        <h2><?php echo $RES['upgradeStack.index.pageSummary.header'] ?></h2>
+        <p><?php echo $RES['upgradeStack.index.pageSummary.body'] ?></p>
+        <p style="font-weight:bold">Upgrading from HDP Version X to Y</p>
+        <a href="uninstall.php" class="btn btn-large" id="submitButton"><?php echo $RES['upgradeStack.index.submit.label'] ?></a>
       </div>
     </div>
-    <?php require "./footer.htmli"; ?>
-  </body>
-</html>
+  </div>
+  <?php require "../_footer.php"; ?>
+
+</body>
+</html> 

+ 88 - 0
hmc/html/upgradeStack/reconfigure.php

@@ -0,0 +1,88 @@
+<?php
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+?>
+<?php require_once '../_router.php' ?>
+<html>
+<head>
+  <?php require "../_head.php" ?>
+  <script src="/hmc/js/ext/jquery.min.js"></script>
+  <script src="/hmc/js/ext/bootstrap.min.js"></script>
+</head>
+
+<body class="yui3-skin-sam">
+  <?php require "../_topnav.php"; ?>
+
+  <div id="content">
+    <?php require '_stageMenu.php'; ?>
+
+    <!-- Begin Wizard -->
+    <div id="upgradeStackWizard">
+      <?php require "../_utils.php"; ?>
+      <div id="reconfigurePanel">
+        <div class="pageSummary" style="margin-top:0px">
+          <h2><?php echo $RES['upgradeStack.reconfigure.pageSummary.header'] ?></h2>
+          <p><?php echo $RES['upgradeStack.reconfigure.pageSummary.body'] ?></p>
+        </div>
+        <div id="formStatusDivId" class="alert alert-error" style="display:none">
+        </div>
+        <div id="configureClusterAdvancedCoreDivId">
+          <form id="configureClusterAdvancedFormId">
+            <fieldset id="configureClusterAdvancedFieldSetId">
+              <div id="configureClusterAdvancedDynamicRenderDivId"></div>
+            </fieldset>
+          </form>
+          <div id="buttonAreaDivId" class="clearfix">
+            <div id="buttonGroupDivId">
+              <?php /*
+                          <div id="backNextDivId" class="btn-group">
+                            <a href="javascript:void 0" class="btn btn-large" id="configureClusterAdvancedBackButtonId"><?php echo $RES['initWizard.configureClusterAdvanced.back.label'] ?></a>
+                            <a href="javascript:void 0" class="btn btn-large" id="configureClusterAdvancedNextButtonId"><?php echo $RES['initWizard.configureClusterAdvanced.next.label'] ?></a>
+                          </div>
+                          */ ?>
+              <a href="javascript:void 0" class="btn btn-large btn-success" id="reconfigureSubmitButton"><?php echo $RES['upgradeStack.reconfigure.submit.label'] ?></a>
+            </div>
+          </div>
+        </div>
+      </div>
+      <?php require "../_txnUtils.php"; ?>
+    </div>
+    <!-- End Wizard -->
+  </div>
+  <?php require "../_footer.php"; ?>
+
+  <!-- Javascript Scaffolding -->
+  <script type="text/javascript">
+
+    var clusterName = '<?php echo $clusterName; ?>';
+
+    var jsFilesToLoad = [
+      'js/ext/sinon.min.js',
+      'js/utils.js',
+      'js/txnUtils.js',
+      'js/configureServicesUtils.js',
+      'js/upgradeStack/reconfigure.js'
+    ];
+  </script>
+
+  <?php require "../_bootstrapJs.php"; ?>
+  <!-- End of Javascript Scaffolding -->
+
+</body>
+</html> 

+ 68 - 0
hmc/html/upgradeStack/uninstall.php

@@ -0,0 +1,68 @@
+<?php
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+?>
+<?php require_once '../_router.php' ?>
+<html>
+<head>
+  <?php require "../_head.php" ?>
+  <script src="/hmc/js/ext/jquery.min.js"></script>
+</head>
+<body class="yui3-skin-sam">
+  <?php require "../_topnav.php"; ?>
+
+  <div id="content">
+    <?php require '_stageMenu.php'; ?>
+
+    <!-- Begin Wizard -->
+    <div id="upgradeStackWizard">
+      <?php require "../_utils.php"; ?>
+      <div id="uninstallPanel">
+        <div class="pageSummary" style="margin-top:0px">
+          <h2><?php echo $RES['upgradeStack.uninstall.pageSummary.header'] ?></h2>
+          <p><?php echo $RES['upgradeStack.uninstall.pageSummary.body'] ?></p>
+        </div>
+        <div id="formStatusDivId" class="alert alert-error" style="display:none">
+        </div>
+        <a href="javascript:void 0" class="btn btn-large btn-success" id="uninstallSubmitButton"><?php echo $RES['upgradeStack.uninstall.submit.label'] ?></a>
+      </div>
+      <?php require "../_txnUtils.php"; ?>
+    </div>
+    <!-- End Wizard -->
+  </div>
+  <?php require "../_footer.php"; ?>
+
+  <!-- Javascript Scaffolding -->
+  <script type="text/javascript">
+
+  var clusterName = '<?php echo $clusterName; ?>';
+
+  var jsFilesToLoad = [
+      'js/ext/sinon.min.js',
+      'js/utils.js',
+      'js/txnUtils.js',
+      'js/upgradeStack/uninstall.js'
+    ];
+  </script>
+
+  <?php require "../_bootstrapJs.php"; ?>
+  <!-- End of Javascript Scaffolding -->
+
+</body>
+</html> 

+ 0 - 26
hmc/html/welcome.inc

@@ -1,26 +0,0 @@
-<?php
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-*/
-?>
-<div class="alert alert-info" style="margin-top:40px;padding:20px">
-  <h2 style="margin-bottom:10px"><?php echo $RES['welcome.header'] ?></h2>
-  <p><?php echo $RES['welcome.body'] ?></p>
-  <p><span class='label label-info'>Note</span><span style='margin-left:10px;'><?php echo $RES['welcome.note'] ?></span></p> 
-  <a class='btn btn-large' style='margin-top:20px' href='initializeCluster.php'><?php echo $RES['welcome.submit.label'] ?></a>
-</div>

+ 5 - 5
hmc/html/welcome.php

@@ -18,16 +18,16 @@
  under the License.
 */
 ?>
-<?php require_once "./head.inc"; ?>
+<?php require_once "./_router.php"; ?>
 <html>
   <head>
-    <?php require "./head.htmli" ?>
+    <?php require "./_head.php" ?>
   </head>
 
   <body class="yui3-skin-sam">
-    <?php require "./topnav.htmli"; ?>
+    <?php require "./_topnav.php"; ?>
 
-    <div id="ContentDivId">
+    <div id="content">
       <div class="alert alert-info" style="margin-top:40px;padding:20px">
         <h2 style="margin-bottom:10px"><?php echo $RES['welcome.header'] ?></h2>
         <p><?php echo $RES['welcome.body'] ?></p>
@@ -35,6 +35,6 @@
         <a id="submitLinkId" class='btn btn-large' style='margin-top:20px' href='initializeCluster.php'><?php echo $RES['welcome.submit.label'] ?></a>
       </div>
     </div>
-    <?php require "./footer.htmli"; ?>
+    <?php require "./_footer.php"; ?>
   </body>
 </html>

+ 1 - 1
hmc/js/assignMasters.js

@@ -245,7 +245,7 @@ function AssignMasters() {
     if (hostsToMasterServices[managerHostName] == null) {
       hostsToMasterServices[managerHostName] = {};
     }
-    hostsToMasterServices[managerHostName].MANAGER_SERVER = App.Props.managerServiceName + ' Server';
+    hostsToMasterServices[managerHostName].MANAGER_SERVER = App.props.managerServiceName + ' Server';
 
     $('#masterServicesToHosts').html(markup);
     

+ 25 - 34
hmc/js/clustersList.js

@@ -34,7 +34,7 @@ function ClustersList() {
           clusterServices[serviceName].attributes.runnable &&
           !clusterServices[serviceName].attributes.noDisplay) {
 
-          globalYui.Array.each( clusterServices[serviceName].components, function (serviceComponent) {
+          Y.Array.each( clusterServices[serviceName].components, function (serviceComponent) {
             if (serviceComponent.isMaster) {
               // just add the master to the hostname object
               for (var i in serviceComponent.hostNames) {
@@ -53,7 +53,7 @@ function ClustersList() {
     if (!(hostName in hostMap)) {
       hostMap[hostName] = [];
     }
-    hostMap[hostName].push({ serviceName: App.Props.managerServiceName + ' Server', isMaster: true });
+    hostMap[hostName].push({ serviceName: App.props.managerServiceName + ' Server', isMaster: true });
   }
 
   function populateHostToClientRoleMapping(clusterServices, hostMap) {
@@ -64,7 +64,7 @@ function ClustersList() {
         if (clusterServices[serviceName].isEnabled == "1" &&
           !clusterServices[serviceName].attributes.noDisplay) {
 
-          globalYui.Array.each( clusterServices[serviceName].components, function (serviceComponent) {
+          Y.Array.each( clusterServices[serviceName].components, function (serviceComponent) {
             if (serviceComponent.isClient) {
               // just add the client to the hostname object
               for (var i in serviceComponent.hostNames) {
@@ -106,23 +106,25 @@ function ClustersList() {
 
   this.render = function() {
 
-    globalYui.io("../php/frontend/listClusters.php", {
+    Y.io("/hmc/php/frontend/listClusters.php", {
       method: 'GET',
-      timeout : 10000,
+      timeout : App.io.DEFAULT_AJAX_TIMEOUT_MS,
       on: {
         success: function (x,o) {
-          globalYui.log("RAW JSON DATA: " + o.responseText);
+          var clusterListInfoJson;
+          
+          Y.log("RAW JSON DATA: " + o.responseText);
 
           // Process the JSON data returned from the server
           try {
-            clusterListInfoJson = globalYui.JSON.parse(o.responseText);
+            clusterListInfoJson = Y.JSON.parse(o.responseText);
           }
           catch (e) {
             alert("JSON Parse failed!");
             return;
           }
 
-          globalYui.log("PARSED DATA: " + globalYui.Lang.dump(clusterListInfoJson));
+          Y.log("PARSED DATA: " + Y.Lang.dump(clusterListInfoJson));
 
           if (clusterListInfoJson.result != 0) {
             // Error!
@@ -152,8 +154,8 @@ function ClustersList() {
               var clusterName; var clusterInfo;
               for (clusterId in clusterListInfoJson) {
                 clusterName = clusterId;
-                clusterInfo = globalYui.JSON.parse(clusterListInfoJson[clusterName]);
-                globalYui.log( "Cluster Info: " + globalYui.Lang.dump(clusterInfo.displayName));
+                clusterInfo = Y.JSON.parse(clusterListInfoJson[clusterName]);
+                Y.log( "Cluster Info: " + Y.Lang.dump(clusterInfo.displayName));
               }
             }
           }
@@ -165,19 +167,19 @@ function ClustersList() {
           }
 
           /* Beginning of adding Role Topology information. */
-          globalYui.io( "../php/frontend/fetchClusterServices.php?clusterName=" + clusterName + "&getConfigs=true&getComponents=true", {
-            timeout: 10000,
+          Y.io( "/hmc/php/frontend/fetchClusterServices.php?clusterName=" + clusterName + "&getConfigs=true&getComponents=true", {
+            timeout: App.io.DEFAULT_AJAX_TIMEOUT_MS,
             on: {
               success: function(x1, o1) {
 
-                hideLoadingImg();
+                App.ui.hideLoadingOverlay();
 
-                globalYui.log("RAW JSON DATA: " + o1.responseText);
+                Y.log("RAW JSON DATA: " + o1.responseText);
 
                 var clusterServicesResponseJson;
 
                 try {
-                  clusterServicesResponseJson = globalYui.JSON.parse(o1.responseText);
+                  clusterServicesResponseJson = Y.JSON.parse(o1.responseText);
                 }
                 catch (e) {
                   alert("JSON Parse failed");
@@ -186,7 +188,7 @@ function ClustersList() {
 
                 managerHostName = clusterServicesResponseJson.response.managerHostName;
 
-                globalYui.log(globalYui.Lang.dump(clusterServicesResponseJson));
+                Y.log(Y.Lang.dump(clusterServicesResponseJson));
 
                 /* Check that clusterServicesResponseJson actually indicates success. */
                 if( clusterServicesResponseJson.result == 0 ) {
@@ -202,42 +204,31 @@ function ClustersList() {
                       '</div>' +
                       '</div>';
 
-                  globalYui.one("#clusterHostRoleMappingDynamicRenderDivId").setContent(
+                  Y.one("#clusterHostRoleMappingContent").setContent(
                     markup + generateHostRoleMappingMarkup(clusterServices) );
-                  globalYui.one("#clusterHostRoleMappingDivId").show();
+                  Y.one("#clusterHostRoleMapping").show();
                 }
                 else {
                   alert("Fetching Cluster Services failed");
                 }
               },
               failure: function(x1, o1) {
-                hideLoadingImg();
-                alert("Async call failed");
+                App.ui.hideLoadingOverlay();
+                alert(App.io.DEFAULT_AJAX_ERROR_MESSAGE);
               }
             }
           });
           /* End of adding Role Topology information. */
 
-          globalYui.one("#clustersListDivId").setContent( clustersListMarkup );
-          globalYui.one("#clustersListDivId").setStyle('display', 'block');
-
-          if (globalYui.one('#newClusterLinkDivId') != null) {
-            globalYui.one('#newClusterLinkDivId').on('click',function (e) {
-              /* Done with this stage, hide it. */
-              globalYui.one("#clustersListDivId").setStyle('display','none');
-              // globalYui.one("#installationWizardDivId").setStyle('display','block');
-            });
-          }
-
         },
         failure: function (x,o) {
           //    e.target.set('disabled', false);
-          alert("Async call failed!");
+          alert(App.io.DEFAULT_AJAX_ERROR_MESSAGE);
         }
       }
     });
   }; // end render
 };
 
-var clustersList = new ClustersList();
-clustersList.render();
+new ClustersList().render();
+

+ 10 - 12
hmc/js/configureServices.js

@@ -19,24 +19,22 @@
  *
 */
 
-var globalOptionsInfo = null;
-           
 Y.one('#configureClusterAdvancedSubmitButtonId').on('click',function (e) {
   
   if (this.hasClass('disabled')) {
     return;
   }
   
-  var opts = configureServicesUtil.generateUserOpts();
+  var opts = App.ui.configureServicesUtil.generateUserOpts();
 
   e.target.set('disabled', true);
-  var url = "../php/frontend/configureServices.php?clusterName="+globalOptionsInfo.clusterName;
+  var url = "../php/frontend/configureServices.php?clusterName=" + App.props.clusterName;
   var requestData = opts;
   var submitButton = e.target;
   var thisScreenId = "#configureClusterAdvancedCoreDivId";
   var nextScreenId = "#deployCoreDivId";
   var nextScreenRenderFunction = renderDeploy;
-  var errorFunction = configureServicesUtil.handleConfigureServiceErrors;
+  var errorFunction = App.ui.configureServicesUtil.handleConfigureServiceErrors;
   submitDataAndProgressToNextScreen(url, requestData, submitButton,
       thisScreenId, nextScreenId, nextScreenRenderFunction, errorFunction);
 });
@@ -46,8 +44,8 @@ Y.one('#configureClusterAdvancedSubmitButtonId').on('click',function (e) {
 Y.one("#configureClusterAdvancedDynamicRenderDivId").delegate(
   {
     'keyup' : function (e) {
-      configureServicesUtil.checkPasswordCorrectness();
-      configureServicesUtil.updateServiceErrorCount(e.target.get('name'));
+      App.ui.configureServicesUtil.checkPasswordCorrectness();
+      App.ui.configureServicesUtil.updateServiceErrorCount(e.target.get('name'));
     }
   },
   "input[type=password]"
@@ -56,23 +54,23 @@ Y.one("#configureClusterAdvancedDynamicRenderDivId").delegate(
 Y.one("#configureClusterAdvancedDynamicRenderDivId").delegate(
   {
     'keyup' : function (e) {
-      configureServicesUtil.clearErrorReason('#' + e.target.get('id'));
-      configureServicesUtil.updateServiceErrorCount(e.target.get('name'));
+      App.ui.configureServicesUtil.clearErrorReason('#' + e.target.get('id'));
+      App.ui.configureServicesUtil.updateServiceErrorCount(e.target.get('name'));
     }
   },
   "input[type=text],input[type=password]:not(.retypePassword)"
 );
 
 function renderConfigureServicesInternal (optionsInfo) {
-  Y.one("#configureClusterAdvancedDynamicRenderDivId").setContent(configureServicesUtil.getOptionsSummaryMarkup(optionsInfo, false));
+  Y.one("#configureClusterAdvancedDynamicRenderDivId").setContent(App.ui.configureServicesUtil.getOptionsSummaryMarkup(optionsInfo, false));
   $('#configureServicesTabs a:first').tab('show');
   Y.one("#configureClusterAdvancedCoreDivId").show();
   Y.one('#configureClusterAdvancedSubmitButtonId').simulate('click');  
-  hideLoadingImg();
+  App.ui.hideLoadingOverlay();
 }
 
 function renderOptionsPage (optionsInfo) {
-  globalOptionsInfo = optionsInfo;
+  App.props.clusterName = optionsInfo.clusterName;
   var inputUrl = "../php/frontend/fetchClusterServices.php?clusterName=" + optionsInfo.clusterName + "&getConfigs=true";
   executeStage(inputUrl, renderConfigureServicesInternal);
 }

+ 361 - 281
hmc/js/configureServicesUtils.js

@@ -19,307 +19,387 @@
  *
 */
 
-function ConfigureServicesUtil() {
-
-  var passwordsArray = [];
-  
-  function generateDivForService (option, type, service, property, unit, displayAttributes, isReconfigure) {
-  	
-    var unitClass = (unit != null) ? 'unit' : '';
-    var unitLabel = (unit != null && unit != 'int') ? unit : '';
-    
-    // default: if this is reconfiguration, default to NOT editable
-    // if this is not reconfiguration (original config), default to editable
-    var readOnlyFlag = isReconfigure;
-    
-    if (displayAttributes != null) {
-      if (isReconfigure && displayAttributes.reconfigurable != null && displayAttributes.reconfigurable) {
-        readOnlyFlag = false;
-      } else if (!isReconfigure && displayAttributes.editable != null && !displayAttributes.editable) {
-        readOnlyFlag = true;
+(function() {
+  function ConfigureServicesUtil() {
+
+    var passwordsArray = [];
+
+    function generateDivForService (option, type, service, property, unit, displayAttributes, isReconfigure) {
+
+      var unitClass = (unit != null) ? 'unit' : '';
+      var unitLabel = (unit != null && unit != 'int') ? unit : '';
+
+      // default: if this is reconfiguration, default to NOT editable
+      // if this is not reconfiguration (original config), default to editable
+      var readOnlyFlag = isReconfigure;
+
+      if (displayAttributes != null) {
+        if (isReconfigure && displayAttributes.reconfigurable != null && displayAttributes.reconfigurable) {
+          readOnlyFlag = false;
+        } else if (!isReconfigure && displayAttributes.editable != null && !displayAttributes.editable) {
+          readOnlyFlag = true;
+        }
       }
-    }
-    
-    var checked = (type === 'checkbox' && option.value === 'true') ? 'checked' : '';
-  
-    var retString = '<div class="formElement">' +
-      '<label for="' + service + '">' + option.displayName + '</label>' +
-      '<input class="' + unitClass + '" type="' + type + '" id="' + property + '" name="' + service + '" value="' + option.value + '" ' + checked;
-    if (readOnlyFlag) {
-      retString += ' readonly="readonly" ';
-    }
-  
-    retString += '><label class="unit">' + unitLabel + '</label>' + 
-      '<div class="contextualHelp">' + option.description + '</div>' +
-      '<div class="formInputErrorReason" id="' + property + 'ErrorReason' + '" style="display:none"></div>' +
-      '</div>';
-    if (type == "password" && !isReconfigure) {
-      retString += '<div class="formElement">' +
-        '<label for="' + service + '"> Retype ' + option.displayName + '</label>' +
-        '<input type="' + type + '" id="' + property + 'SecretService" class="retypePassword" name="' + service + '" value="' + option.value + '">' +
+
+      var checked = (type === 'checkbox' && option.value === 'true') ? 'checked' : '';
+
+      var retString = '<div class="formElement">' +
+        '<label for="' + service + '">' + option.displayName + '</label>' +
+        '<input class="' + unitClass + '" type="' + type + '" id="' + property + '" name="' + service + '" value="' + option.value + '" ' + checked;
+      if (readOnlyFlag) {
+        retString += ' readonly="readonly" ';
+      }
+
+      retString += '><label class="unit">' + unitLabel + '</label>' +
         '<div class="contextualHelp">' + option.description + '</div>' +
-        '<div class="formInputErrorReason" id="' + property + 'SecretServiceErrorReason' + '" style="display:none"></div>' +
+        '<div class="formInputErrorReason" id="' + property + 'ErrorReason' + '" style="display:none"></div>' +
         '</div>';
-  
-      /// Put it in the global passwd array
-      passwordsArray[passwordsArray.length] = {
-        "passwordDivId"     : property,
-        "verificationDivId" : property + 'SecretService'
-      };
-      // Y.log("Global Passwords Array: " + Y.Lang.dump(passwordsArray));
-  
+      if (type == "password" && !isReconfigure) {
+        retString += '<div class="formElement">' +
+          '<label for="' + service + '"> Retype ' + option.displayName + '</label>' +
+          '<input type="' + type + '" id="' + property + 'SecretService" class="retypePassword" name="' + service + '" value="' + option.value + '">' +
+          '<div class="contextualHelp">' + option.description + '</div>' +
+          '<div class="formInputErrorReason" id="' + property + 'SecretServiceErrorReason' + '" style="display:none"></div>' +
+          '</div>';
+
+        /// Put it in the global passwd array
+        passwordsArray[passwordsArray.length] = {
+          "passwordDivId"     : property,
+          "verificationDivId" : property + 'SecretService'
+        };
+        // Y.log("Global Passwords Array: " + Y.Lang.dump(passwordsArray));
+
+      }
+      return retString;
     }
-    return retString;
-  }
-  
-  /**
-   * isReconfigure: true if this is for reconfiguring parameters on services; false if this is on "Advanced Config" page
-   */
-  this.getOptionsSummaryMarkup = function(optionsInfo, isReconfigure) {
-    /* Reset passwordsArray at the beginning of each render cycle to
-     * avoid using stale data from the last run - this isn't a problem on the
-     * Configure Services page, but it bites us on the Manage Services page
-     * there is re-use of this module of code within the same JS memory.
+
+    /**
+     * isReconfigure: true if this is for reconfiguring parameters on services; false if this is on "Advanced Config" page
      */
-    passwordsArray = [];
-    var tabs = '<ul id="configureServicesTabs" class="nav nav-tabs">';
-    var optionsSummary = (isReconfigure) ? '<div>': '<div class="tab-content">';
-
-    var setServiceMarkup = function(service) {
-      if (service.isEnabled === '1') {
-        var serviceNeedsRender = false;
-        var propertiesMarkup = "";
-        for (var property in service.properties) {
-          // service has configs, so needs render
-          var type = convertDisplayType(service.properties[property].type);
-          // Y.log("TYPE: " + type + "Property: " + property);
-          if (type === "NODISPLAY") {
-              continue;
+    this.getOptionsSummaryMarkup = function(optionsInfo, isReconfigure) {
+      /* Reset passwordsArray at the beginning of each render cycle to
+       * avoid using stale data from the last run
+       */
+      passwordsArray = [];
+      var tabs = '<ul id="configureServicesTabs" class="nav nav-tabs">';
+      var optionsSummary = (isReconfigure) ? '<div>': '<div class="tab-content">';
+
+      var setServiceMarkup = function(service) {
+        if (service.isEnabled === '1') {
+          var serviceNeedsRender = false;
+          var propertiesMarkup = "";
+          for (var property in service.properties) {
+            // service has configs, so needs render
+            var type = convertDisplayType(service.properties[property].type);
+            // Y.log("TYPE: " + type + "Property: " + property);
+            if (type === "NODISPLAY") {
+                continue;
+            }
+            serviceNeedsRender = true;
+            var unit = service.properties[property].unit;
+            var displayAttributes = null;
+            if (service.properties[property].displayAttributes) {
+               displayAttributes = service.properties[property].displayAttributes;
+            }
+
+            propertiesMarkup += generateDivForService(service.properties[property], type, service.serviceName, property, unit, displayAttributes, isReconfigure);
           }
-          serviceNeedsRender = true;
-          var unit = service.properties[property].unit;
-          var displayAttributes = null;
-          if (service.properties[property].displayAttributes) {
-             displayAttributes = service.properties[property].displayAttributes;
+          if (serviceNeedsRender) {
+            tabs += '<li><a data-toggle="tab" href="#' + service.serviceName + '">' + service.displayName + '<span id="' + service.serviceName + 'ErrorCount" class="serviceErrorCount"></span></a></li>';
+            // optionsSummary += "<fieldset> <legend>" + service.serviceName + "</legend>";
+            optionsSummary += '<div class="tab-pane" name=\"configureClusterAdvancedPerServiceDiv\" id=\"' + service.serviceName + '\">';
+            optionsSummary += propertiesMarkup;
+            // optionsSummary += '</fieldset></div>';
+            optionsSummary += '</div>';
           }
-  
-          propertiesMarkup += generateDivForService(service.properties[property], type, service.serviceName, property, unit, displayAttributes, isReconfigure);
         }
-        if (serviceNeedsRender) {
-          tabs += '<li><a data-toggle="tab" href="#' + service.serviceName + '">' + service.displayName + '<span id="' + service.serviceName + 'ErrorCount" class="serviceErrorCount"></span></a></li>';
-          // optionsSummary += "<fieldset> <legend>" + service.serviceName + "</legend>";
-          optionsSummary += '<div class="tab-pane" name=\"configureClusterAdvancedPerServiceDiv\" id=\"' + service.serviceName + '\">';
-          optionsSummary += propertiesMarkup;
-          // optionsSummary += '</fieldset></div>';
-          optionsSummary += '</div>';
+      };
+
+      if (optionsInfo.services.NAGIOS !== undefined) {
+        setServiceMarkup(optionsInfo.services.NAGIOS);
+      }
+      if (optionsInfo.services.HIVE !== undefined) {
+        setServiceMarkup(optionsInfo.services.HIVE);
+      }
+
+      for (var servicesKey in optionsInfo.services) {
+        if (servicesKey !== 'NAGIOS' && servicesKey !== 'HIVE') {
+          setServiceMarkup(optionsInfo.services[servicesKey]);
         }
       }
-    };    
 
-    if (optionsInfo.services.NAGIOS !== undefined) {
-      setServiceMarkup(optionsInfo.services.NAGIOS);
-    }
-    if (optionsInfo.services.HIVE !== undefined) {
-      setServiceMarkup(optionsInfo.services.HIVE);
-    }
+      tabs += '</ul>';
+      optionsSummary += '</div>';
+      return (isReconfigure) ? optionsSummary : tabs + optionsSummary;
+    };
 
-    for (var servicesKey in optionsInfo.services) {
-      if (servicesKey !== 'NAGIOS' && servicesKey !== 'HIVE') {
-        setServiceMarkup(optionsInfo.services[servicesKey]);  
-      }      
-    }
-    
-    tabs += '</ul>';
-    optionsSummary += '</div>';
-    return (isReconfigure) ? optionsSummary : tabs + optionsSummary;
-  };
-  
-  
-  /////////////////// End of rendering related functions /////////////////////////////
-  
-  /////////////////// Submit related functions /////////////////////////////
-    
-  this.clearPasswordErrors = function () {
-    for (var count = 0; count < passwordsArray.length; count++) {
-      divId = "#" + passwordsArray[count]['verificationDivId'];
-      this.clearErrorReason(divId);
-    }
-  };
-  
-  this.clearErrorReasons = function (opts) {
-    for(serviceName in opts) {
-      for (propKey in opts[serviceName]['properties']) {
-        this.clearErrorReason('#' + propKey);
+
+    /////////////////// End of rendering related functions /////////////////////////////
+
+    /////////////////// Submit related functions /////////////////////////////
+
+    this.clearPasswordErrors = function () {
+      for (var count = 0; count < passwordsArray.length; count++) {
+        divId = "#" + passwordsArray[count]['verificationDivId'];
+        this.clearErrorReason(divId);
       }
-    }
-    // clear the error count displayed in all service tabs
-    Y.all('.serviceErrorCount').setContent('');
-  };
-  
-  this.setErrorReason = function(fieldDivId, errorReason) {
-    Y.one(fieldDivId).addClass('formInputError');
-    errorDivId = fieldDivId + 'ErrorReason';
-    Y.one(errorDivId).setContent(errorReason);
-    Y.one(errorDivId).show();
-  };
-  
-  this.clearErrorReason = function(fieldDivId) {
-    Y.one(fieldDivId).removeClass('formInputError');
-    errorDivId = fieldDivId + 'ErrorReason';
-    Y.one(errorDivId).setContent('');
-    Y.one(errorDivId).hide();
-  };
-  
-  this.checkPasswordCorrectness = function () {
-    var count = 0;
-    var focusId = '';
-    var passwdMatch = true;
-    var errCount = 0;
-    var errString = ''; //"<ul>";
-  
-    for (count = 0; count < passwordsArray.length; count++) {
-      var divId = "#" + passwordsArray[count]['passwordDivId'];
-      var passwd = Y.one(divId).get('value');
-      divId = "#" + passwordsArray[count]['verificationDivId'];
-      var verifyPasswd = Y.one(divId).get('value');
-  
-      if (passwd !== verifyPasswd) {
-        errCount++;
-        errString = "Password does not match";
-        this.setErrorReason(divId, errString);
-        if (focusId === '') {
-          focusId = divId;
+    };
+
+    this.clearErrorReasons = function (opts) {
+      for (serviceName in opts) {
+        for (propKey in opts[serviceName]['properties']) {
+          this.clearErrorReason('#' + propKey);
         }
-        passwdMatch = false;
-      } else {
-        this.clearErrorReason(divId, '');
       }
-    }
-  
-    errString += ''; //"</ul>";
-  
-    retArray = {
-      "passwdMatched" : passwdMatch,
-      "focusOn"       : focusId,
-      "errorCount"    : errCount,
-      "errorString"   : errString
+      // clear the error count displayed in all service tabs
+      Y.all('.serviceErrorCount').setContent('');
     };
-  
-    return retArray;
-  };
-  
-  this.generateUserOpts = function () {
-   
-    var desiredOptions = {};
-  
-    var temp = Y.all("#configureClusterAdvancedDynamicRenderDivId div[name=configureClusterAdvancedPerServiceDiv]");
-    temp.each(function (selection) {
-  
-      var selectionStr = "#configureClusterAdvancedDynamicRenderDivId input[name=" + selection.get('id') + "]";
-      var prop = Y.all(selectionStr);
-      var properties = {};
-      prop.each(function (proper) {
-        for (var i = 0; i < passwordsArray.length; i++) {
-          if (proper.get('id') == passwordsArray[i]['verificationDivId']) {
-            return;
+
+    this.setErrorReason = function(fieldDivId, errorReason) {
+      Y.one(fieldDivId).addClass('formInputError');
+      errorDivId = fieldDivId + 'ErrorReason';
+      Y.one(errorDivId).setContent(errorReason);
+      Y.one(errorDivId).show();
+    };
+
+    this.clearErrorReason = function(fieldDivId) {
+      Y.one(fieldDivId).removeClass('formInputError');
+      errorDivId = fieldDivId + 'ErrorReason';
+      Y.one(errorDivId).setContent('');
+      Y.one(errorDivId).hide();
+    };
+
+    this.checkPasswordCorrectness = function () {
+      var count = 0;
+      var focusId = '';
+      var passwdMatch = true;
+      var errCount = 0;
+      var errString = ''; //"<ul>";
+
+      for (count = 0; count < passwordsArray.length; count++) {
+        var divId = "#" + passwordsArray[count]['passwordDivId'];
+        var passwd = Y.one(divId).get('value');
+        divId = "#" + passwordsArray[count]['verificationDivId'];
+        var verifyPasswd = Y.one(divId).get('value');
+
+        if (passwd !== verifyPasswd) {
+          errCount++;
+          errString = "Password does not match";
+          this.setErrorReason(divId, errString);
+          if (focusId === '') {
+            focusId = divId;
           }
+          passwdMatch = false;
+        } else {
+          this.clearErrorReason(divId, '');
         }
- 
-        var value = Y.Lang.trim(proper.get('value'));
-        if ((proper.get('type') == "checkbox")) {
-          value = proper.get('checked').toString();
-        }
-  
-        var keyName = Y.Lang.trim(proper.get('id'));
-        properties[keyName] = {
-        "value" : value,
-        };
-  
-     });
-  
-      desiredOptions[selection.get('id')] = {
-      "properties" : properties,
+      }
+
+      errString += ''; //"</ul>";
+
+      retArray = {
+        "passwdMatched" : passwdMatch,
+        "focusOn"       : focusId,
+        "errorCount"    : errCount,
+        "errorString"   : errString
       };
-  
-    });
-  
-    clearFormStatus();
-    this.clearErrorReasons(desiredOptions);
-  
-    return desiredOptions;
-  };
-  
-  // update the error count displayed in the tab for the specified service.
-  // also toggle the disabled status of the submit button.
-  this.updateServiceErrorCount = function (serviceName) {
-    var errorCount = 0;
-    var serviceDivId = '#' + serviceName;
-    var serviceDiv = Y.one(serviceDivId);
-    var errorFields = serviceDiv.all('.formInputErrorReason');
-    errorFields.each(function (errorField) {
-      if (errorField.getStyle('display') !== 'none') {
-        errorCount++;
+
+      return retArray;
+    };
+
+    this.generateUserOpts = function () {
+
+      var desiredOptions = {};
+
+      var temp = Y.all("#configureClusterAdvancedDynamicRenderDivId div[name=configureClusterAdvancedPerServiceDiv]");
+      temp.each(function (selection) {
+
+        var selectionStr = "#configureClusterAdvancedDynamicRenderDivId input[name=" + selection.get('id') + "]";
+        var prop = Y.all(selectionStr);
+        var properties = {};
+        prop.each(function (proper) {
+          for (var i = 0; i < passwordsArray.length; i++) {
+            if (proper.get('id') == passwordsArray[i]['verificationDivId']) {
+              return;
+            }
+          }
+
+          var value = Y.Lang.trim(proper.get('value'));
+          if ((proper.get('type') == "checkbox")) {
+            value = proper.get('checked').toString();
+          }
+
+          var keyName = Y.Lang.trim(proper.get('id'));
+          properties[keyName] = {
+          "value" : value
+          };
+
+       });
+
+        desiredOptions[selection.get('id')] = {
+        "properties" : properties
+        };
+
+      });
+
+      clearFormStatus();
+      this.clearErrorReasons(desiredOptions);
+
+      return desiredOptions;
+    };
+
+    // update the error count displayed in the tab for the specified service.
+    // also toggle the disabled status of the submit button.
+    this.updateServiceErrorCount = function (serviceName) {
+      var errorCount = 0;
+      var serviceDivId = '#' + serviceName;
+      var serviceDiv = Y.one(serviceDivId);
+      var errorFields = serviceDiv.all('.formInputErrorReason');
+      errorFields.each(function (errorField) {
+        if (errorField.getStyle('display') !== 'none') {
+          errorCount++;
+        }
+      });
+
+      var submitButton = Y.one('#configureClusterAdvancedSubmitButtonId');
+
+      if (errorCount > 0) {
+        Y.one(serviceDivId + 'ErrorCount').setContent('<span style="margin-left:4px" class="badge badge-important">' + errorCount + '</span>');
+        // there is at least one error.  disable the submit button
+        submitButton.addClass('disabled');
+      } else {
+        Y.one(serviceDivId + 'ErrorCount').setContent('');
+        // if no errors at all, enable the submit button and clear error message at the top
+        if (this.getTotalErrorCount() === 0) {
+          submitButton.removeClass('disabled');
+          clearFormStatus();
+        }
       }
-    });
-    
-    var submitButton = Y.one('#configureClusterAdvancedSubmitButtonId');
-
-    if (errorCount > 0) {
-      Y.one(serviceDivId + 'ErrorCount').setContent('<span style="margin-left:4px" class="badge badge-important">' + errorCount + '</span>');
-      // there is at least one error.  disable the submit button      
-      submitButton.addClass('disabled');
-    } else {
-      Y.one(serviceDivId + 'ErrorCount').setContent('');
-      // if no errors at all, enable the submit button and clear error message at the top
-      if (this.getTotalErrorCount() === 0) { 
-        submitButton.removeClass('disabled');
-        clearFormStatus();
+    };
+
+    this.getTotalErrorCount = function () {
+      var totalErrorCount = 0;
+      var tabsDiv = Y.one('#configureServicesTabs');
+      var errorCountBadges = tabsDiv.all('span.badge');
+      errorCountBadges.each(function (errorCountBadge) {
+        totalErrorCount += parseInt(errorCountBadge.getHTML(), 10);
+      });
+      return totalErrorCount;
+    };
+
+    this.handleConfigureServiceErrors = function (errorResponse) {
+      var errorCounts = {};
+      var message = errorResponse.error;
+      var serviceName = '';
+      setFormStatus(message, true, true);
+      for (propKey in errorResponse.properties)  {
+        var errorReason = errorResponse.properties[propKey].error;
+        var propDom = Y.one('#' + propKey);
+        serviceName = propDom.get('name');
+        if (errorCounts[serviceName] == null) {
+          errorCounts[serviceName] = 1;
+        } else {
+          errorCounts[serviceName] += 1;
+        }
+
+        this.setErrorReason('#' + propKey, errorReason);
       }
-    }
-  };
-  
-  this.getTotalErrorCount = function () {
-    var totalErrorCount = 0;
-    var tabsDiv = Y.one('#configureServicesTabs');
-    var errorCountBadges = tabsDiv.all('span.badge');
-    errorCountBadges.each(function (errorCountBadge) {
-      totalErrorCount += parseInt(errorCountBadge.getHTML(), 10);
-    });
-    return totalErrorCount;
-  };
-  
-  this.handleConfigureServiceErrors = function (errorResponse) {
-    var errorCounts = {};
-    var message = errorResponse.error;
-    var serviceName = '';
-    setFormStatus(message, true, true);
-    for (propKey in errorResponse.properties)  {
-      var errorReason = errorResponse.properties[propKey].error;
-      var propDom = Y.one('#' + propKey);
-      serviceName = propDom.get('name');
-      if (errorCounts[serviceName] == null) {
-        errorCounts[serviceName] = 1;
-      } else {
-        errorCounts[serviceName] += 1;
+
+      var firstServiceName = null;
+      // show error counts in the tab for each service that had errors
+      for (serviceName in errorCounts) {
+        if (firstServiceName === null) {
+          firstServiceName = serviceName;
+        }
+        this.updateServiceErrorCount(serviceName, errorCounts[serviceName]);
       }
-    
-      this.setErrorReason('#' + propKey, errorReason);
-    }
-    
-    var firstServiceName = null;
-    // show error counts in the tab for each service that had errors
-    for (serviceName in errorCounts) {
-      if (firstServiceName === null) {
-        firstServiceName = serviceName;
+      // open the first tab that has an error
+      $('#configureServicesTabs a[href="#' + firstServiceName + '"]').tab('show');
+
+      Y.one('#formStatusDivId').scrollIntoView();
+
+    }.bind(this);
+
+    this.getDeploySummaryMarkup = function (deployInfo) {
+      var deploySummary = "";
+
+      var unit, unitClass, unitLabel;
+
+      for (var serviceName in deployInfo.services) {
+        var serviceHasToBeRendered = false;
+        var masterSummary = "";
+        var propertySummary = "";
+
+        if (deployInfo.services.hasOwnProperty( serviceName )) {
+
+          var perServiceInfo = deployInfo.services[serviceName];
+
+          var configElementName = serviceName;
+          var configElementIdName = configElementName + 'Id';
+
+          if (perServiceInfo.isEnabled == false) {
+            continue;
+          }
+
+          // Render all master components
+          for (var componentIndex in perServiceInfo.components) {
+            if (!perServiceInfo.components[componentIndex].isMaster) {
+              continue;
+            }
+            var component = perServiceInfo.components[componentIndex];
+            serviceHasToBeRendered = true;
+            masterSummary += '<div class="formElement">' +
+              '<label for=' + component.componentName + 'Id>' + component.displayName + '&nbsp; : &nbsp;</label>' +
+              '<input type=text name=' + component.componentName + 'Name id=' + component.componentName + 'Id readonly=readonly value=\"' + component.hostNames.join(',') + '\">' +
+              '</div>';
+          }
+
+          for (var mPropertiesKey in perServiceInfo.properties) {
+            if (perServiceInfo.properties[mPropertiesKey].type == "NODISPLAY") {
+              continue;
+            }
+            serviceHasToBeRendered = true;
+
+            var readOnlyAttr = 'readonly=readonly';
+            var valueAttr = 'value=\"' + perServiceInfo.properties[mPropertiesKey].value + '\"';
+            var type = convertDisplayType(perServiceInfo.properties[mPropertiesKey].type);
+            if (type == "checkbox") {
+              readOnlyAttr = 'disabled="disabled"';
+              var checkVal = perServiceInfo.properties[mPropertiesKey].value;
+              if (checkVal == 'true') {
+                valueAttr = 'checked=yes';
+              } else {
+                valueAttr = '';
+              }
+            }
+
+            unit = perServiceInfo.properties[mPropertiesKey].unit;
+            unitClass = (unit != null) ? 'unit' : '';
+            unitLabel = (unit != null && unit != 'int') ? unit : '';
+
+            propertySummary += '<div class="formElement">' +
+              '<label for=' + mPropertiesKey  + 'Id>' + perServiceInfo.properties[mPropertiesKey].displayName + '</label>' +
+              '<input class="' + unitClass + '" type=' + type + ' name=' + mPropertiesKey + 'Name id=' + mPropertiesKey + 'Id ' + readOnlyAttr + ' ' + valueAttr + '>' +
+              '<label class="unit">' + unitLabel + '</label>' +
+              '</div>';
+          }
+        }
+
+        if (serviceHasToBeRendered) {
+          deploySummary += '<fieldset>' + '<legend>' + perServiceInfo.displayName + '</legend>';
+          deploySummary += masterSummary;
+          deploySummary += propertySummary;
+          deploySummary += '</fieldset><br/>';
+        }
       }
-      this.updateServiceErrorCount(serviceName, errorCounts[serviceName]);
-    }
-    // open the first tab that has an error
-    $('#configureServicesTabs a[href="#' + firstServiceName + '"]').tab('show');
-    
-    Y.one('#formStatusDivId').scrollIntoView();
-    
-  }.bind(this);
-};
-
-var configureServicesUtil = new ConfigureServicesUtil();
+
+      return deploySummary;
+
+    };
+
+  };
+
+  // export
+  App.ui.configureServicesUtil = new ConfigureServicesUtil();
+})();
+

+ 3 - 3
hmc/js/deployProgress.js

@@ -33,9 +33,9 @@ renderDeployProgress = function (context) {
   var hmcRestartMsg = '';
   if (context.nagiosGangliaCoHosted != null && context.nagiosGangliaCoHosted) {
     hmcRestartMsg = '<span style="color:red"><strong>Note:</strong> You need to restart '
-      + App.Props.managerServiceName + ' as Nagios/Ganglia are co-hosted on this server.<br>Restart '
-      + App.Props.managerServiceName + ' by executing <i>sudo service ' + App.Props.managerServiceName.toLowerCase()
-      + ' restart</i> from the command line.</span><br>After that is done, ';
+      + App.props.managerServiceName + ' as Nagios/Ganglia are co-hosted on this server.<br>Restart '
+      + App.props.managerServiceName + ' by executing <i>sudo service ' + App.props.managerServiceName.toLowerCase()
+      + ' restart</i> from the shell.</span><br>After that is done, ';
   } else {
     hmcRestartMsg = 'Please ';
   }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 33 - 0
hmc/js/ext/sinon.min.js


+ 3 - 3
hmc/js/manageServices.js

@@ -215,7 +215,7 @@ function setupReconfigureScreens(serviceName) {
     action: function (e) {
       e.preventDefault();
 
-      localReconfigureServiceData = configureServicesUtil.generateUserOpts();
+      localReconfigureServiceData = App.ui.configureServicesUtil.generateUserOpts();
       var remoteProps = remoteReconfigureServiceData.services[serviceName].properties;
       var localProps = localReconfigureServiceData[serviceName].properties;
       var allEqual = true;
@@ -271,7 +271,7 @@ function setupReconfigureScreens(serviceName) {
     // Store the remote data
     remoteReconfigureServiceData = serviceConfigurationData;
 
-    var serviceConfigurationMarkup = configureServicesUtil.getOptionsSummaryMarkup(serviceConfigurationData, true);
+    var serviceConfigurationMarkup = App.ui.configureServicesUtil.getOptionsSummaryMarkup(serviceConfigurationData, true);
 
     if( globalYui.Lang.trim( serviceConfigurationMarkup).length == 0 ) {
       serviceConfigurationMarkup = '<p>There is nothing to reconfigure for this service.</p>';
@@ -369,7 +369,7 @@ function performServiceManagement( action, serviceName, confirmationDataPanel )
             hidePanel(function() {
               setupReconfigureFirstScreen(serviceName);
               showPanel( function() {
-                configureServicesUtil.handleConfigureServiceErrors( manageServicesResponseJson );
+                App.ui.configureServicesUtil.handleConfigureServiceErrors( manageServicesResponseJson );
             });
           });
           } else {

+ 1 - 0
hmc/js/txnUtils.js

@@ -425,6 +425,7 @@ App.ui.TxnProgressWidget = function (config) {
     Y.one("#txnProgressHeader").setContent(config.title);
     Y.one('#blackScreenDivId').show();
     Y.one('#txnProgressCoreDivId').show();
+    Y.one('#txnProgressBox').scrollIntoView();
 
     periodicDataPoller.start();
   };

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 68 - 0
hmc/js/upgradeStack/deploy.js


+ 74 - 0
hmc/js/upgradeStack/reconfigure.js

@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+(function() {
+
+  // initiates uninstall of stack and shows progress widget
+  function reconfigureStack() {
+    $.ajax({
+      type: 'POST',
+      url: '/hmc/php/frontend/uninstall.php?clusterName=' + App.props.clusterName +
+        '&action=uninstall&clusterDeployUser=root',
+      data: {},
+      timeout: App.io.DEFAULT_AJAX_TIMEOUT_MS,
+      success: function (data) {
+        redirectToDeploy(data.response);
+      },
+      error: function () {
+        alert(App.io.DEFAULT_AJAX_ERROR_MESSAGE);
+      }
+    });
+  }
+
+  function redirectToDeploy(response) {
+    document.location.href = 'deploy.php';
+  }
+
+  function renderPage(data) {
+    $('#configureClusterAdvancedDynamicRenderDivId').html(App.ui.configureServicesUtil.getOptionsSummaryMarkup(data, false));
+    $('#configureServicesTabs a:first').tab('show');
+    $('#configureClusterAdvancedCoreDivId').show();
+    App.ui.hideLoadingOverlay();
+  }
+
+  // render the page
+  $.ajax({
+    type: 'GET',
+    url: '/hmc/php/frontend/fetchClusterServices.php?clusterName=' + App.props.clusterName + '&getConfigs=true',
+    data: {},
+    timeout: App.io.DEFAULT_AJAX_TIMEOUT_MS,
+    success: function (data) {
+      renderPage(data.response);
+    },
+    error: function (data) {
+      alert(App.io.DEFAULT_AJAX_ERROR_MESSAGE);
+    }
+  });
+
+  $('#reconfigureSubmitButton').click(function() {
+    App.ui.showLoadingOverlay();
+    reconfigureStack();
+  });
+
+})();
+
+

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 68 - 0
hmc/js/upgradeStack/uninstall.js


+ 9 - 10
hmc/js/utils.js

@@ -162,14 +162,6 @@ function setFormStatus(statusString, isError, noFade) {
   formStatusDiv.addClass("formStatusBar");
   formStatusDiv.addClass(formStatusDivCssClass);
   formStatusDiv.setContent(statusString);
-  if (!isError && !noFade) {
-    //setTimeout(fadeFormStatus, 1000);
-  }
-}
-
-function fadeFormStatus() {
-  var formStatusDiv = Y.one("#formStatusDivId");
-  formStatusDiv.addClass("formStatusBarZeroOpacity");
 }
 
 function convertDisplayType(displayType) {
@@ -418,7 +410,8 @@ function titleCase(word) {
 // Create namespace and export functionality.
 // We'll remove globally defined functions and properties eventually
 // For now we need to keep the non-namespaced global functions and properties
-// so that our existing code continues to work without refactoring.
+// so that our existing code continues to work without major refactoring.
+
 var App = App || {
   props: {
     managerServiceName: 'Ambari',
@@ -433,8 +426,14 @@ var App = App || {
   },
   ui: {
     createInfoPanel: createInfoPanel,
+    showLoadingOverlay: showLoadingImg,
     hideLoadingOverlay: hideLoadingImg
   }
 };
 
-App.Props = App.props;
+// On some pages the clusterName global variable is set before
+// this file is loaded.  Remember it in the App namespace.
+if (typeof clusterName !== 'undefined') {
+  App.props.clusterName = clusterName;
+}
+

+ 1 - 0
hmc/php/conf/Config.inc

@@ -39,6 +39,7 @@ $GLOBALS["manifestloaderDir"] = "/etc/puppet/master/manifestloader";
 $GLOBALS["manifestloaderDestinationDir"] = "/etc/puppet/master/manifests";
 $GLOBALS["puppet_install"] = "/usr/share/hmc/ShellScripts/puppet_agent_install.sh";
 $GLOBALS["DRYRUN"] = FALSE;
+$GLOBALS["BYPASS_ROUTER"] = FALSE;
 
 $GLOBALS["HMC_LOG_DIR"] = "/var/log/hmc";
 $GLOBALS["HMC_LOG_LEVEL"] = HMCLogger::INFO;

+ 13 - 0
hmc/php/conf/MessageResources-en.inc

@@ -77,4 +77,17 @@ $RES['uninstallWizard.pageSummary.body']="<span class='label label-important'>Wa
 $RES['uninstallWizard.wipeout.label']="Perform wipe out (delete all data)";
 $RES['uninstallWizard.submit.label']="Uninstall Cluster";
 $RES['initWizard.configureClusterAdvanced.validation.error']="We've encountered invalid settings.";
+$RES['upgradeStack.index.pageSummary.header']="Upgrade Your Hadoop Services";
+$RES['upgradeStack.index.pageSummary.body']="You have a pending upgrade of your Hadoop services.  You must complete the upgrade before you can continue.<br>We will walk you through the upgrade process with a step-by-step wizard.";
+$RES['upgradeStack.index.submit.label']="Get Started";
+$RES['upgradeStack.uninstall.pageSummary.header']="Upgrade Step 1 - Uninstall Existing Hadoop Services";
+$RES['upgradeStack.uninstall.pageSummary.body']="First, we will uninstall the existing Hadoop services before we install the new version.  This will not delete your data.";
+$RES['upgradeStack.uninstall.submit.label']="Proceed";
+$RES['upgradeStack.reconfigure.pageSummary.header']='Upgrade Step 2 - Reconfigure the Hadoop Services';
+$RES['upgradeStack.reconfigure.pageSummary.body']="Reconfigure your Hadoop services.  Make changes as you see fit.<br>The existing configuration values will automatically carry over.";
+$RES['upgradeStack.reconfigure.submit.label']="Proceed";
+$RES['upgradeStack.deploy.pageSummary.header']='Upgrade Step 3 - Deploy the New Version of the Hadoop Services';
+$RES['upgradeStack.deploy.pageSummary.body']="We are now ready to install the new version of the Hadoop services.  Please review the configuration parameters.<br>If you need to make changes, you can go back to Step 2.";
+$RES['upgradeStack.deploy.backButton.label']="Back to Reconfigure";
+$RES['upgradeStack.deploy.submit.label']="Deploy";
 ?>

+ 7 - 1
hmc/php/frontend/configUtils.php

@@ -513,7 +513,13 @@ function sanitizeConfigs($requestObjFromUser, $logger) {
   return $finalProperties;
 }
 
-// Reused in reConfigure
+/**
+ * @param $dbAccessor HMCDBAccessor
+ * @param $logger HMCLogger
+ * @param $clusterName
+ * @param $requestObjFromUser
+ * @return array|mixed
+ */
 function validateAndPersistConfigsFromUser($dbAccessor, $logger, $clusterName, $requestObjFromUser) {
   // sanitize and persist the user entered configs *******
   $finalProperties = sanitizeConfigs($requestObjFromUser, $logger);

+ 1 - 1
hmc/php/util/selectNodes.php

@@ -234,7 +234,7 @@ class SelectNodes {
    * @return Error or not
    *     array("result" => $result, "error" => $error)
    * @param clusterName name of the cluster
-   * @param db the database being used
+   * @param HMCDBAccessor the database being used
    * @param masterToHost the master to Host mapping that the user selected
    *          array("componentName" => hostName")
    */

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio