Author: jaimin
Date: Mon Apr 15 22:36:44 2013
New Revision: 1468258
URL: http://svn.apache.org/r1468258
Log:
AMBARI-1906. Make experimental Ambari Web features toggleable (turned on/off
via config file). (yusaku via jaimin)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/config.js
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
incubator/ambari/trunk/ambari-web/app/data/service_configs.js
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
incubator/ambari/trunk/ambari-web/app/templates/main/service.hbs
incubator/ambari/trunk/ambari-web/app/utils/config.js
incubator/ambari/trunk/ambari-web/app/views/main/admin.js
incubator/ambari/trunk/ambari-web/app/views/main/menu.js
incubator/ambari/trunk/ambari-web/app/views/main/service/item.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon Apr 15 22:36:44 2013
@@ -257,6 +257,9 @@ Trunk (unreleased changes):
(Sumit Mohanty via mahadev)
IMPROVEMENTS
+
+ AMBARI-1906. Make experimental Ambari Web features toggleable
+ (turned on/off via config file). (yusaku via jaimin)
AMBARI-1905. Test mode is broken. (yusaku via jaimin)
Modified: incubator/ambari/trunk/ambari-web/app/config.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/config.js?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/config.js Mon Apr 15 22:36:44 2013
@@ -18,29 +18,42 @@
var App = require('app');
-App.testMode = false;
-if(location.port == '3333'){
- App.testMode = true;
-}
+App.testMode = (location.port == '3333'); // test mode is automatically
enabled if running on brunch server
App.testModeDelayForActions = 10000;
App.skipBootstrap = false;
App.alwaysGoToInstaller = false;
-App.testEnableSecurity = true; // By default enable security
is tested; turning it false tests disable security
+App.testEnableSecurity = true; // By default enable security is tested;
turning it false tests disable security
App.apiPrefix = '/api/v1';
App.defaultStackVersion = 'HDP-1.3.0';
App.defaultLocalStackVersion = 'HDPLocal-1.3.0';
App.defaultJavaHome = '/usr/jdk/jdk1.6.0_31';
-App.addServicesEnabled = false;
-// default AJAX timeout
-App.timeout = 180000;
-// max number of retries for certain AJAX calls
-App.maxRetries = 3;
+App.timeout = 180000; // default AJAX timeout
+App.maxRetries = 3; // max number of retries for certain AJAX calls
App.bgOperationsUpdateInterval = 6000;
App.componentsUpdateInterval = 6000;
App.contentUpdateInterval = 15000;
App.maxRunsForAppBrowser = 500;
App.pageReloadTime=3600000;
+App.disableAllSupports = false;
+
+App.supports = {
+ addServices: false,
+ hostOverrides: true,
+ mirroring: true,
+ secureCluster: true,
+ reassignMaster: true,
+ stackUpgrade: true,
+ capacitySchedulerUi: true,
+ startStopAllServices: true
+};
+
+if (App.disableAllSupports) {
+ for (var support in App.supports) {
+ App.supports[support] = false;
+ }
+}
+
// this is to make sure that IE does not cache data when making AJAX calls to
the server
$.ajaxSetup({
cache: false
@@ -50,3 +63,4 @@ $.ajaxSetup({
* Test Mode values
*/
App.test_hostname = 'hostname';
+
Modified:
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
(original)
+++
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step8_controller.js
Mon Apr 15 22:36:44 2013
@@ -1270,8 +1270,10 @@ App.WizardStep8Controller = Em.Controlle
}
if (selectedServices.someProperty('serviceName', 'MAPREDUCE')) {
this.applyConfigurationToSite(this.createMrSiteObj());
- this.applyConfigurationToSite(this.createCapacityScheduler());
- this.applyConfigurationToSite(this.createMapredQueueAcls());
+ if (App.supports.capacitySchedulerUi) {
+ this.applyConfigurationToSite(this.createCapacityScheduler());
+ this.applyConfigurationToSite(this.createMapredQueueAcls());
+ }
}
if (selectedServices.someProperty('serviceName', 'HBASE')) {
this.applyConfigurationToSite(this.createHbaseSiteObj());
Modified: incubator/ambari/trunk/ambari-web/app/data/service_configs.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/service_configs.js?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/service_configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/service_configs.js Mon Apr 15
22:36:44 2013
@@ -48,7 +48,7 @@ module.exports = [
App.ServiceConfigCategory.create({ name: 'TaskTracker', displayName :
'TaskTracker', hostComponentNames : ['TASKTRACKER']}),
App.ServiceConfigCategory.create({ name: 'General', displayName :
'General'}),
App.ServiceConfigCategory.create({ name: 'Advanced', displayName :
'Advanced'}),
- App.ServiceConfigCategory.create({ name: 'CapacityScheduler',
displayName : 'Capacity Scheduler', isCustomView: true, siteFileName:
'capacity-scheduler.xml', siteFileNames: ['capacity-scheduler.xml',
'mapred-queue-acls.xml'], canAddProperty: true}),
+ App.ServiceConfigCategory.create({ name: 'CapacityScheduler',
displayName : 'Capacity Scheduler', isCapacityScheduler : true, isCustomView:
true, siteFileName: 'capacity-scheduler.xml', siteFileNames:
['capacity-scheduler.xml', 'mapred-queue-acls.xml'], canAddProperty: true}),
App.ServiceConfigCategory.create({ name: 'AdvancedMapredSite',
displayName : 'Custom mapred-site.xml', siteFileName: 'mapred-site.xml',
canAddProperty: true})
],
sites: ['global', 'core-site', 'mapred-site', 'capacity-scheduler',
'mapred-queue-acls'],
Modified:
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
---
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
(original)
+++
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
Mon Apr 15 22:36:44 2013
@@ -47,7 +47,9 @@
<div class="accordion">
{{#each category in selectedService.configCategories}}
{{#if category.isCustomView}}
+ {{#if App.supports.capacityScheduler}}
{{view category.customView categoryBinding="category"
serviceBinding="selectedService" canEditBinding="view.canEdit"
serviceConfigsBinding="selectedService.configs"}}
+ {{/if}}
{{else}}
{{#view App.ServiceConfigsByCategoryView categoryBinding="category"
canEditBinding="view.canEdit" serviceBinding="selectedService"
serviceConfigsBinding="selectedService.configs"}}
@@ -76,7 +78,9 @@
{{view viewClass serviceConfigBinding="this"
categoryConfigsAllBinding="view.categoryConfigsAll" }}
{{#if view.canEdit}}
{{#if isPropertyOverridable}}
+ {{#if App.supports.hostOverrides}}
<a class="action" {{action
"createOverrideProperty" this target="view" }} ><i
class="icon-plus-sign"></i>{{t common.exception}}</a>
+ {{/if}}
{{/if}}
{{#if cantBeUndone}}
{{else}}
Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service.hbs
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service.hbs?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service.hbs Mon Apr 15
22:36:44 2013
@@ -20,7 +20,7 @@
<div id="services-menu" class="well span2" style="padding: 8px 0">
{{view App.MainServiceMenuView}}
{{#if App.isAdmin}}
- {{#if App.addServicesEnabled}}
+ {{#if App.supports.addServices}}
<div class="add-service-button">
<a class="btn" {{action addService href="true"}}>
<i class="icon-plus"></i>
@@ -28,6 +28,7 @@
</a>
</div>
{{/if}}
+ {{#if App.supports.startStopAllServices}}
<div class="start-stop-all-service-button">
<a href="javascript:void(null)" {{bindAttr class=":btn
controller.isStartAllDisabled:disabled:btn-success" }}
data-toggle="modal" {{action "startAllService"
target="controller"}}>
@@ -43,6 +44,7 @@
</a>
</div>
{{/if}}
+ {{/if}}
</div>
<div class="span10">
{{outlet}}
Modified: incubator/ambari/trunk/ambari-web/app/utils/config.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/config.js?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/config.js Mon Apr 15 22:36:44
2013
@@ -31,7 +31,13 @@ App.config = Em.Object.create({
//categories which contain custom configs
categoriesWithCustom: ['CapacityScheduler'],
//configs with these filenames go to appropriate category not in Advanced
- customFileNames: ['capacity-scheduler.xml', 'mapred-queue-acls.xml'],
+ customFileNames: function() {
+ if (App.supports.capacitySchedulerUi) {
+ return ['capacity-scheduler.xml', 'mapred-queue-acls.xml'];
+ } else {
+ return [];
+ }
+ }.property(''),
/**
* Cache of loaded configurations. This is useful in not loading
* same configuration multiple times. It is populated in multiple
Modified: incubator/ambari/trunk/ambari-web/app/views/main/admin.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/admin.js?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/admin.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/admin.js Mon Apr 15
22:36:44 2013
@@ -21,28 +21,34 @@ var App = require('app');
App.MainAdminView = Em.View.extend({
templateName: require('templates/main/admin'),
selectedBinding: 'controller.category',
- categories: [
- {
+ categories: function() {
+ var items = [{
name: 'user',
url: 'adminUser',
label: Em.I18n.t('common.users')
- },
- {
- name: 'security',
- url: 'adminSecurity.index',
- label: Em.I18n.t('common.security')
- },
- {
- name: 'cluster',
- url: 'adminCluster',
- label: Em.I18n.t('common.cluster')
- },
- {
+ }];
+ if (App.supports.secureCluster) {
+ items.push({
+ name: 'security',
+ url: 'adminSecurity.index',
+ label: Em.I18n.t('common.security')
+ });
+ }
+ if (App.supports.stackUpgrade) {
+ items.push({
+ name: 'cluster',
+ url: 'adminCluster',
+ label: Em.I18n.t('common.cluster')
+ });
+ }
+ items.push({
name: 'misc',
url: 'adminMisc',
label: Em.I18n.t('common.misc')
- }
- ],
+ });
+ return items;
+ }.property(''),
+
NavItemView: Ember.View.extend({
tagName: 'li',
classNameBindings: 'isActive:active'.w(),
Modified: incubator/ambari/trunk/ambari-web/app/views/main/menu.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/menu.js?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/menu.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/menu.js Mon Apr 15
22:36:44 2013
@@ -31,11 +31,16 @@ App.MainMenuView = Em.CollectionView.ext
{ label:Em.I18n.t('menu.item.heatmaps'), routing:'charts'},
{ label:Em.I18n.t('menu.item.services'), routing:'services'},
{ label:Em.I18n.t('menu.item.hosts'), routing:'hosts'},
- { label:Em.I18n.t('menu.item.jobs'), routing:'apps'},
- { label:Em.I18n.t('menu.item.mirroring'), routing:'mirroring'}
-
+ { label:Em.I18n.t('menu.item.jobs'), routing:'apps'}
];
- if(App.get('isAdmin')) result.push({ label:Em.I18n.t('menu.item.admin'),
routing:'admin'});
+
+ if (App.supports.mirroring) {
+ result.push({ label:Em.I18n.t('menu.item.mirroring'),
routing:'mirroring'});
+ }
+
+ if (App.get('isAdmin')) {
+ result.push({ label:Em.I18n.t('menu.item.admin'), routing:'admin'});
+ }
return result;
}.property(),
/**
Modified: incubator/ambari/trunk/ambari-web/app/views/main/service/item.js
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/item.js?rev=1468258&r1=1468257&r2=1468258&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/service/item.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/service/item.js Mon Apr 15
22:36:44 2013
@@ -32,18 +32,24 @@ App.MainServiceItemView = Em.View.extend
// break;
case 'GANGLIA':
case 'NAGIOS':
-
this.get('controller.content.hostComponents').filterProperty('isMaster').forEach
(function (hostComponent){
- options.push({action: 'reassignMaster', context: hostComponent,
'label':
Em.I18n.t('services.service.actions.reassign.master').format(hostComponent.get('displayName'))});
- })
+ if (App.supports.reassignMaster) {
+
this.get('controller.content.hostComponents').filterProperty('isMaster').forEach
(function (hostComponent){
+ options.push({action: 'reassignMaster', context: hostComponent,
'label':
Em.I18n.t('services.service.actions.reassign.master').format(hostComponent.get('displayName'))});
+ })
+ }
break;
case 'HIVE':
options.push({action: 'runSmokeTest', 'label':
Em.I18n.t('services.service.actions.run.smoke')});
- options.push({action: 'reassignMaster', context:
App.HostComponent.find().findProperty('componentName', 'HIVE_METASTORE'),
'label':
Em.I18n.t('services.service.actions.reassign.master').format(App.HostComponent.find().findProperty('componentName',
'HIVE_METASTORE').get('displayName'))});
- options.push({action: 'reassignMaster', context:
App.HostComponent.find().findProperty('componentName', 'HIVE_SERVER'), 'label':
Em.I18n.t('services.service.actions.reassign.master.hive')});
+ if (App.supports.reassignMaster) {
+ options.push({action: 'reassignMaster', context:
App.HostComponent.find().findProperty('componentName', 'HIVE_METASTORE'),
'label':
Em.I18n.t('services.service.actions.reassign.master').format(App.HostComponent.find().findProperty('componentName',
'HIVE_METASTORE').get('displayName'))});
+ options.push({action: 'reassignMaster', context:
App.HostComponent.find().findProperty('componentName', 'HIVE_SERVER'), 'label':
Em.I18n.t('services.service.actions.reassign.master.hive')});
+ }
break;
case 'WEBHCAT':
options.push({action: 'runSmokeTest', 'label':
Em.I18n.t('services.service.actions.run.smoke')});
- options.push({action: 'reassignMaster', context:
App.HostComponent.find().findProperty('componentName', 'HIVE_SERVER'), 'label':
Em.I18n.t('services.service.actions.reassign.master.hive')});
+ if (App.supports.reassignMaster) {
+ options.push({action: 'reassignMaster', context:
App.HostComponent.find().findProperty('componentName', 'HIVE_SERVER'), 'label':
Em.I18n.t('services.service.actions.reassign.master.hive')});
+ }
break;
case 'HUE':
options.push({action: 'runSmokeTest', 'label':
Em.I18n.t('services.service.actions.run.smoke')});
@@ -51,9 +57,11 @@ App.MainServiceItemView = Em.View.extend
default:
var components = this.get('controller.content.hostComponents');
options.push({action: 'runSmokeTest', 'label':
Em.I18n.t('services.service.actions.run.smoke')});
-
components.filterProperty('isMaster').mapProperty('displayName').uniq().forEach
(function (hostComponent){
- options.push({action: 'reassignMaster', context:
components.findProperty('displayName', hostComponent), 'label':
Em.I18n.t('services.service.actions.reassign.master').format(hostComponent)});
- })
+ if (App.supports.reassignMaster) {
+
components.filterProperty('isMaster').mapProperty('displayName').uniq().forEach
(function (hostComponent){
+ options.push({action: 'reassignMaster', context:
components.findProperty('displayName', hostComponent), 'label':
Em.I18n.t('services.service.actions.reassign.master').format(hostComponent)});
+ })
+ }
}
return options;
}.property('controller.content'),