You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/06/04 23:22:39 UTC

svn commit: r1489615 - in /incubator/ambari/trunk/ambari-web/app: controllers/main/service/info/ data/ models/ styles/ templates/common/configs/ utils/ views/common/configs/

Author: jaimin
Date: Tue Jun  4 21:22:39 2013
New Revision: 1489615

URL: http://svn.apache.org/r1489615
Log:
Ambari web UI should highlight secure config knobs recognized by it on service config page. (jaimin)

Modified:
    incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
    incubator/ambari/trunk/ambari-web/app/data/secure_properties.js
    incubator/ambari/trunk/ambari-web/app/models/service_config.js
    incubator/ambari/trunk/ambari-web/app/styles/application.less
    incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
    incubator/ambari/trunk/ambari-web/app/utils/config.js
    incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js

Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js?rev=1489615&r1=1489614&r2=1489615&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js Tue Jun  4 21:22:39 2013
@@ -35,6 +35,9 @@ App.MainServiceInfoConfigsController = E
   configs: function() {
     return  App.config.get('preDefinedConfigProperties');
   }.property('App.config.preDefinedConfigProperties'),
+
+  secureConfigs: require('data/secure_mapping'),
+
   
   /**
    * During page load time, we get the host overrides from the server.
@@ -448,6 +451,7 @@ App.MainServiceInfoConfigsController = E
       this.get('stepConfigs').pushObject(serviceConfig);
     }
     this.set('selectedService', this.get('stepConfigs').objectAt(0));
+    this.checkForSecureConfig( this.get('selectedService'));
     this.set('dataIsLoaded', true);
   },
   /**
@@ -498,7 +502,7 @@ App.MainServiceInfoConfigsController = E
     var restartHosts = Ember.A([]);
     if(restartData != null && restartData.hostAndHostComponents != null && !jQuery.isEmptyObject(restartData.hostAndHostComponents)){
       serviceConfig.set('restartRequired', true);
-      for(var host in restartData.hostAndHostComponents){
+      for(var host in restartData.hostAndHostComponents) {
         hostsCount++;
         var componentsArray = Ember.A([]);
         for(var component in restartData.hostAndHostComponents[host]){
@@ -514,6 +518,20 @@ App.MainServiceInfoConfigsController = E
   },
 
   /**
+   * check whether the config property is a security related knob
+   * @param serviceConfig
+   */
+  checkForSecureConfig: function(serviceConfig) {
+    serviceConfig.get('configs').forEach(function(_config){
+     this.get('secureConfigs').forEach(function(_secureConfig){
+       if(_config.get('name')=== _secureConfig.name) {
+         _config.set('isSecureConfig',true);
+       }
+     },this)
+    },this)
+  },
+
+  /**
    * Load child components to service config object
    * @param configs
    * @param componentConfig

Modified: incubator/ambari/trunk/ambari-web/app/data/secure_properties.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/data/secure_properties.js?rev=1489615&r1=1489614&r2=1489615&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/data/secure_properties.js (original)
+++ incubator/ambari/trunk/ambari-web/app/data/secure_properties.js Tue Jun  4 21:22:39 2013
@@ -315,19 +315,6 @@ module.exports =
     //OOZIE
     {
       "id": "puppet var",
-      "name": "oozie_server_name",
-      "displayName": "Oozie server host",
-      "value": "",
-      "defaultValue": "",
-      "description": "Oozie server host",
-      "displayType": "masterHosts",
-      "isVisible": false,
-      "isOverridable": false,
-      "serviceName": "OOZIE",
-      "category": "Oozie Server"
-    },
-    {
-      "id": "puppet var",
       "name": "oozie_primary_name",
       "displayName": "Primary name",
       "value": "",

Modified: incubator/ambari/trunk/ambari-web/app/models/service_config.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/service_config.js?rev=1489615&r1=1489614&r2=1489615&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/service_config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/service_config.js Tue Jun  4 21:22:39 2013
@@ -145,6 +145,7 @@ App.ServiceConfigProperty = Ember.Object
   isReconfigurable: true, // by default a config property is reconfigurable
   isEditable: true, // by default a config property is editable
   isVisible: true,
+  isSecureConfig: false,
   errorMessage: '',
   serviceConfig: null, // points to the parent App.ServiceConfig object
   filename: '',

Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1489615&r1=1489614&r2=1489615&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Tue Jun  4 21:22:39 2013
@@ -519,6 +519,9 @@ h1 {
       .control-label-span{
         width: auto !important;
       }
+      .icon-lock {
+        color: #008000;
+      }
       .action{
         margin-left: 7px;
         margin-right: 3px;

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=1489615&r1=1489614&r2=1489615&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 Tue Jun  4 21:22:39 2013
@@ -45,7 +45,7 @@
 	</div>
 	{{/if}}
 {{/if}}
-          
+
 <div class="accordion">
   {{#each category in selectedService.configCategories}}
     {{#if category.isCustomView}}
@@ -74,6 +74,11 @@
 		                            {{/if}}
 		                          {{/if}}
                               {{displayName}}
+                              {{#if App.supports.secureCluster}}
+                                {{#if isSecureConfig}}
+                                  <a href="#"><i class="icon-lock" rel="tooltip" data-toggle="tooltip" title="security knob"></i></a>
+                                {{/if}}
+                              {{/if}}
                             </label>
                           </span>
                           <div class="controls">

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=1489615&r1=1489614&r2=1489615&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/config.js Tue Jun  4 21:22:39 2013
@@ -175,6 +175,7 @@ App.config = Em.Object.create({
           serviceConfigObj.isOverridable = configsPropertyDef.isOverridable === undefined ? true : configsPropertyDef.isOverridable;
           serviceConfigObj.serviceName = configsPropertyDef ? configsPropertyDef.serviceName : null;
           serviceConfigObj.index = configsPropertyDef.index;
+          serviceConfigObj.isSecureConfig = configsPropertyDef.isSecureConfig === undefined ? false : configsPropertyDef.isSecureConfig;
           serviceConfigObj.belongsToService = configsPropertyDef.belongsToService;
         }
         // MAPREDUCE contains core-site properties but doesn't show them

Modified: incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js?rev=1489615&r1=1489614&r2=1489615&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js Tue Jun  4 21:22:39 2013
@@ -40,6 +40,7 @@ App.ServiceConfigView = Em.View.extend({
   didInsertElement: function () {
     this.$('.service-body').hide();
     $(".restart-required-property").tooltip({html:true});
+    $(".icon-lock").tooltip({placement:'right'});
   }
 });
 
@@ -237,6 +238,11 @@ App.ServiceConfigsByCategoryView = Ember
           serviceConfigObj.id = 'site property';
           serviceConfigObj.serviceName = serviceName;
           var serviceConfigProperty = App.ServiceConfigProperty.create(serviceConfigObj);
+          self.get('controller.secureConfigs').filterProperty('filename',self.get('category.siteFileName')).forEach(function(_secureConfig){
+            if(_secureConfig.name === serviceConfigProperty.get('name')) {
+              serviceConfigProperty.set('isSecureConfig',true);
+            }
+          },this);
           self.get('serviceConfigs').pushObject(serviceConfigProperty);
           this.hide();
         }