Quellcode durchsuchen

Merge branch 'trunk' into branch-alerts-dev

Nate Cole vor 11 Jahren
Ursprung
Commit
03a5be1e19
22 geänderte Dateien mit 49 neuen und 118 gelöschten Zeilen
  1. 1 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
  2. 1 0
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js
  3. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsListCtrl.js
  4. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersListCtrl.js
  5. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js
  6. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html
  7. 2 2
      ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
  8. 2 2
      ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/manageAccess.html
  9. 0 9
      ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html
  10. 1 1
      ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html
  11. 1 1
      ambari-admin/src/main/resources/ui/admin-web/package.json
  12. 1 1
      ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml
  13. 1 0
      ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/metainfo.xml
  14. 7 8
      ambari-web/app/app.js
  15. 2 1
      ambari-web/app/controllers/global/update_controller.js
  16. 13 4
      ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
  17. 4 3
      ambari-web/app/controllers/main/service/info/configs.js
  18. 1 0
      ambari-web/app/data/secure_properties.js
  19. 7 2
      ambari-web/app/models/service_config.js
  20. 1 1
      ambari-web/app/views/main/service/item.js
  21. 0 55
      ambari-web/test/app_test.js
  22. 0 24
      ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js

+ 1 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js

@@ -19,6 +19,7 @@
 
 angular.module('ambariAdminConsole')
 .controller('ViewsEditCtrl', ['$scope', '$routeParams' , 'View', 'uiAlert', 'PermissionLoader', 'PermissionSaver', 'ConfirmationModal', '$location', function($scope, $routeParams, View, uiAlert, PermissionLoader, PermissionSaver, ConfirmationModal, $location) {
+  $scope.identity = angular.identity;
   $scope.isConfigurationEmpty = true;
   function reloadViewInfo(){
     // Load instance data, after View permissions meta loaded

+ 1 - 0
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/clusters/ClustersManageAccessCtrl.js

@@ -19,6 +19,7 @@
 
 angular.module('ambariAdminConsole')
 .controller('ClustersManageAccessCtrl', ['$scope', 'Cluster', '$routeParams', 'uiAlert', 'PermissionLoader', 'PermissionSaver', function($scope, Cluster, $routeParams, uiAlert, PermissionLoader, PermissionSaver) {
+  $scope.identity = angular.identity;
   function reloadClusterData(){
     PermissionLoader.getClusterPermissions({
       clusterId: $routeParams.id

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/groups/GroupsListCtrl.js

@@ -30,7 +30,7 @@ angular.module('ambariAdminConsole')
   $scope.pageChanged = function() {
     loadGroups();
   };
-  $scope.usersPerPageChanges = function() {
+  $scope.groupsPerPageChanges = function() {
     loadGroups();
   };
 

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersListCtrl.js

@@ -30,7 +30,7 @@ angular.module('ambariAdminConsole')
     $scope.loadUsers();
   };
   $scope.usersPerPageChanges = function() {
-    $scope.loadUsers();
+    $scope.resetPagination();
   };
 
   $scope.loadUsers = function(){

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/users/UsersShowCtrl.js

@@ -28,7 +28,7 @@ angular.module('ambariAdminConsole')
   }
 
   loadUserInfo();  
-  $scope.user = {};
+  $scope.user;
   $scope.isCurrentUser = true;
   $scope.dataLoaded = false;
 

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/create.html

@@ -61,7 +61,7 @@
       </div>
       <div class="form-group"
       ng-class="{'has-error' : ( (form.isntanceCreateForm.displayLabel.$error.required || form.isntanceCreateForm.displayLabel.$error.pattern) && form.isntanceCreateForm.submitted)}">
-        <label for="" class="control-label col-sm-2">Display Label</label>
+        <label for="" class="control-label col-sm-2">Display Name</label>
         <div class="col-sm-10">
           <input type="text" class="form-control instancelabel-input" name="displayLabel" ng-model="instance.label" required ng-pattern="/^([a-zA-Z0-9._\s]+)$/" autocomplete="off">
 

+ 2 - 2
ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html

@@ -117,7 +117,7 @@
             <div class="" ng-switch="editPermissionDisabled">
               <textarea name="" id="" cols="30" rows="4" class="form-control permission-textarea-user" ng-model="permissionsEdit[permission.PermissionInfo.permission_name].USER" ng-switch-when="false"></textarea>
               <div class="well" ng-switch-when="true">
-                <span ng-repeat="user in permission.USER">
+                <span ng-repeat="user in permission.USER | orderBy:identity">
                   <link-to route="users.show" id="{{user}}">{{user}}</link-to>
                   {{$last ? '' :', '}}
                 </span>
@@ -128,7 +128,7 @@
             <div class="" ng-switch="editPermissionDisabled">
               <textarea name="" id="" cols="30" rows="4" class="form-control permission-textarea-group" ng-model="permissionsEdit[permission.PermissionInfo.permission_name].GROUP" ng-switch-when="false"></textarea>
               <div class="well" ng-switch-when="true">
-                <span ng-repeat="group in permission.GROUP">
+                <span ng-repeat="group in permission.GROUP | orderBy:identity">
                   <link-to route="groups.edit" id="{{group}}" >{{group}}</link-to>
                   {{$last ? '' :', '}}
                 </span>

+ 2 - 2
ambari-admin/src/main/resources/ui/admin-web/app/views/clusters/manageAccess.html

@@ -41,7 +41,7 @@
           <div class="" ng-switch="isEditMode">
             <textarea ng-switch-when="true" name="" id="" cols="30" rows="4" class="form-control permission-user-input" ng-model="permissionsEdit[permission.PermissionInfo.permission_name].USER"></textarea>
             <div class="well" ng-switch-default>
-              <span ng-repeat="user in permission.USER">
+              <span ng-repeat="user in permission.USER | orderBy:identity">
                 <link-to route="users.show" id="{{user}}" >{{user}}</link-to>
                 {{$last ? '' :', '}}
               </span>
@@ -50,7 +50,7 @@
         </td>
         <td>
           <div class="" ng-switch="isEditMode">
-            <textarea ng-switch-when="true" name="" id="" cols="30" rows="4" class="form-control permission-group-input" ng-model="permissionsEdit[permission.PermissionInfo.permission_name].GROUP"></textarea>
+            <textarea ng-switch-when="true" name="" id="" cols="30" rows="4" class="form-control permission-group-input" ng-model="permissionsEdit[permission.PermissionInfo.permission_name].GROUP | orderBy:identity"></textarea>
             <div class="well" ng-switch-default>
               <span ng-repeat="group in permission.GROUP">
                 <link-to route="groups.edit" id="{{group}}">{{group}}</link-to>

+ 0 - 9
ambari-admin/src/main/resources/ui/admin-web/app/views/groups/list.html

@@ -27,15 +27,6 @@
   <hr>
   <table class="table table-striped table-hover col-sm-12">
     <thead>
-      <!-- <tr>
-        <th>
-          <label for="">Group Name</label>
-        </th>
-        <th>
-          <label for="">Type</label>
-        </th>
-        <th><label for="">Members</label></th>
-      </tr> -->
       <tr>
         <th class="col-sm-8">
           <div class="search-container">

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/app/views/users/show.html

@@ -16,7 +16,7 @@
 * limitations under the License.
 -->
     
-<div ng-show="user.user_name" class="user-edit-panel">
+<div ng-show="user" class="user-edit-panel">
   <div class="clearfix">
     <ol class="breadcrumb pull-left">
       <li><a href="#/users">Users</a></li>

+ 1 - 1
ambari-admin/src/main/resources/ui/admin-web/package.json

@@ -16,7 +16,7 @@
     "gulp-csso": "^0.2.6",
     "gulp-filter": "^0.4.1",
     "gulp-flatten": "^0.0.2",
-    "gulp-imagemin": "^0.5.0",
+    "gulp-imagemin": "^1.0.1",
     "gulp-jshint": "^1.5.3",
     "gulp-livereload": "^1.2.0",
     "gulp-load-plugins": "^0.5.0",

+ 1 - 1
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/metainfo.xml

@@ -30,7 +30,7 @@
           <name>RESOURCEMANAGER</name>
           <displayName>ResourceManager</displayName>
           <category>MASTER</category>
-          <cardinality>1-2</cardinality>
+          <cardinality>1</cardinality>
           <commandScript>
             <script>scripts/resourcemanager.py</script>
             <scriptType>PYTHON</scriptType>

+ 1 - 0
ambari-server/src/main/resources/stacks/HDP/2.1/services/YARN/metainfo.xml

@@ -41,6 +41,7 @@
        <component>
          <name>RESOURCEMANAGER</name>
          <category>MASTER</category>
+         <cardinality>1-2</cardinality>
           <configuration-dependencies>
             <config-type>capacity-scheduler</config-type>
           </configuration-dependencies>

+ 7 - 8
ambari-web/app/app.js

@@ -66,11 +66,6 @@ module.exports = Em.Application.create({
       stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.0") === 0)
   }.property('currentStackVersionNumber'),
 
-  isHadoop21Stack: function () {
-    return (stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.1") === 1 ||
-      stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.1") === 0)
-  }.property('currentStackVersionNumber'),
-
   /**
    * If NameNode High Availability is enabled
    * Based on <code>clusterStatus.isInstalled</code>, stack version, <code>SNameNode</code> availability
@@ -89,9 +84,13 @@ module.exports = Em.Application.create({
    * @type {bool}
    */
   isRMHaEnabled: function () {
-    if (!this.get('isHadoop2Stack')) return false;
-    return this.HostComponent.find().filterProperty('componentName', 'RESOURCEMANAGER').length > 1;
-  }.property('router.clusterController.isLoaded', 'isHadoop2Stack'),
+    var result = false;
+    var rmStackComponent = App.StackServiceComponent.find().findProperty('componentName','RESOURCEMANAGER');
+    if (rmStackComponent && rmStackComponent.get('isMultipleAllowed')) {
+      result = this.HostComponent.find().filterProperty('componentName', 'RESOURCEMANAGER').length > 1;
+    }
+    return result;
+  }.property('router.clusterController.isLoaded'),
 
   /**
    * Object with utility functions for list of service names with similar behavior

+ 2 - 1
ambari-web/app/controllers/global/update_controller.js

@@ -337,12 +337,13 @@ App.UpdateController = Em.Controller.extend({
   updateServiceMetric: function (callback) {
     var self = this;
     self.set('isUpdated', false);
+    var isATSPresent = App.StackServiceComponent.find().findProperty('componentName','APP_TIMELINE_SERVER');
 
     var conditionalFields = this.getConditionalFields(),
       conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',') : '',
       testUrl = App.get('isHadoop2Stack') ? '/data/dashboard/HDP2/master_components.json' : '/data/dashboard/services.json',
       isFlumeInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('FLUME'),
-      isATSInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('YARN') && App.get('isHadoop21Stack'),
+      isATSInstalled = App.cache['services'].mapProperty('ServiceInfo.service_name').contains('YARN') && isATSPresent,
       flumeHandlerParam = isFlumeInstalled ? 'ServiceComponentInfo/component_name=FLUME_HANDLER|' : '',
       atsHandlerParam = isATSInstalled ? 'ServiceComponentInfo/component_name=APP_TIMELINE_SERVER|' : '',
       haComponents = App.get('isHaEnabled') ? 'ServiceComponentInfo/component_name=JOURNALNODE|ServiceComponentInfo/component_name=ZKFC|' : '',

+ 13 - 4
ambari-web/app/controllers/main/admin/serviceAccounts_controller.js

@@ -55,7 +55,7 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
       }
     }
     this.setServiceConfigTags(loadedClusterSiteToTagMap);
-    App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function(configGroups){
+    App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function (configGroups) {
       var configSet = App.config.mergePreDefinedWithLoaded(configGroups, [], self.get('serviceConfigTags'), serviceName);
 
       var misc_configs = configSet.configs.filterProperty('serviceName', self.get('selectedService')).filterProperty('category', 'Users and Groups').filterProperty('isVisible', true);
@@ -64,7 +64,7 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
 
       var sortOrder = self.get('configs').filterProperty('serviceName', self.get('selectedService')).filterProperty('category', 'Users and Groups').filterProperty('isVisible', true).mapProperty('name');
 
-      //stack, with version lower than 2.1, doesn't have Falcon service
+
       self.setProxyUserGroupLabel(misc_configs);
 
       self.set('users', self.sortByOrder(sortOrder, misc_configs));
@@ -120,8 +120,17 @@ App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.ex
    */
   setProxyUserGroupLabel: function (misc_configs) {
     var proxyUserGroup = misc_configs.findProperty('name', 'proxyuser_group');
-    if (proxyUserGroup && !App.get('isHadoop21Stack')) {
-      proxyUserGroup.set('displayName', "Proxy group for Hive, WebHCat and Oozie");
+    //stack, with version lower than 2.1, doesn't have Falcon service
+    if (proxyUserGroup) {
+      var proxyServices = ['HIVE', 'WEBHCAT', 'OOZIE', 'FALCON'];
+      var services = Em.A([]);
+      proxyServices.forEach(function (serviceName) {
+        var stackService = App.StackService.find(serviceName);
+        if (stackService) {
+          services.push(stackService.get('displayName'));
+        }
+      }, this);
+      proxyUserGroup.set('displayName', "Proxy group for " + stringUtils.getFormattedStringFromArray(services));
     }
   }
 });

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

@@ -107,11 +107,11 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
   savedSiteNameToServerServiceConfigDataMap: {},
 
   isSubmitDisabled: function () {
-    return (!(this.stepConfigs.everyProperty('errorCount', 0)) || this.get('isApplyingChanges'));
+    return (!(this.get('stepConfigs').everyProperty('errorCount', 0)) || this.get('isApplyingChanges'));
   }.property('stepConfigs.@each.errorCount', 'isApplyingChanges'),
 
   isPropertiesChanged: function(){
-    return this.stepConfigs.someProperty('isPropertiesChanged', true)
+    return this.get('stepConfigs').someProperty('isPropertiesChanged', true);
   }.property('stepConfigs.@each.isPropertiesChanged'),
 
   slaveComponentGroups: null,
@@ -1033,7 +1033,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
         serviceConfigProperty.set('overrides', parentOverridesArray);
       }
       parentOverridesArray.pushObject(newSCP);
-      console.debug("createOverrideProperty(): Added:", newSCP, " to main-property:", serviceConfigProperty)
+      serviceConfigProperty.set('overrideValues', parentOverridesArray.mapProperty('value'));
+      console.debug("createOverrideProperty(): Added override to main-property:", serviceConfigProperty.get('name'));
     }, this);
   },
 

+ 1 - 0
ambari-web/app/data/secure_properties.js

@@ -123,6 +123,7 @@ module.exports =
       "isOverridable": false,
       "isReconfigurable": false,
       "serviceName": "GENERAL",
+      "filename": "hadoop-env.xml",
       "category": "AMBARI"
     },
     {

+ 7 - 2
ambari-web/app/models/service_config.js

@@ -48,8 +48,8 @@ App.ServiceConfig = Ember.Object.extend({
   }.property('configs.@each.isValid', 'configs.@each.isVisible', 'configCategories.@each.slaveErrorCount', 'configs.@each.overrideErrorTrigger'),
 
   isPropertiesChanged: function() {
-    return this.get('configs').someProperty('isNotDefaultValue', true);
-  }.property('configs.@each.isNotDefaultValue')
+    return this.get('configs').someProperty('isNotDefaultValue') || this.get('configs').someProperty('isOverrideChanged');
+  }.property('configs.@each.isNotDefaultValue', 'configs.@each.isOverrideChanged')
 });
 
 App.ServiceConfigCategory = Ember.Object.extend({
@@ -172,6 +172,7 @@ App.ServiceConfigProperty = Ember.Object.extend({
   parentSCP: null, // This is the main SCP which is overridden by this. Set only when isOriginalSCP is false.
   selectedHostOptions : null, // contain array of hosts configured with overridden value
   overrides : null,
+  overrideValues: [],
   group: null, // Contain group related to this property. Set only when isOriginalSCP is false.
   isUserProperty: null, // This property was added by user. Hence they get removal actions etc.
   isOverridable: true,
@@ -216,6 +217,10 @@ App.ServiceConfigProperty = Ember.Object.extend({
     var overrides = this.get('overrides');
     return (overrides != null && overrides.get('length')>0) || !this.get('isOriginalSCP');
   }.property('overrides', 'overrides.length', 'isOriginalSCP'),
+  isOverrideChanged: function () {
+    if (Em.isNone(this.get('overrides')) && this.get('overrideValues.length') === 0) return false;
+    return JSON.stringify(this.get('overrides').mapProperty('value')) !== JSON.stringify(this.get('overrideValues'));
+  }.property('isOverridden', 'overrides.@each.isNotDefaultValue'),
   isRemovable: function() {
     var isOriginalSCP = this.get('isOriginalSCP');
     var isUserProperty = this.get('isUserProperty');

+ 1 - 1
ambari-web/app/views/main/service/item.js

@@ -84,7 +84,7 @@ App.MainServiceItemView = Em.View.extend({
         action: 'enableRMHighAvailability',
         label: Em.I18n.t('admin.rm_highAvailability.button.enable'),
         cssClass: 'icon-arrow-up',
-        isHidden: !App.get('supports.resourceManagerHighAvailability') || App.get('isRMHaEnabled') || !App.get('isHadoop21Stack')
+        isHidden: !App.get('supports.resourceManagerHighAvailability') || App.get('isRMHaEnabled')
       },
       MOVE_COMPONENT: {
         action: 'reassignMaster',

+ 0 - 55
ambari-web/test/app_test.js

@@ -199,61 +199,6 @@ describe('App', function () {
     });
   });
 
-  describe('#isHadoop21Stack', function () {
-    var tests = [
-      {
-        v: '',
-        e: false
-      },
-      {
-        v: 'HDP',
-        e: false
-      },
-      {
-        v: 'HDP1',
-        e: false
-      },
-      {
-        v: 'HDP-1',
-        e: false
-      },
-      {
-        v: 'HDP-2.0',
-        e: false
-      },
-      {
-        v: 'HDP-2.0.1000',
-        e: false
-      },
-      {
-        v: 'HDP-2.1',
-        e: true
-      },
-      {
-        v: 'HDP-2.1.3434',
-        e: true
-      },
-      {
-        v: 'HDP-2.2',
-        e: true
-      },
-      {
-        v: 'HDP-2.2.1212',
-        e: true
-      }
-    ];
-    tests.forEach(function (test) {
-      it(test.v, function () {
-        App.QuickViewLinks.prototype.setQuickLinks = function () {
-        };
-        App.set('currentStackVersion', test.v);
-        var calculated = App.get('isHadoop21Stack');
-        var expected = test.e;
-        expect(calculated).to.equal(expected);
-      });
-    });
-  });
-
   describe('#isHaEnabled', function () {
 
     it('if hadoop stack version less than 2 then isHaEnabled should be false', function () {

+ 0 - 24
ambari-web/test/controllers/main/admin/serviceAccounts_controller_test.js

@@ -194,29 +194,5 @@ describe('App.MainAdminServiceAccountsController', function () {
       controller.setProxyUserGroupLabel(misc_configs);
       expect(misc_configs.findProperty('name', 'proxyuser_group')).to.be.undefined;
     });
-    it('proxyuser_group config defined and isHadoop21Stack is true', function () {
-      var misc_configs = [Em.Object.create({
-        name: 'proxyuser_group',
-        displayName: 'test'
-      })];
-      sinon.stub(App, 'get', function(){
-        return true;
-      });
-      controller.setProxyUserGroupLabel(misc_configs);
-      expect(misc_configs.findProperty('name', 'proxyuser_group').get('displayName')).to.equal('test');
-      App.get.restore();
-    });
-    it('proxyuser_group config defined and isHadoop21Stack is false', function () {
-      var misc_configs = [Em.Object.create({
-        name: 'proxyuser_group',
-        displayName: 'test'
-      })];
-      sinon.stub(App, 'get', function(){
-        return false;
-      });
-      controller.setProxyUserGroupLabel(misc_configs);
-      expect(misc_configs.findProperty('name', 'proxyuser_group').get('displayName')).to.equal('Proxy group for Hive, WebHCat and Oozie');
-      App.get.restore();
-    });
   })
 });