Browse Source

AMBARI-7532. Slider view: Change additional ganglia clusters format to host:port - UI fixes (srimanth)

Srimanth Gunturi 10 years ago
parent
commit
f1557e8f7f

+ 5 - 6
contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js

@@ -88,15 +88,14 @@ App.SliderController = Ember.Controller.extend({
     var gangliaCustomClusters = [];
     var gangliaCustomClusters = [];
     //parse CSV string with cluster names and ports
     //parse CSV string with cluster names and ports
     if (!Em.isNone(prop)) {
     if (!Em.isNone(prop)) {
-      prop.replace(/\'/g, "").split(',').forEach(function(item, index){
-        if (index % 2 === 0) {
+      prop.replace(/\'/g, "").split(',').forEach(function(item){
+        var splits = item.split(':');
+        if (splits.length > 1) {
           gangliaCustomClusters.push({
           gangliaCustomClusters.push({
-            name: item
+            name: splits[0],
+            port: splits[1]
           })
           })
         }
         }
-        else {
-          gangliaCustomClusters[gangliaCustomClusters.length - 1].port = parseInt(item);
-        }
       });
       });
     }
     }
     return gangliaCustomClusters;
     return gangliaCustomClusters;

+ 1 - 1
contrib/views/slider/src/main/resources/view.xml

@@ -50,7 +50,7 @@ limitations under the License. Kerberos, LDAP, Custom. Binary/Htt
   </parameter>
   </parameter>
   <parameter>
   <parameter>
     <name>ganglia.custom.clusters</name>
     <name>ganglia.custom.clusters</name>
-    <description>Custom Ganglia clusters which can be used by applications created in Slider Apps view. Value is comma separated list of cluster-name and port pairs. Typically this is the ganglia_custom_clusters in the ganglia-env configuration. For example: Application1,8881,Application2,8882</description>
+    <description>Custom Ganglia clusters which can be used by applications created in Slider Apps view. Value is comma separated list of cluster-name and port pairs. Typically this is the additional_clusters in the ganglia-env configuration. For example: Application1:8881,Application2:8882</description>
     <required>false</required>
     <required>false</required>
   </parameter>
   </parameter>
   <parameter>
   <parameter>