ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject ambari git commit: AMBARI-14406. Display A Dialog When Beginning An Upgrade.(xiwang)
Date Thu, 17 Dec 2015 00:41:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 7927d3239 -> 211c2dd6e


AMBARI-14406. Display A Dialog When Beginning An Upgrade.(xiwang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/211c2dd6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/211c2dd6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/211c2dd6

Branch: refs/heads/branch-2.2
Commit: 211c2dd6ee5fc45124e69a73db1ae499815a8b52
Parents: 7927d32
Author: Xi Wang <xiwang@apache.org>
Authored: Wed Dec 16 14:21:09 2015 -0800
Committer: Xi Wang <xiwang@apache.org>
Committed: Wed Dec 16 14:21:24 2015 -0800

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js            | 10 ++++++++++
 ambari-web/app/messages.js                                |  2 ++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/211c2dd6/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index f77397b..00dbe82 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -596,6 +596,13 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       }
     });
     this.setDBProperty('currentVersion', this.get('currentVersion'));
+
+    // show a "preparing the upgrade..." dialog in case the api call returns too slow
+    setTimeout(function () {
+      if (App.router.get('currentState.name') != 'stackUpgrade') {
+        App.showAlertPopup(Em.I18n.t('admin.stackUpgrade.dialog.prepareUpgrade.header'),
Em.I18n.t('admin.stackUpgrade.dialog.prepareUpgrade.body'));
+      }
+    }, 1000);
   },
 
   /**
@@ -1391,6 +1398,9 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    * @return {App.ModalPopup}
    */
   openUpgradeDialog: function () {
+    if ($('.modal') && $('.modal .modal-header #modal-label').text().trim() == Em.I18n.t('admin.stackUpgrade.dialog.prepareUpgrade.header'))
{
+      $('.modal .modal-footer button.btn-success').click();
+    }
     App.router.transitionTo('admin.stackUpgrade');
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/211c2dd6/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 1ad0f6a..93f2ce6 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1581,6 +1581,8 @@ Em.I18n.translations = {
   'admin.stackUpgrade.dialog.details.open': "show details",
   'admin.stackUpgrade.dialog.details.hide': "hide details",
   'admin.stackUpgrade.dialog.notActive': "Waiting to execute the next task...",
+  'admin.stackUpgrade.dialog.prepareUpgrade.header': "Preparing the Upgrade...",
+  'admin.stackUpgrade.dialog.prepareUpgrade.body': "Please wait...",
   'services.service.start':'Start',
   'services.service.stop':'Stop',
   'services.service.metrics':'Metrics',


Mime
View raw message