Repository: ambari Updated Branches: refs/heads/trunk 7ade22258 -> 2b1437c4c
AMBARI-15306. Admin tab and left menu disappeared during Upgrade.(xiwang) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2b1437c4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2b1437c4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2b1437c4 Branch: refs/heads/trunk Commit: 2b1437c4cc5369db09774cb0ca3ec8c29e6e9db4 Parents: 7ade222 Author: Xi Wang <[email protected]> Authored: Fri Mar 4 15:44:47 2016 -0800 Committer: Xi Wang <[email protected]> Committed: Fri Mar 4 15:44:54 2016 -0800 ---------------------------------------------------------------------- ambari-web/app/routes/main.js | 5 +++-- ambari-web/app/views/main/admin.js | 8 ++++---- ambari-web/app/views/main/menu.js | 11 ++++++----- 3 files changed, 13 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/2b1437c4/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index 419f845..a531845 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -346,7 +346,8 @@ module.exports = Em.Route.extend(App.RouterRedirections, { admin: Em.Route.extend({ route: '/admin', enter: function (router, transition) { - if (router.get('loggedIn') && !App.isAuthorized('CLUSTER.TOGGLE_KERBEROS, AMBARI.SET_SERVICE_USERS_GROUPS, CLUSTER.UPGRADE_DOWNGRADE_STACK, CLUSTER.VIEW_STACK_DETAILS')) { + if (router.get('loggedIn') && !App.isAuthorized('CLUSTER.TOGGLE_KERBEROS, AMBARI.SET_SERVICE_USERS_GROUPS, CLUSTER.UPGRADE_DOWNGRADE_STACK, CLUSTER.VIEW_STACK_DETAILS') + && !(App.get('upgradeInProgress') || App.get('upgradeHolding'))) { Em.run.next(function () { router.transitionTo('main.dashboard.index'); }); @@ -354,7 +355,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, { }, routePath: function (router, event) { - if (!App.isAuthorized('CLUSTER.UPGRADE_DOWNGRADE_STACK')) { + if (!App.isAuthorized('CLUSTER.UPGRADE_DOWNGRADE_STACK') && !(App.get('upgradeInProgress') || App.get('upgradeHolding'))) { Em.run.next(function () { App.router.transitionTo('main.dashboard.index'); }); http://git-wip-us.apache.org/repos/asf/ambari/blob/2b1437c4/ambari-web/app/views/main/admin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js index fc186d8..2b111b6 100644 --- a/ambari-web/app/views/main/admin.js +++ b/ambari-web/app/views/main/admin.js @@ -23,28 +23,28 @@ App.MainAdminView = Em.View.extend({ selectedBinding: 'controller.category', categories: function() { var items = []; - if(App.isAuthorized('CLUSTER.VIEW_STACK_DETAILS, CLUSTER.UPGRADE_DOWNGRADE_STACK')) { + if(App.isAuthorized('CLUSTER.VIEW_STACK_DETAILS, CLUSTER.UPGRADE_DOWNGRADE_STACK') || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { items.push({ name: 'stackAndUpgrade', url: 'stackAndUpgrade.index', label: Em.I18n.t('admin.stackUpgrade.title') }); } - if(App.isAuthorized('AMBARI.SET_SERVICE_USERS_GROUPS')) { + if(App.isAuthorized('AMBARI.SET_SERVICE_USERS_GROUPS') || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { items.push({ name: 'adminServiceAccounts', url: 'adminServiceAccounts', label: Em.I18n.t('common.serviceAccounts') }); } - if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS')) { + if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS') || (App.get('upgradeInProgress') || App.get('upgradeHolding')) ) { items.push({ name: 'kerberos', url: 'adminKerberos.index', label: Em.I18n.t('common.kerberos') }); } - if (App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS')) { + if (App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS') || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { if (App.supports.serviceAutoStart) { items.push({ name: 'serviceAutoStart', http://git-wip-us.apache.org/repos/asf/ambari/blob/2b1437c4/ambari-web/app/views/main/menu.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js index e79901b..8f6b14e 100644 --- a/ambari-web/app/views/main/menu.js +++ b/ambari-web/app/views/main/menu.js @@ -43,7 +43,8 @@ App.MainMenuView = Em.CollectionView.extend({ {label: Em.I18n.t('menu.item.alerts'), routing: 'alerts'} ); } - if (App.isAuthorized('CLUSTER.TOGGLE_KERBEROS, CLUSTER.MODIFY_CONFIGS, SERVICE.START_STOP, AMBARI.SET_SERVICE_USERS_GROUPS, CLUSTER.UPGRADE_DOWNGRADE_STACK, CLUSTER.VIEW_STACK_DETAILS')) { + if (App.isAuthorized('CLUSTER.TOGGLE_KERBEROS, CLUSTER.MODIFY_CONFIGS, SERVICE.START_STOP, AMBARI.SET_SERVICE_USERS_GROUPS, CLUSTER.UPGRADE_DOWNGRADE_STACK, CLUSTER.VIEW_STACK_DETAILS') + || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { result.push({ label: Em.I18n.t('menu.item.admin'), routing: 'admin'}); } } @@ -104,28 +105,28 @@ App.MainMenuView = Em.CollectionView.extend({ // create dropdown categories for each menu item if (itemName == 'admin') { categories = []; - if(App.isAuthorized('CLUSTER.VIEW_STACK_DETAILS, CLUSTER.UPGRADE_DOWNGRADE_STACK')) { + if(App.isAuthorized('CLUSTER.VIEW_STACK_DETAILS, CLUSTER.UPGRADE_DOWNGRADE_STACK') || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { categories.push({ name: 'stackAndUpgrade', url: 'stack', label: Em.I18n.t('admin.stackUpgrade.title') }); } - if(App.isAuthorized('AMBARI.SET_SERVICE_USERS_GROUPS')) { + if(App.isAuthorized('AMBARI.SET_SERVICE_USERS_GROUPS') || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { categories.push({ name: 'adminServiceAccounts', url: 'serviceAccounts', label: Em.I18n.t('common.serviceAccounts') }); } - if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS')) { + if (!App.get('isHadoopWindowsStack') && App.isAuthorized('CLUSTER.TOGGLE_KERBEROS') || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { categories.push({ name: 'kerberos', url: 'kerberos/', label: Em.I18n.t('common.kerberos') }); } - if (App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS')) { + if (App.isAuthorized('SERVICE.START_STOP, CLUSTER.MODIFY_CONFIGS') || (App.get('upgradeInProgress') || App.get('upgradeHolding'))) { if (App.supports.serviceAutoStart) { categories.push({ name: 'serviceAutoStart',
