Преглед изворни кода

AMBARI-361. Display client nodes as part of cluster topology display (Contributed by Yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347033 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K пре 13 година
родитељ
комит
0811c06930
3 измењених фајлова са 21 додато и 17 уклоњено
  1. 2 0
      CHANGES.txt
  2. 8 11
      hmc/css/common.css
  3. 11 6
      hmc/js/clustersList.js

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-361. Display client nodes as part of cluster topology display (Yusaku via Vikram)
+
   AMBARI-360. Adding nodes that already part of the cluster should be avoidable (Vinod via Vikram)
 
   AMBARI-286. Make TxnProgressWidget Immune To Re-Fetch Race Conditions (Varun via Vikram)

+ 8 - 11
hmc/css/common.css

@@ -404,11 +404,6 @@ div.separator {
 	margin-left:165px;
 }
 
-#masterServices ul {
-	font-size:14px;
-	color:#65B642;
-	font-weight:bold;
-}
 /*
 #masterServices label {
 	width:240px;
@@ -449,7 +444,7 @@ div.separator {
 	width:auto;
 	float:left;
 }
-.hostToMasterServices {
+.hostToMasterServices, .hostToClientServices {
     background-color: #F7F7F5;
     border: 2px solid rgba(0, 0, 0, 0.25);
     border-radius: 4px 4px 4px 4px;
@@ -459,21 +454,23 @@ div.separator {
     padding: 10px 20px;
     width:360px;
 }
-.hostToMasterServices > h3 {
+.hostToClientServices {
+	width:90%;
+}
+.hostToMasterServices > h3, .hostToClientServices > h3 {
 	font-size:14px;
 	margin-bottom:4px!important;
 	line-height:14px;
 }
-.hostToMasterServices ul {
+.hostToMasterServices ul, .hostToClientServices ul {
 	margin-left:0;
 	margin-bottom:0;
-	font-size:10px;
 	list-style:none;
 }
-.hostToMasterServices ul:after {
+.hostToMasterServices ul:after, .hostToClientServices ul:after {
 	clear:both;
 }
-.hostToMasterServices li {
+.hostToMasterServices li, .hostToClientServices li {
 	float:left;
 	background-color:#65B642;
 	padding:4px 6px;

+ 11 - 6
hmc/js/clustersList.js

@@ -29,10 +29,8 @@ function generateClusterMastersHostRoleMappingMarkup( clusterServices ) {
 
 function generateClusterClientsHostRoleMappingMarkup( clusterServices ) {
 
-  var clusterClientsHostRoleMappingMarkup = '';
   var finalHostMap = {};
 
-  /*
   for (var serviceName in clusterServices) {
     if (clusterServices.hasOwnProperty(serviceName)) {
 
@@ -54,17 +52,24 @@ function generateClusterClientsHostRoleMappingMarkup( clusterServices ) {
               // FIXME fails to push display name to this array
               globalYui.log("Service component array has " + globalYui.Lang.dump(finalHostMap[serviceComponent.hostName]) + " YYY: " + serviceComponent.hostname);
               globalYui.log("ZZZ is " + globalYui.Lang.dump(finalHostMap));
-              finalHostMap[serviceComponent.hostname].push(serviceComponent.displayName);
+              finalHostMap[serviceComponent.hostName].push(serviceComponent.displayName);
             }
           }
-
         });
       }
     }
   }
-  */
 
-  return clusterClientsHostRoleMappingMarkup;
+  markup = '<div>';
+  for (var hostName in finalHostMap) {
+    markup += '<div class="hostToClientServices"><h3>' + hostName + '</h3>' + '<ul>';
+    for (var service in finalHostMap[hostName]) {
+	  markup += '<li>' + finalHostMap[hostName][service] + '</li>';
+  	}
+  }
+  markup += '</ul><div style="clear:both"></div></div>';
+
+  return markup;
 }
 
 function generateClusterHostRoleMappingMarkup( clusterServices ) {