ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-14207. Web Client Does Not Display Errors When Creating Upgrade. (xiwang via yusaku)
Date Fri, 04 Dec 2015 17:30:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 557939293 -> ea7a0f6f3


AMBARI-14207. Web Client Does Not Display Errors When Creating Upgrade. (xiwang via yusaku)


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

Branch: refs/heads/trunk
Commit: ea7a0f6f336da797bcaa20ea01974c10e72424ca
Parents: 5579392
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Fri Dec 4 09:30:08 2015 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Fri Dec 4 09:30:08 2015 -0800

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/ea7a0f6f/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 c4b42c4..87727f2 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
@@ -584,6 +584,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       sender: this,
       data: version,
       success: 'upgradeSuccessCallback',
+      error: 'upgradeErrorCallback',
       callback: function() {
         this.sender.set('requestInProgress', false);
       }
@@ -592,6 +593,22 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
   },
 
   /**
+   * error callback of <code>upgrade()</code>
+   * @param {object} data
+   */
+  upgradeErrorCallback: function (data) {
+    var header = Em.I18n.t('admin.stackVersions.upgrade.start.fail.title');
+    var body = "";
+    if(data && data.responseText){
+      try {
+        var json = $.parseJSON(data.responseText);
+        body = json.message;
+      } catch (err) {}
+    }
+    App.showAlertPopup(header, body);
+  },
+
+  /**
    * success callback of <code>upgrade()</code>
    * @param {object} data
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea7a0f6f/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index b5b7f52..0afce4b 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1445,6 +1445,7 @@ Em.I18n.translations = {
   'admin.stackVersions.filter.current': "Current ({0})",
   'admin.stackVersions.filter.upgrading': "Upgrade/Downgrade In Process ({0})",
   'admin.stackVersions.filter.upgraded': "Ready to Finalize ({0})",
+  'admin.stackVersions.upgrade.start.fail.title':'Upgrade could not be started',
 
   'admin.stackVersions.editRepositories.info': 'Provide Base URLs for the Operating Systems
you are configuring. Uncheck all other Operating Systems.',
   'admin.stackVersions.editRepositories.validation.warning': 'Some of the repositories failed
validation. Make changes to the base url or skip validation if you are sure that urls are
correct',


Mime
View raw message