Browse Source

AMBARI-6787. Cleanup of Cluster > Admin tab. (xiwang via yusaku)

Yusaku Sako 11 years ago
parent
commit
4333374025
30 changed files with 57 additions and 895 deletions
  1. 2 5
      ambari-web/app/controllers.js
  2. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/nameNode/step1_controller.js
  3. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/nameNode/step4_controller.js
  4. 1 1
      ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
  5. 2 2
      ambari-web/app/controllers/main/admin/repositories.js
  6. 2 2
      ambari-web/app/controllers/main/admin/serviceAccounts_controller.js
  7. 0 76
      ambari-web/app/controllers/main/admin/user.js
  8. 0 24
      ambari-web/app/controllers/main/admin/user/create.js
  9. 0 24
      ambari-web/app/controllers/main/admin/user/edit.js
  10. 1 1
      ambari-web/app/controllers/wizard.js
  11. 2 0
      ambari-web/app/messages.js
  12. 9 75
      ambari-web/app/routes/main.js
  13. 0 29
      ambari-web/app/templates/main/admin/access.hbs
  14. 0 0
      ambari-web/app/templates/main/admin/repositories.hbs
  15. 0 0
      ambari-web/app/templates/main/admin/serviceAccounts.hbs
  16. 0 42
      ambari-web/app/templates/main/admin/user.hbs
  17. 0 43
      ambari-web/app/templates/main/admin/user/create.hbs
  18. 0 38
      ambari-web/app/templates/main/admin/user/edit.hbs
  19. 0 27
      ambari-web/app/templates/main/admin/user/row.hbs
  20. 2 8
      ambari-web/app/views.js
  21. 15 26
      ambari-web/app/views/main/admin.js
  22. 0 23
      ambari-web/app/views/main/admin/access_view.js
  23. 0 89
      ambari-web/app/views/main/admin/menu.js
  24. 2 2
      ambari-web/app/views/main/admin/repositories.js
  25. 2 2
      ambari-web/app/views/main/admin/serviceAccounts_view.js
  26. 0 37
      ambari-web/app/views/main/admin/user.js
  27. 0 129
      ambari-web/app/views/main/admin/user/create.js
  28. 0 137
      ambari-web/app/views/main/admin/user/edit.js
  29. 0 24
      ambari-web/app/views/main/admin/user/row.js
  30. 15 27
      ambari-web/app/views/main/menu.js

+ 2 - 5
ambari-web/app/controllers.js

@@ -51,13 +51,10 @@ require('controllers/main/admin/highAvailability/resourceManager/step1_controlle
 require('controllers/main/admin/highAvailability/resourceManager/step2_controller');
 require('controllers/main/admin/highAvailability/resourceManager/step3_controller');
 require('controllers/main/admin/highAvailability/resourceManager/step4_controller');
-require('controllers/main/admin/cluster');
+require('controllers/main/admin/repositories');
 require('controllers/main/admin/stack_upgrade_controller');
-require('controllers/main/admin/user');
-require('controllers/main/admin/misc_controller');
+require('controllers/main/admin/serviceAccounts_controller');
 require('controllers/main/admin/access_controller');
-require('controllers/main/admin/user/edit');
-require('controllers/main/admin/user/create');
 require('controllers/main/admin/advanced');
 require('utils/polling');
 require('controllers/main/admin/security');

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/nameNode/step1_controller.js

@@ -18,7 +18,7 @@
 
 var App = require('app');
 
-require('controllers/main/admin/misc_controller');
+require('controllers/main/admin/serviceAccounts_controller');
 
 App.HighAvailabilityWizardStep1Controller = Em.Controller.extend({
   name: "highAvailabilityWizardStep1Controller",

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/nameNode/step4_controller.js

@@ -18,7 +18,7 @@
 
 var App = require('app');
 
-require('controllers/main/admin/misc_controller');
+require('controllers/main/admin/serviceAccounts_controller');
 
 App.HighAvailabilityWizardStep4Controller = Em.Controller.extend({
 

+ 1 - 1
ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js

@@ -18,7 +18,7 @@
 
 var App = require('app');
 
-require('controllers/main/admin/misc_controller');
+require('controllers/main/admin/serviceAccounts_controller');
 
 App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageController.extend({
 

+ 2 - 2
ambari-web/app/controllers/main/admin/cluster.js → ambari-web/app/controllers/main/admin/repositories.js

@@ -19,8 +19,8 @@
 var App = require('app');
 var stringUtils = require('utils/string_utils');
 
-App.MainAdminClusterController = Em.Controller.extend({
-  name: 'mainAdminClusterController',
+App.MainAdminRepositoriesController = Em.Controller.extend({
+  name: 'mainAdminRepositoriesController',
   services: [],
   allRepos: [],
   upgradeVersion: '',

+ 2 - 2
ambari-web/app/controllers/main/admin/misc_controller.js → ambari-web/app/controllers/main/admin/serviceAccounts_controller.js

@@ -21,8 +21,8 @@ var stringUtils = require('utils/string_utils');
 
 require('controllers/main/service/info/configs');
 
-App.MainAdminMiscController = App.MainServiceInfoConfigsController.extend({
-  name: 'mainAdminMiscController',
+App.MainAdminServiceAccountsController = App.MainServiceInfoConfigsController.extend({
+  name: 'mainAdminServiceAccountsController',
   users: null,
   content: Em.Object.create({
     serviceName: 'MISC'

+ 0 - 76
ambari-web/app/controllers/main/admin/user.js

@@ -1,76 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminUserController = Em.Controller.extend({
-
-  name: 'mainAdminUserController',
-
-  /**
-   * Send request to the server to delete user if selected user is not current user
-   * @param {object} event
-   * @method deleteRecord
-   */
-  deleteRecord: function (event) {
-    var self = this;
-    if (event.context.get('userName') == App.get('router').getLoginName()) {
-      App.ModalPopup.show({
-        header: Em.I18n.t('admin.users.delete.yourself.header'),
-        body: Em.I18n.t('admin.users.delete.yourself.message'),
-        secondary: false
-      });
-      return;
-    }
-
-    App.ModalPopup.show({
-      header: Em.I18n.t('admin.users.delete.header').format(event.context.get('userName')),
-      body: Em.I18n.t('question.sure').format(''),
-      primary: Em.I18n.t('yes'),
-      secondary: Em.I18n.t('no'),
-
-      onPrimary: function () {
-        App.ajax.send({
-          name: 'common.delete.user',
-          sender: self,
-          data: {
-            user: event.context.get("userName"),
-            event: event
-          },
-          success: 'deleteUserSuccessCallback'
-        });
-        this.hide();
-      }
-    });
-  },
-
-  /**
-   * Success callback for delete user request
-   * @param {object} data
-   * @param {object} opt
-   * @param {object} params
-   * @method deleteUserSuccessCallback
-   */
-  deleteUserSuccessCallback: function (data, opt, params) {
-    params.event.context.deleteRecord();
-    try {
-      App.store.commit();
-    } catch (err) {
-    }
-  }
-});

+ 0 - 24
ambari-web/app/controllers/main/admin/user/create.js

@@ -1,24 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminUserCreateController = Em.Controller.extend({
-  name:'mainAdminUserCreateController',
-  content:false
-});

+ 0 - 24
ambari-web/app/controllers/main/admin/user/edit.js

@@ -1,24 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminUserEditController = App.MainAdminUserController.extend({
-  name:'mainAdminUserEditController',
-  content:false
-});

+ 1 - 1
ambari-web/app/controllers/wizard.js

@@ -742,7 +742,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, {
   usersLoading: function () {
     var self = this;
     var dfd = $.Deferred();
-    var miscController = App.MainAdminMiscController.create({content: self.get('content')});
+    var miscController = App.MainAdminServiceAccountsController.create({content: self.get('content')});
     miscController.loadUsers();
     var interval = setInterval(function () {
       if (miscController.get('dataIsLoaded')) {

+ 2 - 0
ambari-web/app/messages.js

@@ -148,6 +148,8 @@ Em.I18n.translations = {
   'common.reUpgrade': 'Retry Upgrade',
   'common.security':'Security',
   'common.cluster':'Cluster',
+  'common.repositories':'Repositories',
+  'common.serviceAccounts': 'Service Accounts',
   'common.add': 'Add',
   'common.edit': 'Edit',
   'common.delete': 'Delete',

+ 9 - 75
ambari-web/app/routes/main.js

@@ -355,63 +355,9 @@ module.exports = Em.Route.extend({
        router.transitionTo('admin' + controller.get('category').capitalize());
        }, */
       route: '/',
-      redirectsTo: 'adminUser'
+      redirectsTo: 'adminRepositories'
     }),
 
-
-    adminUser: Em.Route.extend({
-      route: '/user',
-      index: Em.Route.extend({
-        route: '/',
-        redirectsTo: 'allUsers'
-      }),
-      enter: function (router) {
-        router.set('mainAdminController.category', "user");
-        Em.run.next(function () {
-          router.transitionTo('allUsers');
-        });
-      },
-      routePath: function (router, event) {
-        router.set('mainAdminController.category', "user");
-        router.transitionTo('allUsers');
-        Em.run.next(function () {
-          router.transitionTo('allUsers');
-        });
-      },
-      // events
-      gotoUsers: Em.Router.transitionTo("allUsers"),
-      gotoCreateUser: Em.Router.transitionTo("createUser"),
-      gotoEditUser: function (router, event) {
-        router.transitionTo("editUser", event.context)
-      },
-
-      // states
-      allUsers: Em.Route.extend({
-        route: '/allUsers',
-        // index: Ember.Route.extend({
-        //route: '/',
-        connectOutlets: function (router) {
-          router.get('mainAdminController').connectOutlet('mainAdminUser');
-        }
-        //})
-      }),
-
-      createUser: Em.Route.extend({
-        route: '/create',
-        connectOutlets: function (router) {
-          router.get('mainAdminController').connectOutlet('mainAdminUserCreate', {});
-        }
-      }),
-
-      editUser: Em.Route.extend({
-        route: '/edit/:user_id',
-        connectOutlets: function (router, user) {
-          router.get('mainAdminController').connectOutlet('mainAdminUserEdit', user);
-        }
-      })
-    }),
-
-
     adminAuthentication: Em.Route.extend({
       route: '/authentication',
       connectOutlets: function (router, context) {
@@ -553,11 +499,11 @@ module.exports = Em.Route.extend({
       adminAddSecurity: require('routes/add_security')
     }),
 
-    adminCluster: Em.Route.extend({
-      route: '/cluster',
+    adminRepositories: Em.Route.extend({
+      route: '/repositories',
       connectOutlets: function (router) {
-        router.set('mainAdminController.category', "cluster");
-        router.get('mainAdminController').connectOutlet('mainAdminCluster');
+        router.set('mainAdminController.category', "repositories");
+        router.get('mainAdminController').connectOutlet('mainAdminRepositories');
       }
     }),
     adminAdvanced: Em.Route.extend({
@@ -567,23 +513,11 @@ module.exports = Em.Route.extend({
         router.get('mainAdminController').connectOutlet('mainAdminAdvanced');
       }
     }),
-    adminMisc: Em.Route.extend({
-      route: '/misc',
-      connectOutlets: function (router) {
-        router.set('mainAdminController.category', "misc");
-        router.get('mainAdminController').connectOutlet('mainAdminMisc');
-      }
-    }),
-    adminAccess: Em.Route.extend({
-      enter: function (router) {
-        router.get('mainController').dataLoading().done(function () {
-          if (!router.get('mainAdminController.isAccessAvailable')) router.transitionTo('adminUser.allUsers');
-        });
-      },
-      route: '/access',
+    adminServiceAccounts: Em.Route.extend({
+      route: '/serviceAccounts',
       connectOutlets: function (router) {
-        router.set('mainAdminController.category', "access");
-        router.get('mainAdminController').connectOutlet('mainAdminAccess');
+        router.set('mainAdminController.category', "serviceAccounts");
+        router.get('mainAdminController').connectOutlet('mainAdminServiceAccounts');
       }
     }),
 

+ 0 - 29
ambari-web/app/templates/main/admin/access.hbs

@@ -1,29 +0,0 @@
-{{!
-* 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.
-}}
-<div id="access">
-  <div class="header">
-      <strong>{{t common.access}}</strong>
-  </div>
-  <div class="acces-values">
-  </div>
-  <div class="control-group">
-      <div class="controls">
-          <button type="submit" class="btn btn-primary" {{action save target="controller"}}>{{t common.save}}</button>
-      </div>
-  </div>
-</div>

+ 0 - 0
ambari-web/app/templates/main/admin/cluster.hbs → ambari-web/app/templates/main/admin/repositories.hbs


+ 0 - 0
ambari-web/app/templates/main/admin/misc.hbs → ambari-web/app/templates/main/admin/serviceAccounts.hbs


+ 0 - 42
ambari-web/app/templates/main/admin/user.hbs

@@ -1,42 +0,0 @@
-{{!
-* 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.
-}}
-
-{{#if view.ldapUser}}
-<p class="text-info">{{t admin.users.ldapAuthUsed}}.</p>
-{{else}}
-<table class="table table-bordered table-striped span6">
-  <thead>
-  <tr>
-    <th style="width:50%">{{t admin.users.username}}</th>
-    <th style="width:10%">{{t admin.users.privileges}}</th>
-    <th style="width:20%">{{t admin.users.type}}</th>
-    <th style="width:20%">{{t admin.users.action}}</th>
-  </tr>
-  </thead>
-  <tbody>
-  {{#each user in view.users}}
-  {{view App.MainAdminUserRowView userBinding="user"}}
-  {{/each}}
-  </tbody>
-</table>
-<div class="span2">
-  <button class="btn" {{action gotoCreateUser on="click"}} >
-    <i class="icon-plus"></i>{{t admin.users.addButton}}
-  </button>
-</div>
-{{/if}}

+ 0 - 43
ambari-web/app/templates/main/admin/user/create.hbs

@@ -1,43 +0,0 @@
-{{!
-* 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.
-}}
-
-<form class="form-horizontal" autocomplete="off">
-  {{#each field in view.userForm.fields}}
-  {{#unless field.isHidden}}
-  <div {{bindAttr class="field.errorMessage:error field.warnMessage:warning :control-group"}}>
-    <label class="control-label" for="input{{unbound field.name}}">{{unbound field.displayName}}</label>
-    <div class="controls">
-        {{view field.viewClass valueBinding="field.value" disabledBinding="field.disabled"}}
-      {{#if field.errorMessage}}
-        <span class="help-inline">{{field.errorMessage}}</span>
-      {{/if}}
-      {{#if field.warnMessage}}
-        <span class="help-inline">{{field.warnMessage}}</span>
-      {{/if}}
-    </div>
-  </div>
-  {{/unless}}
-  {{/each}}
-  <div class="control-group">
-    <div class="controls">
-      <button type="submit" class="btn" {{action gotoUsers}}>{{t form.cancel}}</button>
-      <button type="submit"
-              class="btn btn-primary" {{action create target="view"}}>Create</button>
-    </div>
-  </div>
-</form>

+ 0 - 38
ambari-web/app/templates/main/admin/user/edit.hbs

@@ -1,38 +0,0 @@
-{{!
-* 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.
-}}
-
-<form class="form-horizontal" autocomplete="off">
-  {{#each field in view.userForm.fields}}
-  {{#unless field.isHidden}}
-  <div {{bindAttr class="field.errorMessage:error :control-group"}}>
-    <label class="control-label" for="input{{unbound field.name}}">{{unbound field.displayName}}</label>
-    <div class="controls">
-        {{view field.viewClass valueBinding="field.value" disabledBinding="field.disabled"}}
-      <span class="help-inline">{{field.errorMessage}}</span>
-    </div>
-  </div>
-  {{/unless}}
-  {{/each}}
-  <div class="control-group">
-    <div class="controls">
-      <button type="submit" class="btn" {{action gotoUsers}}>{{t form.cancel}}</button>
-      <button type="submit"
-              class="btn btn-primary" {{action edit target="view"}}>{{t common.save}}</button>
-    </div>
-  </div>
-</form>

+ 0 - 27
ambari-web/app/templates/main/admin/user/row.hbs

@@ -1,27 +0,0 @@
-{{!
-* 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.
-}}
-
-<tr>
-  <td>{{user.userName}}</td>
-  <td>{{view Ember.Checkbox disabledBinding="view.disableCheckBoxes" checkedBinding="user.admin"}}</td>
-  <td>{{user.type}}</td>
-  <td>
-    <a href="#" {{action gotoEditUser user on="click"}}>{{t admin.users.edit}}</a>&nbsp;
-    <a href="#" {{action deleteRecord user target="App.router.mainAdminUserController" }}>{{t admin.users.delete}}</a>
-  </td>
-</tr>

+ 2 - 8
ambari-web/app/views.js

@@ -87,19 +87,13 @@ require('views/main/admin/highAvailability/resourceManager/step1_view');
 require('views/main/admin/highAvailability/resourceManager/step2_view');
 require('views/main/admin/highAvailability/resourceManager/step3_view');
 require('views/main/admin/highAvailability/resourceManager/step4_view');
-require('views/main/admin/cluster');
-require('views/main/admin/misc_view');
+require('views/main/admin/repositories');
+require('views/main/admin/serviceAccounts_view');
 require('views/main/admin/stack_upgrade');
 require('views/main/admin/advanced');
-require('views/main/admin/access_view');
 require('views/main/admin/advanced/password');
 require('views/main/admin/audit');
 require('views/main/admin/authentication');
-require('views/main/admin/menu');
-require('views/main/admin/user');
-require('views/main/admin/user/create');
-require('views/main/admin/user/edit');
-require('views/main/admin/user/row');
 require('views/main/admin/security');
 require('views/main/admin/security/disable');
 require('views/main/admin/security/add/menu');

+ 15 - 26
ambari-web/app/views/main/admin.js

@@ -22,18 +22,17 @@ App.MainAdminView = Em.View.extend({
   templateName: require('templates/main/admin'),
   selectedBinding: 'controller.category',
   categories: function() {
-    var items = [{
-      name: 'user',
-      url: 'admin.index',
-      label: Em.I18n.t('common.users')
-    }];
-    if (App.get('isHadoop2Stack') && App.supports.highAvailability) {
-      items.push({
-        name: 'highAvailability',
-        url: 'adminHighAvailability',
-        label: Em.I18n.t('admin.highAvailability')
-      });
-    }
+    var items = [];
+    items.push({
+      name: 'repositories',
+      url: 'adminRepositories',
+      label: Em.I18n.t('common.repositories')
+    });
+    items.push({
+      name: 'serviceAccounts',
+      url: 'adminServiceAccounts',
+      label: Em.I18n.t('common.serviceAccounts')
+    });
     if (App.supports.secureCluster) {
       items.push({
         name: 'security',
@@ -41,21 +40,11 @@ App.MainAdminView = Em.View.extend({
         label: Em.I18n.t('common.security')
       });
     }
-    items.push({
-      name: 'cluster',
-      url: 'adminCluster',
-      label: Em.I18n.t('common.cluster')
-    });
-    items.push({
-      name: 'misc',
-      url: 'adminMisc',
-      label: Em.I18n.t('common.misc')
-    });
-    if (this.get('controller.isAccessAvailable')) {
+    if (App.get('isHadoop2Stack') && App.supports.highAvailability) {
       items.push({
-        name: 'access',
-        url: 'adminAccess',
-        label: Em.I18n.t('common.access')
+        name: 'highAvailability',
+        url: 'adminHighAvailability',
+        label: Em.I18n.t('admin.highAvailability')
       });
     }
     return items;

+ 0 - 23
ambari-web/app/views/main/admin/access_view.js

@@ -1,23 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminAccessView = Em.View.extend({
-  templateName: require('templates/main/admin/access')
-});

+ 0 - 89
ambari-web/app/views/main/admin/menu.js

@@ -1,89 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-// This logic is substituted by MainAdminView for now.
-App.MainAdminMenuView = Em.CollectionView.extend({
-  //contentBinding: 'controller',
-  /*content: [
-    {
-      route:'user',
-      label:'Users'
-    },
-    {
-      route:'security',
-      label:'Security'
-    },
-    {
-      route:'cluster',
-      label:'Cluster'
-    }
-    /*,
-    {
-      route:'authentication',
-      label:'Authentication'
-    },
-
-{
-      route: 'user',
-      label: 'Users'
-
-    },
-    {
-      route: 'security',
-      label: 'Security'
-    }/*,
-     {
-     route:'authentication',
-     label:'Authentication'
-     },
-
-     {
-     route:'audit',
-     label:'Audit'
-     }*/
-    /*,
-     {
-     route:'advanced',
-     label:'Advanced'
-     }
-
-  ],
-  tagName: "ul",
-  classNames: ["nav", "nav-list"],
-
-  init: function () {
-    this._super();
-    this.activateView(); // default selected menu
-  },
-
-  activateView: function () {
-    var route = App.get('router.mainAdminController.category');
-    $.each(this._childViews, function () {
-      this.set('active', (this.get('content.route') == route ? "active" : ""));
-    });
-  }.observes('App.router.mainAdminController.category'),
-
-  itemViewClass:Em.View.extend({
-    classNameBindings:["active"],
-    active:"",
-    template:Ember.Handlebars.compile('<a class="text-center" {{action adminNavigate view.content.route }} href="#"> {{unbound view.content.label}}</a>')
-  })
-*/
-});

+ 2 - 2
ambari-web/app/views/main/admin/cluster.js → ambari-web/app/views/main/admin/repositories.js

@@ -19,8 +19,8 @@
 var App = require('app');
 var stringUtils = require('utils/string_utils');
 
-App.MainAdminClusterView = Em.View.extend({
-  templateName: require('templates/main/admin/cluster'),
+App.MainAdminRepositoriesView = Em.View.extend({
+  templateName: require('templates/main/admin/repositories'),
 
   isUpgradeAvailable: function(){
     return stringUtils.compareVersions(this.get('controller.upgradeVersion').replace(/HDP(Local)?-/, ''), App.get('currentStackVersionNumber')) === 1;

+ 2 - 2
ambari-web/app/views/main/admin/misc_view.js → ambari-web/app/views/main/admin/serviceAccounts_view.js

@@ -18,8 +18,8 @@
 
 var App = require('app');
 
-App.MainAdminMiscView = Em.View.extend({
-  templateName: require('templates/main/admin/misc'),
+App.MainAdminServiceAccountsView = Em.View.extend({
+  templateName: require('templates/main/admin/serviceAccounts'),
   didInsertElement: function() {
     this.get('controller').loadUsers();
   }

+ 0 - 37
ambari-web/app/views/main/admin/user.js

@@ -1,37 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminUserView = Em.View.extend({
-  templateName: require('templates/main/admin/user'),
-  users: App.User.find(),
-  delete: function(event, context){
-    console.log("EVENT:");
-    console.log(event);
-
-    console.log("CONTEXT:");
-    console.log(context);
-  },
-  ldapUser: function(){
-    var auth = App.router.get('mainAdminAuthenticationController.content');
-    return auth.get('method');
-  }.property('App.router.mainAdminAuthenticationController.content')
-
-
-});

+ 0 - 129
ambari-web/app/views/main/admin/user/create.js

@@ -1,129 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminUserCreateView = Em.View.extend({
-
-  templateName: require('templates/main/admin/user/create'),
-
-  /**
-   * Form for new user
-   * @type {App.CreateUserForm}
-   */
-  userForm: App.CreateUserForm.create({}),
-
-  /**
-   * @type {number|bool}
-   */
-  userId: false,
-
-  /**
-   * @type {bool}
-   */
-  isPasswordDirty: false,
-
-  /**
-   * Create new user
-   * @return {Boolean}
-   */
-  create: function () {
-    var form = this.get("userForm");
-    if (!form.isValid())  return false;
-
-    return !!App.ajax.send({
-      name: 'admin.user.create',
-      sender: this,
-      data: {
-        user: form.getField("userName").get('value'),
-        form: form,
-        data: {
-          Users: {
-            password: form.getField("password").get('value')
-          }
-        }
-      },
-      success: 'createUserSuccessCallback',
-      error: 'createUserErrorCallback'
-    });
-  },
-
-  /**
-   * Success-callback for create user request
-   * @param {object} data
-   * @param {object} opts
-   * @param {object} params
-   * @method createUserSuccessCallback
-   */
-  createUserSuccessCallback: function (data, opts, params) {
-    App.ModalPopup.show({
-      header: Em.I18n.t('admin.users.addButton'),
-      body: Em.I18n.t('admin.users.createSuccess'),
-      secondary: null
-    });
-    var persists = App.router.get('applicationController').persistKey(params.form.getField("userName").get('value'));
-    App.router.get('applicationController').postUserPref(persists, true);
-    params.form.save();
-    App.router.transitionTo("allUsers");
-  },
-
-  /**
-   * Error callback for create used request
-   * @method createUserErrorCallback
-   */
-  createUserErrorCallback: function () {
-    App.ModalPopup.show({
-      header: Em.I18n.t('admin.users.addButton'),
-      body: Em.I18n.t('admin.users.createError'),
-      secondary: null
-    });
-  },
-
-  /**
-   * Submit form by Enter-click
-   * @param {object} event
-   * @returns {bool}
-   * @method keyPress
-   */
-  keyPress: function (event) {
-    if (event.keyCode === 13) {
-      this.create();
-      return false;
-    }
-    return true;
-  },
-
-  /**
-   * Validate password value
-   * @method passwordValidation
-   */
-  passwordValidation: function () {
-    var passwordValue = this.get('userForm').getField('password').get('value');
-    if (passwordValue && !this.get('isPasswordDirty')) {
-      this.set('isPasswordDirty', true);
-    }
-    if (this.get('isPasswordDirty')) {
-      this.get('userForm').isValid();
-      this.get('userForm').isWarn();
-    }
-  }.observes('userForm.fields.@each.value'),
-
-  didInsertElement: function () {
-    this.get('userForm').propertyDidChange('object');
-  }
-});

+ 0 - 137
ambari-web/app/views/main/admin/user/edit.js

@@ -1,137 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminUserEditView = Em.View.extend({
-
-  templateName: require('templates/main/admin/user/edit'),
-
-  /**
-   * @type {bool}
-   */
-  userId: false,
-
-  /**
-   * Form to edit existing user
-   * @type {App.EditUserForm}
-   */
-  userForm: App.EditUserForm.create({}),
-
-  /**
-   * Edit existing user
-   * @method edit
-   * @return {Boolean}
-   */
-  edit: function () {
-    var form = this.get("userForm");
-    if (!form.isValid()) return false;
-
-    var Users = {};
-
-    this.setPassword(Users, form);
-
-    return !!App.ajax.send({
-      name: 'admin.user.edit',
-      sender: this,
-      data: {
-        form: form,
-        user: form.getField("userName").get('value'),
-        data: JSON.stringify({
-          Users: Users
-        })
-      },
-      success: 'editUserSuccessCallback',
-      error: 'editUserErrorCallback'
-    });
-  },
-
-  /**
-   * set password to query data if it's not empty string
-   * @param Users
-   * @param form
-   * @return {Boolean}
-   */
-  setPassword: function (Users, form) {
-    if (form.getField("new_password").get('value') != "" && form.getField("old_password").get('value') != "") {
-      Users.password = form.getField("new_password").get('value');
-      Users.old_password = form.getField("old_password").get('value');
-      return true;
-    }
-    return false;
-  },
-
-  /**
-   * Success callback for edit user request
-   * @param {object} data
-   * @param {object} opt
-   * @param {object} params
-   * @method editUserSuccessCallback
-   */
-  editUserSuccessCallback: function (data, opt, params) {
-    params.form.save();
-    App.router.transitionTo("allUsers");
-  },
-
-  /**
-   * Error callback for edit user request
-   * @param {object} request
-   * @method editUserErrorCallback
-   */
-  editUserErrorCallback: function (request) {
-    App.ModalPopup.show({
-      header: Em.I18n.t('admin.users.editButton'),
-      body: this.parseErrorMessage(request),
-      secondary: null
-    });
-  },
-
-  /**
-   * derive only valuable info from response,
-   * return content after last ":"
-   * @param request
-   * @return {String}
-   */
-  parseErrorMessage: function (request) {
-    var message = JSON.parse(request.responseText).message;
-    return message.substr(message.lastIndexOf(':') + 1);
-  },
-
-  /**
-   * Submit form by Enter-click
-   * @param {object} event
-   * @returns {bool}
-   * @method keyPress
-   */
-  keyPress: function (event) {
-    if (event.keyCode === 13) {
-      this.edit();
-      return false;
-    }
-    return true;
-  },
-
-  didInsertElement: function () {
-    var form = this.get('userForm');
-    var isLdapValue = form.getField("isLdap").get("value");
-    form.getField("old_password").set("disabled", isLdapValue);
-    form.getField("new_password").set("disabled", isLdapValue);
-    form.getField("new_passwordRetype").set("disabled", isLdapValue);
-    form.propertyDidChange('object');
-  }
-});

+ 0 - 24
ambari-web/app/views/main/admin/user/row.js

@@ -1,24 +0,0 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-App.MainAdminUserRowView = Em.View.extend({
-  templateName: require('templates/main/admin/user/row'),
-  disableCheckBoxes: "disabled"
-});

+ 15 - 27
ambari-web/app/views/main/menu.js

@@ -135,18 +135,17 @@ App.MainMenuView = Em.CollectionView.extend({
       var categories = [];
       // create dropdown categories for each menu item
       if (itemName == 'admin') {
-        categories = [{
-          name: 'user',
-          url: 'adminUser',
-          label: Em.I18n.t('common.users')
-        }];
-        if (App.get('isHadoop2Stack') && App.supports.highAvailability) {
-          categories.push({
-            name: 'highAvailability',
-            url: 'adminHighAvailability',
-            label: Em.I18n.t('admin.highAvailability')
-          });
-        }
+        categories = [];
+        categories.push({
+          name: 'repositories',
+          url: 'adminRepositories',
+          label: Em.I18n.t('common.repositories')
+        });
+        categories.push({
+          name: 'serviceAccounts',
+          url: 'adminServiceAccounts',
+          label: Em.I18n.t('common.serviceAccounts')
+        });
         if (App.supports.secureCluster) {
           categories.push({
             name: 'security',
@@ -154,26 +153,15 @@ App.MainMenuView = Em.CollectionView.extend({
             label: Em.I18n.t('common.security')
           });
         }
-        categories.push({
-          name: 'cluster',
-          url: 'adminCluster',
-          label: Em.I18n.t('common.cluster')
-        });
-        categories.push({
-          name: 'misc',
-          url: 'adminMisc',
-          label: Em.I18n.t('common.misc')
-        });
-        if (App.router.get('mainAdminController.isAccessAvailable')) {
+        if (App.get('isHadoop2Stack') && App.supports.highAvailability) {
           categories.push({
-            name: 'access',
-            url: 'adminAccess',
-            label: Em.I18n.t('common.access')
+            name: 'highAvailability',
+            url: 'adminHighAvailability',
+            label: Em.I18n.t('admin.highAvailability')
           });
         }
       }
       return categories;
-
     }.property('')
   })
 });