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 23:29:26 UTC

svn commit: r1491972 - in /incubator/ambari/trunk/ambari-web/app: messages.js styles/application.less templates/main/service/reconfigure.hbs utils/polling.js views/main/service/reconfigure.js

Author: jaimin
Date: Tue Jun 11 21:29:25 2013
New Revision: 1491972

URL: http://svn.apache.org/r1491972
Log:
AMBARI-2358: Security wizard: Relabel the three actions in Step 3 and don't link them before they are "in progress".(jaimin)

Modified:
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/styles/application.less
    incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs
    incubator/ambari/trunk/ambari-web/app/utils/polling.js
    incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.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=1491972&r1=1491971&r2=1491972&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Tue Jun 11 21:29:25 2013
@@ -602,9 +602,9 @@ Em.I18n.translations = {
   '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',
-  'admin.addSecurity.apply.stage4': '3. Starting Services',
+  'admin.addSecurity.apply.stage2': '1. Stop Services',
+  'admin.addSecurity.apply.stage3': '2. Save Configurations',
+  'admin.addSecurity.apply.stage4': '3. Start Services',
   'admin.addSecurity.apply.stage5': '5. Smoke Test',
   'admin.removeSecurity.header': 'Disable Security',
   'admin.security.status.error' : 'Error in retrieving cluster security status from Ambari server',

Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1491972&r1=1491971&r2=1491972&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Tue Jun 11 21:29:25 2013
@@ -4300,4 +4300,13 @@ i.icon-asterisks {
       right:0;
     }
   }
+}
+
+#security-stages {
+  a.remove-link {
+    text-decoration:none;
+    pointer-events: none;
+    color:black;
+    cursor: default;
+  }
 }
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs?rev=1491972&r1=1491971&r2=1491972&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/reconfigure.hbs Tue Jun 11 21:29:25 2013
@@ -19,37 +19,33 @@
 <table id="security-stages" class="table no-borders">
   <tbody>
     {{#each stage in controller.stages}}
-      {{#view App.StageStatusView}}
+    <tr>
       <td>
-        {{#if stage.isPolling}}
-          <a href="javascript:void(0)" {{action "showHostPopup" stage.label target="view"}}>
-        {{/if}}
-        <p {{bindAttr class="stage.hasStarted::faintText"}}>{{stage.label}}</p>
-        {{#if stage.isPolling}}
-          </a>
-        {{/if}}
+      {{#view App.StageLabelView stageBinding="stage"}}
+          <p {{bindAttr class="view.isStarted::faintText"}}>{{stage.label}}</p>
+      {{/view}}
       </td>
       <td>
-        {{#if stage.isCompleted}}
-          {{#if stage.isSuccess}}
-            {{view App.StageSuccessView}}
-          {{else}}
-            {{#if stage.isError}}
-              {{view App.StageFailureView}}
+          {{#if stage.isCompleted}}
+            {{#if stage.isSuccess}}
+              {{view App.StageSuccessView}}
+            {{else}}
+              {{#if stage.isError}}
+                {{view App.StageFailureView}}
+              {{/if}}
             {{/if}}
-          {{/if}}
-        {{else}}
-          {{#if stage.isStarted}}
-            {{#if stage.isPolling}}
-              <div class="progress-bar pull-left">
-                {{view App.StageInProgressView stageBinding=stage}}
-              </div>
-              <div class="progress-percentage pull-left">{{stage.progress}}%</div>
+          {{else}}
+            {{#if stage.isStarted}}
+              {{#if stage.isPolling}}
+                <div class="progress-bar pull-left">
+                  {{view App.StageInProgressView stageBinding=stage}}
+                </div>
+                <div class="progress-percentage pull-left">{{stage.progress}}%</div>
+              {{/if}}
             {{/if}}
           {{/if}}
-        {{/if}}
       </td>
-      {{/view}}
+    </tr>
     {{/each}}
   </tbody>
 </table>
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-web/app/utils/polling.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/utils/polling.js?rev=1491972&r1=1491971&r2=1491972&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/utils/polling.js (original)
+++ incubator/ambari/trunk/ambari-web/app/utils/polling.js Tue Jun 11 21:29:25 2013
@@ -45,6 +45,10 @@ App.Poll = Em.Object.extend({
     return (this.get('isError') || this.get('isSuccess'));
   }.property('isError', 'isSuccess'),
 
+  showLink: function () {
+    return (this.get('isPolling') === true && this.get('isStarted') === true);
+  }.property('isPolling','isStarted'),
+
   start: function () {
     if (this.get('requestId') === undefined) {
       this.setRequestId();

Modified: incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js?rev=1491972&r1=1491971&r2=1491972&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/main/service/reconfigure.js Tue Jun 11 21:29:25 2013
@@ -23,15 +23,42 @@ App.MainServiceReconfigureView = Em.View
 
 });
 
-App.StageStatusView = Em.View.extend({
-  tagName: 'tr',
-  hasStarted: null,
-  classNameBindings: ['faintText'],
-  showHostPopup:function(event){
-    var serviceName = event.contexts[0];
+App.StageLabelView = Em.View.extend({
+  tagName: 'a',
+  classNameBindings: ['removeLink'],
+  attributeBindings: ['href'],
+  href: '#',
+  removeLink: null,
+  didInsertElement: function() {
+   this.onLink();
+  },
+  onLink: function() {
+   if (this.get('showLink') === true) {
+     this.set('removeLink',null);
+   } else {
+     this.set('removeLink','remove-link');
+   }
+  }.observes('showLink'),
+  stage: null,
+  click: function () {
+    if (this.get('stage') && this.get('showLink')) {
+      this.showHostPopup(this.get('stage.label'));
+    }
+  },
+
+  showHostPopup: function (label) {
+    var serviceName = label;
     var controller = this.get("controller");
     App.HostPopup.initPopup(serviceName, controller);
-  }
+  },
+
+  isStarted: function () {
+    return  (this.get('stage') && this.get('stage.isStarted'));
+  }.property('stage.isStarted'),
+
+  showLink: function () {
+    return (this.get('stage') && this.get('stage.showLink'));
+  }.property('stage.showLink')
 });
 
 App.StageSuccessView = Em.View.extend({