Browse Source

AMBARI-10104 Enhanced Configs: create models and mappers for tab sections and subsections (additional). (ababiichuk)

aBabiichuk 10 năm trước cách đây
mục cha
commit
a0dab0ce86

+ 2 - 1
ambari-web/app/config.js

@@ -72,7 +72,8 @@ App.supports = {
   customizeAgentUserAccount: false,
   installGanglia: false,
   opsDuringRollingUpgrade: false,
-  customizedWidgets: false
+  customizedWidgets: false,
+  enhancedConfigs: false
 };
 
 if (App.enableExperimental) {

+ 6 - 0
ambari-web/app/controllers/installer.js

@@ -658,6 +658,12 @@ App.InstallerController = App.WizardController.extend({
       {
         type: 'sync',
         callback: function () {
+          if (App.get('supports.enhancedConfigs')) {
+            var serviceNames = App.StackService.find().filter(function(s) {
+              return s.get('isSelected');
+            }).mapProperty('serviceName');
+            App.themesMapper.generateAdvancedTabs(serviceNames);
+          }
           this.loadServiceConfigGroups();
           this.loadServiceConfigProperties();
           this.loadCurrentHostGroups();

+ 6 - 0
ambari-web/app/controllers/main/service/add_controller.js

@@ -115,6 +115,12 @@ App.AddServiceController = App.WizardController.extend(App.AddSecurityConfigs, {
           var self = this;
           var dfd = $.Deferred();
           this.loadKerberosDescriptorConfigs().done(function() {
+            if (App.get('supports.enhancedConfigs')) {
+              var serviceNames = App.StackService.find().filter(function(s) {
+                return s.get('isSelected') || s.get('isInstalled');
+              }).mapProperty('serviceName');
+              App.themesMapper.generateAdvancedTabs(serviceNames);
+            }
             self.loadServiceConfigGroups();
             self.loadServiceConfigProperties();
             dfd.resolve();

+ 3 - 0
ambari-web/app/controllers/main/service/info/configs.js

@@ -257,6 +257,9 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
    */
   loadStep: function () {
     console.log("TRACE: Loading configure for service");
+    if (App.get('supports.enhancedConfigs')) {
+      App.themesMapper.generateAdvancedTabs([this.get('content.serviceName')]);
+    }
     this.clearStep();
     this.loadClusterEnvSite();
   },

+ 7 - 2
ambari-web/app/views/common/configs/service_config_view.js

@@ -44,7 +44,9 @@ App.ServiceConfigView = Em.View.extend({
   supportsConfigLayout: function() {
     var supportedControllers = ['wizardStep7Controller', 'mainServiceInfoConfigsController'];
     var unSupportedServices = ['MISC'];
-
+    if (!App.get('supports.enhancedConfigs')) {
+      return false;
+    }
     return supportedControllers.contains(this.get('controllerName')) || !unSupportedServices.contains(this.get('controller.selectedService.serviceName'));
   }.property('controller.name', 'controller.selectedService'),
 
@@ -91,7 +93,10 @@ App.ServiceConfigView = Em.View.extend({
    * @returns {Ember.A}
    */
   tabs: function() {
-    var tabs = App.Tab.find();
+    if (!App.get('supports.enhancedConfigs')) {
+      return Em.A([]);
+    }
+    var tabs = App.Tab.find().filterProperty('serviceName', this.get('controller.selectedService.serviceName'));
     // make first tab active
     tabs.get('firstObject').set('isActive', true);
     return tabs;