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:31:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 4c7ce4837 -> 5f2f4925f


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/5f2f4925
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5f2f4925
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5f2f4925

Branch: refs/heads/branch-2.2
Commit: 5f2f4925f7109393d20761add80fda4b269383c7
Parents: 4c7ce48
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:31:15 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/5f2f4925/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 7265532..ff5bf3d 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
@@ -591,6 +591,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       sender: this,
       data: version,
       success: 'upgradeSuccessCallback',
+      error: 'upgradeErrorCallback',
       callback: function() {
         this.sender.set('requestInProgress', false);
       }
@@ -599,6 +600,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/5f2f4925/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9396965..ff10f70 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1462,6 +1462,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