You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/06/11 20:52:13 UTC

svn commit: r1491901 - in /incubator/ambari/trunk/ambari-web/app: ./ routes/ templates/main/admin/security/ templates/main/admin/security/add/ views/main/admin/security/ views/main/admin/security/add/

Author: jaimin
Date: Tue Jun 11 18:52:12 2013
New Revision: 1491901

URL: http://svn.apache.org/r1491901
Log:
AMBARI-2352: Security wizard: once the wizard completes, show a prominent success or failure message (Step 3). (jaimin)

Modified:
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/routes/add_security.js
    incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/add/step3.hbs
    incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/disable.hbs
    incubator/ambari/trunk/ambari-web/app/views/main/admin/security/add/step3.js
    incubator/ambari/trunk/ambari-web/app/views/main/admin/security/disable.js

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1491901&r1=1491900&r2=1491901&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Tue Jun 11 18:52:12 2013
@@ -596,6 +596,11 @@ Em.I18n.translations = {
   'admin.security.step1.body.instruction3': 'Install and start clients on all machines',
   'admin.security.step2.body.header': 'Configure Kerberos security properties',
   'admin.security.step3.body.header': 'Applying kerberos security to the cluster',
+  'admin.security.step3.body.success.header' : 'Kerberos-based security has been enabled on your cluster.',
+  'admin.security.step3.body.failure.header' : 'Failed to enable Kerberos-based security on your cluster. Your cluster will keep running in non-secure mode.',
+  'admin.security.disable.body.header' : 'Disabling kerberos security on the cluster',
+  'admin.security.disable.body.success.header': 'Kerberos-based security has been disabled on your cluster.',
+  'admin.security.disable.body.failure.header': 'Failed to disable Kerberos-based security on your cluster. Your cluster will keep running in secure mode.',
   'admin.addSecurity.apply.stage1': '1. Checking KDC',
   'admin.addSecurity.apply.stage2': '1. Stopping Services',
   'admin.addSecurity.apply.stage3': '2. Saving Configurations',

Modified: incubator/ambari/trunk/ambari-web/app/routes/add_security.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/routes/add_security.js?rev=1491901&r1=1491900&r2=1491901&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/routes/add_security.js (original)
+++ incubator/ambari/trunk/ambari-web/app/routes/add_security.js Tue Jun 11 18:52:12 2013
@@ -180,13 +180,13 @@ module.exports = Em.Route.extend({
     },
     back: function (router, context) {
       var controller = router.get('mainAdminSecurityAddStep3Controller');
-      if (!controller.get('isSubmitDisabled')) {
+      if (!controller.get('isBackBtnDisabled')) {
         router.transitionTo('step2');
       }
     },
     done: function (router, context) {
       var controller = router.get('mainAdminSecurityAddStep3Controller');
-      if (!controller.get('isBackBtnDisabled')) {
+      if (!controller.get('isSubmitDisabled')) {
         $(context.currentTarget).parents("#modal").find(".close").trigger('click');
       }
     }

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/add/step3.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/add/step3.hbs?rev=1491901&r1=1491900&r2=1491901&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/add/step3.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/add/step3.hbs Tue Jun 11 18:52:12 2013
@@ -17,9 +17,10 @@
 }}
 
 <h2>{{t admin.security.step3.header}}</h2>
-<p class="alert alert-info">
-  {{t admin.security.step3.body.header}}
-</p>
+
+{{#if view.message}}
+  <p {{bindAttr class="view.msgColor :alert"}}>{{view.message}}</p>
+{{/if}}
 
 {{view App.MainServiceReconfigureView}}
 

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/disable.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/disable.hbs?rev=1491901&r1=1491900&r2=1491901&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/disable.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/admin/security/disable.hbs Tue Jun 11 18:52:12 2013
@@ -16,6 +16,9 @@
 * limitations under the License.
 }}
 
+{{#if view.message}}
+  <p {{bindAttr class="view.msgColor :alert"}}>{{view.message}}</p>
+{{/if}}
 {{view App.MainServiceReconfigureView}}
 <div class="btn-area">
   <a class="btn btn-success pull-right" {{bindAttr disabled="isSubmitDisabled"}}

Modified: incubator/ambari/trunk/ambari-web/app/views/main/admin/security/add/step3.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/admin/security/add/step3.js?rev=1491901&r1=1491900&r2=1491901&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/admin/security/add/step3.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/admin/security/add/step3.js Tue Jun 11 18:52:12 2013
@@ -23,7 +23,24 @@ App.MainAdminSecurityAddStep3View = Em.V
   templateName: require('templates/main/admin/security/add/step3'),
   didInsertElement: function () {
     this.get('controller').loadStep();
-  }
+  },
+  msgColor: 'alert-info',
+  message: Em.I18n.t('admin.security.step3.body.header'),
+  onResult: function () {
+    var stage1 = this.get('controller.stages').findProperty('stage', 'stage2');
+    var stage2 = this.get('controller.stages').findProperty('stage', 'stage3');
+    var stage3 = this.get('controller.stages').findProperty('stage', 'stage4');
+      if (stage2 && stage2.get('isSuccess') === true ) {
+        this.set('message', Em.I18n.t('admin.security.step3.body.success.header'));
+        this.set('msgColor','alert-success');
+      } else if ((stage1 && stage1.get('isError') === true) || (stage2 && stage2.get('isError') === true)) {
+        this.set('message', Em.I18n.t('admin.security.step3.body.failure.header'));
+        this.set('msgColor','alert-error');
+      } else {
+        this.set('message', Em.I18n.t('admin.security.step3.body.header'));
+        this.set('msgColor','alert-info');
+      }
+  }.observes('controller.stages.@each.isCompleted')
 
 });
 

Modified: incubator/ambari/trunk/ambari-web/app/views/main/admin/security/disable.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/admin/security/disable.js?rev=1491901&r1=1491900&r2=1491901&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/admin/security/disable.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/admin/security/disable.js Tue Jun 11 18:52:12 2013
@@ -24,5 +24,22 @@ App.MainAdminSecurityDisableView = Em.Vi
 
   didInsertElement: function () {
     this.get('controller').loadStep();
-  }
+  },
+  msgColor: 'alert-info',
+  message: Em.I18n.t('admin.security.disable.body.header'),
+  onResult: function () {
+    var stage1 = this.get('controller.stages').findProperty('stage', 'stage2');
+    var stage2 = this.get('controller.stages').findProperty('stage', 'stage3');
+    var stage3 = this.get('controller.stages').findProperty('stage', 'stage4');
+    if (stage2 && stage2.get('isSuccess') === true ) {
+      this.set('message', Em.I18n.t('admin.security.disable.body.success.header'));
+      this.set('msgColor', 'alert-success');
+    } else if ((stage1 && stage1.get('isError') === true) || (stage2 && stage2.get('isError') === true)) {
+      this.set('message', Em.I18n.t('admin.security.disable.body.failure.header'));
+      this.set('msgColor', 'alert-error');
+    } else {
+      this.set('message', Em.I18n.t('admin.security.disable.body.header'));
+      this.set('msgColor', 'alert-info');
+    }
+  }.observes('controller.stages.@each.isCompleted')
 });