Updated Branches: refs/heads/trunk 7ac4b6cb4 -> 75b0c4400
AMBARI-3106. NameNode HA wizard: show Rollback button when task fails, and show confirm rollback popup Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/75b0c440 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/75b0c440 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/75b0c440 Branch: refs/heads/trunk Commit: 75b0c440036a48e8706008014e37606089cbfaea Parents: 7ac4b6c Author: Alex Antonenko <[email protected]> Authored: Thu Sep 5 09:44:04 2013 +0300 Committer: Alex Antonenko <[email protected]> Committed: Thu Sep 5 09:44:04 2013 +0300 ---------------------------------------------------------------------- .../highAvailability/progress_controller.js | 17 ++++++++ .../highAvailability/rollback_controller.js | 45 ++++++++++++++++++++ ambari-web/app/messages.js | 3 ++ .../main/admin/highAvailability/progress.hbs | 4 ++ 4 files changed, 69 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/75b0c440/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js index 3f651ea..e8365d0 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/progress_controller.js @@ -105,6 +105,23 @@ App.HighAvailabilityProgressPageController = Em.Controller.extend({ task.set('status', 'PENDING'); }, + rollback: function () { + var task = this.get('tasks').findProperty('status', 'FAILED'); + App.ModalPopup.show({ + header: Em.I18n.t('admin.highAvailability.confirmRollbackHeader'), + primary: Em.I18n.t('common.confirm'), + onPrimary: function () { + //App.router.send(); + this.hide(); + }, + secondary : Em.I18n.t('common.cancel'), + onSecondary: function(){ + this.hide(); + }, + body: Em.I18n.t('admin.highAvailability.confirmRollbackBody') + }); + }, + onTaskStatusChange: function () { if (!this.get('tasks').someProperty('status', 'IN_PROGRESS') && !this.get('tasks').someProperty('status', 'QUEUED') && !this.get('tasks').someProperty('status', 'FAILED')) { var nextTask = this.get('tasks').findProperty('status', 'PENDING'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/75b0c440/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js new file mode 100644 index 0000000..41db427 --- /dev/null +++ b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js @@ -0,0 +1,45 @@ +/** + * 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'); +require('controllers/highAvailability/progress_controller'); + +App.HighAvailabilityRollbackController = App.HighAvailabilityProgressPageController({ + + name: "highAvailabilityRollbackController", + + commands: [ + 'stopAllServices', + 'restoreHBaseConfigs', + 'stopFailoverControllers', + 'deleteFailoverControllers', + 'stopStandbyNameNode', + 'stopNamenode', + 'restoreHDFSConfigs', + 'enableSecondaryNameNode', + 'stopJournalNodes', + 'deleteJournalNodes', + 'deleteAdditionalNameNode', + 'startAllServices', + ], + + getStartingPoint: function() { + + } + +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/75b0c440/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 3890034..f79c2fc 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -56,6 +56,7 @@ Em.I18n.translations = { 'common.addComponent':'Add Component', 'common.remove':'Remove', 'common.retry':'Retry', + 'common.rollBack':'Rollback', 'common.show':'Show', 'common.hide':'Hide', 'common.cancel':'Cancel', @@ -643,6 +644,8 @@ Em.I18n.translations = { 'admin.highAvailability.button.enable':'Enable NameNode HA', 'admin.highAvailability.disabled':'NameNode HA is disabled', 'admin.highAvailability.enabled':'NameNode HA is enabled', + 'admin.highAvailability.confirmRollbackHeader':'Confirm Rollback', + 'admin.highAvailability.confirmRollbackBody':'This will rollback all operations that were done in HA wizard', 'admin.highAvailability.error.hostsNum':'You must have at least 3 hosts in your cluster to enable NameNode HA.', 'admin.highAvailability.error.namenodeStarted':'NameNode must be running before you enable NameNode HA.', 'admin.highAvailability.error.zooKeeperNum':'You must have at least 3 ZooKeeper Servers in your cluster to enable NameNode HA.', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/75b0c440/ambari-web/app/templates/main/admin/highAvailability/progress.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/admin/highAvailability/progress.hbs b/ambari-web/app/templates/main/admin/highAvailability/progress.hbs index ee410b1..c467b4a 100644 --- a/ambari-web/app/templates/main/admin/highAvailability/progress.hbs +++ b/ambari-web/app/templates/main/admin/highAvailability/progress.hbs @@ -40,6 +40,10 @@ <i class="icon-repeat icon-white"></i> {{t common.retry}} </a> + <a {{action rollback target="controller"}} class="btn btn-primary retry"> + <i class="icon-repeat icon-white"></i> + {{t common.rollBack}} + </a> {{/if}} </div> </div>
