Pārlūkot izejas kodu

AMBARI-2989 UI needs ability to categorize, name and describe non-global configurations. (atkach)

atkach 12 gadi atpakaļ
vecāks
revīzija
82adc3442e

+ 2 - 2
ambari-web/app/controllers/main/admin/security/add/step4.js

@@ -366,7 +366,7 @@ App.MainAdminSecurityAddStep4Controller = Em.Controller.extend({
   loadGlobals: function () {
     var globals = this.get('content.serviceConfigProperties').filterProperty('id', 'puppet var');
     this.set('globalProperties', globals);
-    this.loadStaticGlobal(); //Hack for properties which are declared in config_properties.js and not able to retrieve values declared in secure_properties.js
+    this.loadStaticGlobal(); //Hack for properties which are declared in global_properties.js and not able to retrieve values declared in secure_properties.js
     this.loadUsersToGlobal();
     this.loadHostNamesToGlobal();
     this.loadPrimaryNamesToGlobals();
@@ -704,4 +704,4 @@ App.MainAdminSecurityAddStep4Controller = Em.Controller.extend({
       }
     }
   }
-});
+});

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

@@ -39,8 +39,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     return App.config.get('configMapping');
   }.property('App.config.configMapping'),
   configs: function() {
-    return  App.config.get('preDefinedConfigProperties');
-  }.property('App.config.preDefinedConfigProperties'),
+    return  App.config.get('preDefinedGlobalProperties');
+  }.property('App.config.preDefinedGlobalProperties'),
 
   secureConfigs: require('data/secure_mapping'),
 

+ 0 - 0
ambari-web/app/data/HDP2/config_properties.js → ambari-web/app/data/HDP2/global_properties.js


+ 22 - 0
ambari-web/app/data/HDP2/site_properties.js

@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+module.exports =
+{
+  "configProperties": [
+  ]
+};

+ 0 - 0
ambari-web/app/data/config_properties.js → ambari-web/app/data/global_properties.js


+ 22 - 0
ambari-web/app/data/site_properties.js

@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+module.exports =
+{
+  "configProperties": [
+  ]
+};

+ 15 - 9
ambari-web/app/utils/config.js

@@ -26,25 +26,31 @@ var globalPropertyToServicesMap = null;
 App.config = Em.Object.create({
 
   preDefinedServiceConfigs: function(){
-    var configs = this.get('preDefinedConfigProperties');
+    var configs = this.get('preDefinedGlobalProperties');
     var services = [];
     require('data/service_configs').forEach(function(service){
       service.configs = configs.filterProperty('serviceName', service.serviceName);
       services.push(service);
     });
     return services;
-  }.property('preDefinedConfigProperties'),
+  }.property('preDefinedGlobalProperties'),
   configMapping: function() {
       if (App.get('isHadoop2Stack')) {
         return require('data/HDP2/config_mapping');
       }
     return require('data/config_mapping');
   }.property('App.isHadoop2Stack'),
-  preDefinedConfigProperties: function() {
+  preDefinedGlobalProperties: function() {
     if (App.get('isHadoop2Stack')) {
-      return require('data/HDP2/config_properties').configProperties;
+      return require('data/HDP2/global_properties').configProperties;
     }
-    return require('data/config_properties').configProperties;
+    return require('data/global_properties').configProperties;
+  }.property('App.isHadoop2Stack'),
+  preDefinedSiteProperties: function() {
+    if (App.get('isHadoop2Stack')) {
+      return require('data/HDP2/site_properties').configProperties;
+    }
+    return require('data/site_properties').configProperties;
   }.property('App.isHadoop2Stack'),
   preDefinedCustomConfigs: function () {
     if (App.get('isHadoop2Stack')) {
@@ -162,7 +168,7 @@ App.config = Em.Object.create({
   mergePreDefinedWithLoaded: function (configGroups, advancedConfigs, tags, serviceName) {
     var configs = [];
     var globalConfigs = [];
-    var preDefinedConfigs = this.get('preDefinedConfigProperties');
+    var preDefinedConfigs = this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties'));
     var mappingConfigs = [];
 
     tags.forEach(function (_tag) {
@@ -206,7 +212,7 @@ App.config = Em.Object.create({
           if (configsPropertyDef) {
             this.handleSpecialProperties(serviceConfigObj);
           } else {
-            serviceConfigObj.isVisible = false;  // if the global property is not defined on ui metadata config_properties.js then it shouldn't be a part of errorCount
+            serviceConfigObj.isVisible = false;  // if the global property is not defined on ui metadata global_properties.js then it shouldn't be a part of errorCount
           }
           serviceConfigObj.id = 'puppet var';
           serviceConfigObj.displayName = configsPropertyDef ? configsPropertyDef.displayName : null;
@@ -240,14 +246,14 @@ App.config = Em.Object.create({
    */
   mergePreDefinedWithStored: function (storedConfigs, advancedConfigs) {
     var mergedConfigs = [];
-    var preDefinedConfigs = $.extend(true, [], this.get('preDefinedConfigProperties'));
+    var preDefinedConfigs = $.extend(true, [], this.get('preDefinedGlobalProperties').concat(this.get('preDefinedSiteProperties')));
     var preDefinedNames = [];
     var storedNames = [];
     var names = [];
     var categoryMetaData = null;
     storedConfigs = (storedConfigs) ? storedConfigs : [];
 
-    preDefinedNames = this.get('preDefinedConfigProperties').mapProperty('name');
+    preDefinedNames = preDefinedConfigs.mapProperty('name');
     storedNames = storedConfigs.mapProperty('name');
     names = preDefinedNames.concat(storedNames).uniq();
     names.forEach(function (name) {