ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pallav...@apache.org
Subject [1/2] ambari git commit: AMBARI-17137. Capacity Scheduler View - Node label to queue mapping implementation (Akhil PB via pallavkul)
Date Wed, 06 Jul 2016 11:45:45 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 1a89d84cb -> 8f5f2c66e


http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/editQueueCapacity.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/editQueueCapacity.hbs
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/editQueueCapacity.hbs
new file mode 100644
index 0000000..c430a44
--- /dev/null
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/editQueueCapacity.hbs
@@ -0,0 +1,58 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class="row form-inline">
+  <div class="col-md-2 col-sm-2">
+    <span class="queue-name">{{queue.name}}</span>
+  </div>
+  <div class="col-md-5 col-md-5">
+    <div {{bind-attr class=":form-group :input-group :capacity-input-percent warnInvalidTotalCapacity:has-error"}}>
+      {{capacity-input class='input-sm' value=queue.capacity queue=this maxVal=100}}
+      <span class="input-group-addon">%</span>
+    </div>
+    <div class="form-group capacity-input-slider">
+      {{input-range min="0" max="100" step="1" value=queue.capacity class="input-sm"}}
+    </div>
+    {{#if isQueueCapacityDirty}}
+      <div class="btn-group btn-group-xs">
+        <a {{action 'rollbackProp' 'capacity' queue}} href="#" class="btn btn-default
btn-warning"><i class="fa fa-undo"></i></a>
+      </div>
+    {{/if}}
+  </div>
+  <div class="col-md-5 col-sm-5">
+    <div {{bind-attr class=":form-group :input-group :capacity-input-percent isInvalidQueueMaximumCapacity:has-error"}}>
+      {{max-capacity-input class='input-sm' value=queue.maximum_capacity queue=queue maxVal=100}}
+      <span class="input-group-addon">%</span>
+    </div>
+    <div class="form-group capacity-input-slider">
+      {{input-range min="0" max="100" step="1" value=queue.maximum_capacity class="input-sm"}}
+    </div>
+    {{#if isQueueMaximumCapacityDirty}}
+      <div class="btn-group btn-group-xs">
+        <a {{action 'rollbackProp' 'maximum_capacity' queue}} href="#" class="btn btn-default
btn-warning"><i class="fa fa-undo"></i></a>
+      </div>
+    {{/if}}
+    {{#if isInvalidQueueMaximumCapacity}}
+      <div class="row">
+        <div class="col-md-12 col-sm-12">
+          <span class="text-danger">Maximum capacity must be greater than or equal
to capacity</span>
+        </div>
+      </div>
+    {{/if}}
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/labelCapacityBar.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/labelCapacityBar.hbs
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/labelCapacityBar.hbs
new file mode 100644
index 0000000..96cbe99
--- /dev/null
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/labelCapacityBar.hbs
@@ -0,0 +1,41 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+{{#if isAnyQueueLabelsEnabled}}
+  <div class="label-capacitybar-wrapper">
+    <div class="row">
+      <div class="col-md-2 col-sm-2 total-label">
+        <label>Total Capacity</label>
+      </div>
+      <div class="col-sm-5 col-md-5">
+        <div class="progress total-capacity-progress">
+          <div role="progressbar" {{bind-attr class=":progress-bar warnInvalidLabelCapacity:progress-bar-danger:progress-bar-success"
style="totalLabelCapacityBarWidth"}}>
+            {{childrenQueueLabelsTotalCapacity}}%
+          </div>
+        </div>
+      </div>
+    </div>
+    {{#if warnInvalidLabelCapacity}}
+      <div class="row">
+        <div class="col-sm-6 col-md-6">
+          <span class="text-danger">Total capacity must be equal to 100%</span>
+        </div>
+      </div>
+    {{/if}}
+  </div>
+{{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueHierarchy.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueHierarchy.hbs
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueHierarchy.hbs
index 24f6938..fb34d51 100644
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueHierarchy.hbs
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueHierarchy.hbs
@@ -16,8 +16,9 @@
 }}
 
 {{#each queue in leafQs}}
-  {{#link-to 'capsched.queuesconf.editqueue' queue class="list-group-item"}}
+  {{#link-to 'capsched.queuesconf.editqueue' queue classNameBindings=":list-group-item queue.overCapacity:list-group-item-danger
queue.isNew:list-group-item-info" disabled=queue.isDeletedQueue}}
     <div class="col-md-offset-{{unbound queue.depth}} col-sm-offset-{{unbound queue.depth}}">
+
       {{#unless queue.queues}}
         <span>
           <i class="fa fa-leaf"></i>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueMapping.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueMapping.hbs
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueMapping.hbs
index 759c0f3..bd49c50 100644
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueMapping.hbs
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/queueMapping.hbs
@@ -33,7 +33,7 @@
             {{#each qm in queueMappings}}
               <li class="list-group-item">{{queueMappingParser qm}}<span class="pull-right
remove-mapping-icon" {{action "removeQueueMapping" qm}}><i class="fa fa-times"></i></span></li>
             {{else}}
-              <label>No queue mappings defined</label>
+              <span>No queue mappings defined</span>
             {{/each}}
           </ul>
         </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/saveConfigDialog.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/saveConfigDialog.hbs
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/saveConfigDialog.hbs
new file mode 100644
index 0000000..d8e62f5
--- /dev/null
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/components/saveConfigDialog.hbs
@@ -0,0 +1,36 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+{{!-- SAVE CONFIG MODAL --}}
+<div class="modal fade" id="configNoteModalDialog" tabindex="-1" role="dialog" aria-hidden="true">
+  <div class="modal-dialog">
+    <div class="modal-content">
+      <div class="modal-header">
+        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
class="sr-only">Close</span></button>
+        <h4 class="modal-title">Notes</h4>
+      </div>
+      <div class="modal-body">
+        {{textarea class="form-control" rows="3" style="max-width: 100%;" placeholder="What
did you change?" value=configNote}}
+      </div>
+      <div class="modal-footer">
+        <button {{action 'closeDialog'}} type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+        <button {{action 'saveConfigs'}} type="button" class="btn btn-success" data-dismiss="modal">Save
Changes</button>
+      </div>
+    </div>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/versionsPanel.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/versionsPanel.hbs
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/versionsPanel.hbs
index f252005..4fb32db 100644
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/versionsPanel.hbs
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/templates/versionsPanel.hbs
@@ -16,28 +16,28 @@
 * limitations under the License.
 }}
 
-<div class="panel panel-default">
+<div class="panel panel-default capsched-versions-panel">
   <div class="panel-heading">
     <div class="panel-title">
       Versions
     </div>
   </div>
   <div class="panel-body">
-    <div id="versions-table-wrap">
+    <div class="versions-table-wrap">
       <table class="table table-condensed">
         <tbody>
-          {{#each sortedTags}}
+          {{#each tag in sortedTags}}
             <tr>
               <td>
-                <span class="label label-info">v{{id}}</span>
-                {{#if isCurrent}}
+                <span class="label label-info">v{{tag.id}}</span>
+                {{#if tag.isCurrent}}
                   <span class="label label-success">Current</span>
                 {{/if}}
               </td>
-              <td>{{timeAgo changed}}</td>
+              <td>{{timeAgo tag.changed}}</td>
               <td>
                 <div class="btn-group btn-group-xs btn-block">
-                  <button type="button" class="btn btn-default btn-xs btn-block" {{action
'loadTagged' tag}}>load</button>
+                  <button type="button" class="btn btn-default btn-xs btn-block" {{action
'loadTagged' tag.tag}}>Load</button>
                 </div>
               </td>
             </tr>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editQueueCapacity.js
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editQueueCapacity.js
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editQueueCapacity.js
deleted file mode 100644
index b2ae1d5..0000000
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editQueueCapacity.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-App.CapschedPartialsEditQueueCapacityView = Ember.View.extend({
-  isQueueCapacityDirty: function() {
-    return this.get('controller.content').changedAttributes().hasOwnProperty('capacity');
-  }.property('controller.content.capacity'),
-
-  isQueueMaximumCapacityDirty: function() {
-    return this.get('controller.content').changedAttributes().hasOwnProperty('maximum_capacity');
-  }.property('controller.content.maximum_capacity'),
-
-  isInvalidQueueMaximumCapacity: function() {
-    var isInvalid = this.get('controller.content.maximum_capacity') < this.get('controller.content.capacity');
-    this.set('controller.content.isInvalidMaxCapacity', isInvalid);
-    return isInvalid;
-  }.property('controller.content.capacity', 'controller.content.maximum_capacity')
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editqueue.js
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editqueue.js
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editqueue.js
index 0dde62b..a5d0ef6 100644
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editqueue.js
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/editqueue.js
@@ -22,6 +22,7 @@ App.CapschedQueuesconfEditqueueView = Ember.View.extend({
   isAclPanelCollapsed: true,
   isResourcesPanelCollapsed: true,
   isCapacityPanelCollapsed: false,
+  isLabelsPanelCollapsed: true,
 
   doExpandCollapsePanel: function() {
     var that = this;
@@ -40,6 +41,11 @@ App.CapschedQueuesconfEditqueueView = Ember.View.extend({
         this.toggleProperty('isCapacityPanelCollapsed');
       });
     });
+    this.$('#collapseLabelCapacityPanelBtn').on('click', function(e) {
+      Ember.run.next(that, function() {
+        this.toggleProperty('isLabelsPanelCollapsed');
+      });
+    });
   }.on('didInsertElement'),
 
   destroyEventListeners: function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8f5f2c66/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/queuesconf.js
----------------------------------------------------------------------
diff --git a/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/queuesconf.js
b/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/queuesconf.js
index 5cef8e5..f994a4e 100644
--- a/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/queuesconf.js
+++ b/contrib/views/capacity-scheduler/src/main/resources/ui/app/views/queuesconf.js
@@ -19,16 +19,7 @@
 var App = require('app');
 
 App.CapschedQueuesconfView = Ember.View.extend({
-  saveMode: '',
   actions: {
-    showSaveConfigDialog: function(opt) {
-      if (opt) {
-        this.set('saveMode', opt);
-      } else {
-        this.set('saveMode', '');
-      }
-      this.$('#configNoteModalDialog').modal('show');
-    },
     showDeleteQueueDialog: function() {
       this.$('#deleteQueueModalDialog').modal('show');
     }


Mime
View raw message