{{!
* 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="panel panel-default panel-capacity">
  <div class="panel-heading">
    <div class="panel-title">
      Scheduler
    </div>
  </div>
  <div class="panel-body">
    <form class="form-horizontal" role="form">
      <div class="form-group">
        <label class="col-xs-5 control-label">Maximum Applications</label>
        {{#if isOperator}}
        <div class="col-xs-6 control-value">
          {{int-input value=scheduler.maximum_applications maxlength=15 class="input-sm input-int"}}
        {{else}}
        <div class="col-xs-6">
          <p class="form-control-static">{{scheduler.maximum_applications}}</p>
        {{/if}}
        </div>
      </div>
      <div class="form-group">
        <label class="col-xs-5 control-label">Maximum AM Resource</label>
        {{#if isOperator}}
        <div class="col-xs-6 control-value">
          <div class="input-group input-percent">
            {{int-input value=scheduler.maximum_am_resource_percent class="input-sm" maxVal=100}}
            <span class="input-group-addon">%</span>
          </div>
        {{else}}
        <div class="col-xs-6">
          {{#if scheduler.maximum_am_resource_percent}}
            <p class="form-control-static">{{scheduler.maximum_am_resource_percent}} %</p>
          {{else}}
            <p class="form-control-static">-</p>
          {{/if}}
        {{/if}}
        </div>
      </div>
      <div class="form-group">
        <label class="col-xs-5 control-label">Node Locality Delay</label>
        {{#if isOperator}}
        <div class="col-xs-6 control-value">
            {{int-input value=scheduler.node_locality_delay maxlength=10 class="input-sm input-int"}}
        {{else}}
        <div class="col-xs-6">
          {{#if scheduler.node_locality_delay}}
            <p class="form-control-static">{{scheduler.node_locality_delay}} %</p>
          {{else}}
            <p class="form-control-static">-</p>
          {{/if}}
        {{/if}}
        </div>
      </div>
     {{#if isOperator}}
     {{#if scheduler.resource_calculator}}
 <div class="form-group">
        <label class="col-xs-5 control-label">Calculator</label>
        <div class="col-xs-12 control-value">
            {{input value=scheduler.resource_calculator class="input-sm form-control"}}
        </div>
      </div>
     {{/if}}
     {{/if}}
    </form>
  </div>
</div>
