瀏覽代碼

AMBARI-1273. Edit User: No error message is shown when the user does not enter the correct "old password". (srimanth)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1439697 13f79535-47bb-0310-9956-ffa450edef68
Srimanth 12 年之前
父節點
當前提交
74d660b089

+ 3 - 0
CHANGES.txt

@@ -160,6 +160,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1273. Edit User: No error message is shown when the user does not 
+ enter the correct "old password". (srimanth)
+
  AMBARI-1172. Alert status change does not change time for the alerts.
  (srimanth via yusaku) 
 

+ 4 - 2
ambari-web/app/controllers/main/admin/user.js

@@ -92,12 +92,14 @@ App.MainAdminUserController = Em.Controller.extend({
       dataType: 'json',
       timeout: App.timeout,
       success: function(data){
-          callback(true);
+          callback(true, '');
       },
 
       error: function (request, ajaxOptions, error) {
         //do something
-        callback(false);
+        var message = $.parseJSON(request.responseText).message;
+        message = message.substr(message.indexOf(':') + 1); // Remove classname
+        callback(false, message);
         console.log('error on change component host status')
       },
 

+ 1 - 0
ambari-web/app/messages.js

@@ -223,6 +223,7 @@ Em.I18n.translations = {
   'admin.users.delete.header':'Delete {0}',
 
   'admin.users.addButton':'Add Local User',
+  'admin.users.editButton': 'Edit Local User',
   'admin.users.delete':'delete',
   'admin.users.edit':'edit',
   'admin.users.privileges':'Admin',

+ 10 - 2
ambari-web/app/views/main/admin/user/edit.js

@@ -42,9 +42,17 @@ App.MainAdminUserEditView = Em.View.extend({
 
       parent_controller.sendCommandToServer('/users/' + form.getField("userName").get('value'), "PUT" , {
        Users:Users
-      }, function (success) {
-        console.log('success', success);
+      }, function (success, message) {
         if (!success) {
+          App.ModalPopup.show({
+            header: Em.I18n.t('admin.users.editButton'),
+            body: message,
+            primary: 'Ok',
+            secondary: null,
+            onPrimary: function() {
+              this.hide();
+            }
+          });
           return;
         }