Browse Source

AMBARI-1928. Make experimental Ambari Web features toggleable via mvn build. (yusaku via jaimin)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1468267 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly 12 năm trước cách đây
mục cha
commit
d4ec0f7756

+ 3 - 0
CHANGES.txt

@@ -257,6 +257,9 @@ Trunk (unreleased changes):
  (Sumit Mohanty via mahadev)
  (Sumit Mohanty via mahadev)
 
 
  IMPROVEMENTS
  IMPROVEMENTS
+
+ AMBARI-1928. Make experimental Ambari Web features toggleable
+ via mvn build. (yusaku via jaimin)
  
  
  AMBARI-1906. Make experimental Ambari Web features toggleable 
  AMBARI-1906. Make experimental Ambari Web features toggleable 
  (turned on/off via config file). (yusaku via jaimin)
  (turned on/off via config file). (yusaku via jaimin)

+ 11 - 10
ambari-web/app/config.js

@@ -35,22 +35,23 @@ App.contentUpdateInterval = 15000;
 App.maxRunsForAppBrowser = 500;
 App.maxRunsForAppBrowser = 500;
 App.pageReloadTime=3600000;
 App.pageReloadTime=3600000;
 
 
-App.disableAllSupports = false;
+// experimental features are automatically enabled if running on brunch server
+App.enableExperimental = (location.port == '3333');
 
 
 App.supports = {
 App.supports = {
   addServices: false,
   addServices: false,
-  hostOverrides: true,
-  mirroring: true,
-  secureCluster: true,
-  reassignMaster: true,
-  stackUpgrade: true,
-  capacitySchedulerUi: true,
-  startStopAllServices: true
+  hostOverrides: false,
+  mirroring: false,
+  secureCluster: false,
+  reassignMaster: false,
+  stackUpgrade: false,
+  capacitySchedulerUi: false,
+  startStopAllServices: false
 };
 };
 
 
-if (App.disableAllSupports) {
+if (App.enableExperimental) {
   for (var support in App.supports) {
   for (var support in App.supports) {
-    App.supports[support] = false;
+    App.supports[support] = true;
   }
   }
 }
 }
 
 

+ 5 - 0
ambari-web/pom.xml

@@ -93,6 +93,11 @@
                 <exec dir="${basedir}" executable="brunch" failonerror="false">
                 <exec dir="${basedir}" executable="brunch" failonerror="false">
                   <arg value="build"/>
                   <arg value="build"/>
                 </exec>
                 </exec>
+                <!-- enables experimental features if enableExperimental is set to true -->
+                <exec dir="${basedir}" executable="sh" failonerror="false">
+                  <arg value="${basedir}/toggle-experimental.sh"/>
+                  <arg value="${enableExperimental}"/>
+                </exec>
                 <exec dir="${basedir}" executable="gzip" failonerror="false">
                 <exec dir="${basedir}" executable="gzip" failonerror="false">
                   <arg value="public/javascripts/app.js"/>
                   <arg value="public/javascripts/app.js"/>
                   <arg value="public/javascripts/vendor.js"/>
                   <arg value="public/javascripts/vendor.js"/>

+ 7 - 0
ambari-web/toggle-experimental.sh

@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ "$1" == "true" ]
+then
+  echo 'Enabling experimental features...'
+  sed 's/App.enableExperimental.*=.*;/App.enableExperimental = true;/' public/javascripts/app.js > public/javascripts/tmp.js; mv public/javascripts/tmp.js public/javascripts/app.js
+fi