ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [03/50] [abbrv] ambari git commit: AMBARI-14406. Display A Dialog When Beginning An Upgrade.(xiwang)
Date Fri, 08 Jan 2016 18:15:20 GMT
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/6ad6d441
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6ad6d441
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6ad6d441

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 6ad6d441b8f4beff6c5c97ef4b7d69eb71393ceb
Parents: 3ffb972
Author: Xi Wang <xiwang@apache.org>
Authored: Mon Jan 4 16:36:47 2016 -0800
Committer: Xi Wang <xiwang@apache.org>
Committed: Tue Jan 5 11:22:14 2016 -0800

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js  | 46 ++++++++++++++++++++
 .../app/controllers/wizard/step8_controller.js  |  1 +
 ambari-web/app/messages.js                      |  1 +
 .../templates/wizard/step8/step8_log_popup.hbs  |  2 +-
 4 files changed, 49 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6ad6d441/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 06ddf24..d17776f 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
@@ -581,6 +581,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    * @param {object} version
    */
   upgrade: function (version) {
+    var self = this;
     this.set('requestInProgress', true);
     App.ajax.send({
       name: 'admin.upgrade.start',
@@ -593,6 +594,51 @@ 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
+    if (App.router.get('currentState.name') != 'stackUpgrade') {
+      self.showPreparingUpgradeIndicator();
+    }
+  },
+
+  /**
+   * Should progress bar be displayed when preparing upgrade,
+   * should show after Upgrade Options window and before Upgrade Wizard
+   * @method showPreparingUpgradeIndicator
+   */
+  showPreparingUpgradeIndicator: function () {
+    return App.ModalPopup.show({
+      header: '',
+      showFooter: false,
+      showCloseButton: false,
+      bodyClass: Em.View.extend({
+        templateName: require('templates/wizard/step8/step8_log_popup'),
+        controllerBinding: 'App.router.mainAdminStackAndUpgradeController',
+
+        /**
+         * Css-property for progress-bar
+         * @type {string}
+         */
+        barWidth: 'width: 100%;',
+        progressBarClass: 'progress progress-striped active log_popup',
+
+        /**
+         * Popup-message
+         * @type {string}
+         */
+        message: Em.I18n.t('admin.stackUpgrade.dialog.prepareUpgrade.header'),
+
+        /**
+         * Hide popup when upgrade wizard is open
+         * @method autoHide
+         */
+        autoHide: function () {
+          if (!this.get('controller.requestInProgress')) {
+            this.get('parentView').hide();
+          }
+        }.observes('controller.requestInProgress')
+      })
+    });
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ad6d441/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 62ba32a..89fed3c 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1767,6 +1767,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs,
App.wiz
          * @type {string}
          */
         barWidth: '',
+        progressBarClass: 'progress log_popup',
 
         /**
          * Popup-message

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ad6d441/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 8892cac..d36592f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1573,6 +1573,7 @@ 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...",
   'services.service.start':'Start',
   'services.service.stop':'Stop',
   'services.service.metrics':'Metrics',

http://git-wip-us.apache.org/repos/asf/ambari/blob/6ad6d441/ambari-web/app/templates/wizard/step8/step8_log_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step8/step8_log_popup.hbs b/ambari-web/app/templates/wizard/step8/step8_log_popup.hbs
index fafb0b3..6d3e5c2 100644
--- a/ambari-web/app/templates/wizard/step8/step8_log_popup.hbs
+++ b/ambari-web/app/templates/wizard/step8/step8_log_popup.hbs
@@ -16,7 +16,7 @@
 * limitations under the License.
 }}
 <p>{{view.message}}</p>
-<div class="progress log_popup">
+<div {{bindAttr class="view.progressBarClass"}}>
     <div class="bar" {{bindAttr style="view.barWidth"}}>
     </div>
 </div>
\ No newline at end of file


Mime
View raw message