You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2015/04/10 03:59:38 UTC

ambari git commit: AMBARI-10392. Create HDFS theme for enhanced configs (Richard Zang via srimanth)

Repository: ambari
Updated Branches:
  refs/heads/trunk 8b9637611 -> 76dc6034f


AMBARI-10392. Create HDFS theme for enhanced configs (Richard Zang via srimanth)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/76dc6034
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/76dc6034
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/76dc6034

Branch: refs/heads/trunk
Commit: 76dc6034fbc424b92555b8c25f1930aef80e91cf
Parents: 8b96376
Author: Srimanth Gunturi <sg...@hortonworks.com>
Authored: Thu Apr 9 18:58:15 2015 -0700
Committer: Srimanth Gunturi <sg...@hortonworks.com>
Committed: Thu Apr 9 18:58:15 2015 -0700

----------------------------------------------------------------------
 .../stacks/HDP/2.2/services/HDFS/metainfo.xml   |   7 +-
 .../HDP/2.2/services/HDFS/themes/theme.json     | 266 +++++++++++++++++++
 .../widgets/toggle_config_widget_view.js        |  24 +-
 3 files changed, 285 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/76dc6034/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
index f281db7..ecd8ae8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/metainfo.xml
@@ -90,7 +90,12 @@
           </packages>
         </osSpecific>
       </osSpecifics>
-
+      <themes>
+          <theme>
+              <fileName>theme.json</fileName>
+              <default>true</default>
+          </theme>
+      </themes>
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/76dc6034/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/themes/theme.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/themes/theme.json b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/themes/theme.json
new file mode 100644
index 0000000..e55d1d4
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/themes/theme.json
@@ -0,0 +1,266 @@
+{
+  "Theme": {
+    "name": "default",
+    "description": "Default theme for HDFS service",
+    "configuration": {
+      "layouts": [
+        {
+          "name": "default",
+          "tabs": [
+            {
+              "name": "settings",
+              "display-name": "Settings",
+              "layout": {
+                "tab-columns": "3",
+                "tab-rows": "2",
+                "sections": [
+                  {
+                    "name": "section-namenode",
+                    "display-name": "NameNode",
+                    "row-index": "0",
+                    "column-index": "0",
+                    "row-span": "1",
+                    "column-span": "2",
+                    "section-columns": "2",
+                    "section-rows": "1",
+                    "subsections": [
+                      {
+                        "name": "subsection-namenode-col1",
+                        "row-index": "0",
+                        "column-index": "0",
+                        "row-span": "1",
+                        "column-span": "1"
+                      }, {
+                        "name": "subsection-namenode-col2",
+                        "row-index": "0",
+                        "column-index": "1",
+                        "row-span": "1",
+                        "column-span": "1"
+                      }
+                    ]
+                  },
+                  {
+                    "name": "section-datanode",
+                    "display-name": "DataNode",
+                    "row-index": "0",
+                    "column-index": "1",
+                    "row-span": "1",
+                    "column-span": "1",
+                    "section-columns": "1",
+                    "section-rows": "1",
+                    "subsections": [
+                      {
+                        "name": "subsection-datanode-col1",
+                        "row-index": "0",
+                        "column-index": "0",
+                        "row-span": "1",
+                        "column-span": "1"
+                      }
+                    ]
+                  },
+                  {
+                    "name": "section-encryption",
+                    "display-name": "Encryption",
+                    "row-index": "1",
+                    "column-index": "0",
+                    "row-span": "1",
+                    "column-span": "2",
+                    "section-columns": "2",
+                    "section-rows": "1",
+                    "subsections": [
+                      {
+                        "name": "subsection-encryption-col1",
+                        "row-index": "0",
+                        "column-index": "0",
+                        "row-span": "1",
+                        "column-span": "1"
+                      }, {
+                        "name": "subsection-encryption-col2",
+                        "row-index": "0",
+                        "column-index": "1",
+                        "row-span": "1",
+                        "column-span": "1"
+                      }
+                    ]
+                  }
+                ]
+              }
+            }
+          ]
+        }
+      ]
+    },
+    "placement": {
+      "configuration-layout": "default",
+      "configs": [
+        {
+          "config": "hdfs-site/dfs.namenode.name.dir",
+          "subsection-name": "subsection-namenode-col1"
+        },
+        {
+          "config": "hdfs-site/dfs.namenode.safemode.threshold-pct",
+          "subsection-name": "subsection-namenode-col1"
+        },
+        {
+          "config": "hdfs-site/dfs.namenode.handler.count",
+          "subsection-name": "subsection-namenode-col1"
+        },
+        {
+          "config": "hadoop-env/namenode_opt_newsize",
+          "subsection-name": "subsection-namenode-col1"
+        },
+        {
+          "config": "hadoop-env/namenode_opt_maxnewsize",
+          "subsection-name": "subsection-namenode-col2"
+        },
+        {
+          "config": "hadoop-env/namenode_opt_permsize",
+          "subsection-name": "subsection-namenode-col2"
+        },
+        {
+          "config": "hadoop-env/namenode_opt_maxpermsize",
+          "subsection-name": "subsection-namenode-col2"
+        },
+        {
+          "config": "hadoop-env/namenode_heapsize",
+          "subsection-name": "subsection-namenode-col2"
+        },
+        {
+          "config": "hdfs-site/dfs.datanode.failed.volumes.tolerated",
+          "subsection-name": "subsection-datanode-col1"
+        },
+        {
+          "config": "hdfs-site/dfs.datanode.data.dir",
+          "subsection-name": "subsection-datanode-col1"
+        },
+        {
+          "config": "hadoop-env/dtnode_heapsize",
+          "subsection-name": "subsection-datanode-col1"
+        },
+        {
+          "config": "hdfs-site/dfs.datanode.max.transfer.threads",
+          "subsection-name": "subsection-datanode-col1"
+        }
+      ]
+    },
+    "widgets":[
+      {
+        "config":"hdfs-site/dfs.namenode.name.dir",
+        "widget":{
+          "type":"directories"
+        }
+      },
+      {
+        "config":"hdfs-site/dfs.namenode.safemode.threshold-pct",
+        "widget":{
+          "type":"toggle"
+        }
+      },
+      {
+        "config":"hdfs-site/dfs.namenode.handler.count",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"int"
+            }
+          ]
+        }
+      },
+      {
+        "config":"hadoop-env/namenode_opt_newsize",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"GB"
+            }
+          ]
+        }
+      },
+      {
+        "config": "hadoop-env/namenode_opt_maxnewsize",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"GB"
+            }
+          ]
+        }
+      },
+      {
+        "config": "hadoop-env/namenode_opt_permsize",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"GB"
+            }
+          ]
+        }
+      },
+      {
+        "config": "hadoop-env/namenode_opt_maxpermsize",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"GB"
+            }
+          ]
+        }
+      },
+      {
+        "config": "hadoop-env/namenode_heapsize",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"GB"
+            }
+          ]
+        }
+      },
+      {
+        "config": "hdfs-site/dfs.datanode.failed.volumes.tolerated",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"int"
+            }
+          ]
+        }
+      },
+      {
+        "config": "hdfs-site/dfs.datanode.data.dir",
+        "widget":{
+          "type":"directories"
+        }
+      },
+      {
+        "config": "hadoop-env/dtnode_heapsize",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"GB"
+            }
+          ]
+        }
+      },
+      {
+        "config": "hdfs-site/dfs.datanode.max.transfer.threads",
+        "widget":{
+          "type":"slider",
+          "units":[
+            {
+              "unit-name":"int"
+            }
+          ]
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/76dc6034/ambari-web/app/views/common/configs/widgets/toggle_config_widget_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/widgets/toggle_config_widget_view.js b/ambari-web/app/views/common/configs/widgets/toggle_config_widget_view.js
index 0eb22b2..5ee713c 100644
--- a/ambari-web/app/views/common/configs/widgets/toggle_config_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/toggle_config_widget_view.js
@@ -78,18 +78,20 @@ App.ToggleConfigWidgetView = App.ConfigWidgetView.extend({
    * @method initSwitcher
    */
   initSwitcher: function () {
-    var labels = this.get('config.stackConfigProperty.valueAttributes.entry_labels'),
+    var labels = this.get('config.stackConfigProperty.valueAttributes.entries'),
       self = this;
-    var switcher = this.$("input").bootstrapSwitch({
-      onText: labels[0],
-      offText: labels[1],
-      offColor: 'danger',
-      handleWidth: 85,
-      onSwitchChange: function (event, state) {
-        self.set('switcherValue', state);
-      }
-    });
-    this.set('switcher', switcher);
+    if (this.$("input")) {
+      var switcher = this.$("input").bootstrapSwitch({
+        onText: labels[0].label,
+        offText: labels[1].label,
+        offColor: 'danger',
+        handleWidth: 85,
+        onSwitchChange: function (event, state) {
+          self.set('switcherValue', state);
+        }
+      });
+      this.set('switcher', switcher);
+    }
   },
 
   /**