{{!
 * 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.
}}

{{breadcrumb-bar breadcrumbs=breadcrumbs}}

<div class="panel-group">
  <div class="panel panel-default">
    <div class="yarn-app-header">
      <div class="flex">
        <div class="top-1">
          <h3>{{model.selected}}</h3>
          {{#if model.selectedQueue.state}}
          <div>
            {{em-table-simple-status-cell content=model.selectedQueue.state}}
          </div>
          {{/if}}
          {{#if (eq model.queues.firstObject.type "capacity")}}
              <div class="top-1">
                <span class="yarn-label secondary">
                  <span class="label-key">configured capacity</span>
                  <span class="label-value">{{model.selectedQueue.capacity}}%</span>
                </span>
                <span class="yarn-label secondary">
                  <span class="label-key">configured max capacity</span>
                  <span class="label-value">{{model.selectedQueue.maxCapacity}}%</span>
                </span>
                {{#if model.selectedQueue.isLeafQueue}}
                <span class="yarn-label secondary">
                  <span class="label-key">user limit</span>
                  <span class="label-value">{{model.selectedQueue.userLimit}}%</span>
                </span>
                <span class="yarn-label secondary">
                  <span class="label-key">user limit factor</span>
                  <span class="label-value">{{model.selectedQueue.userLimitFactor}}</span>
                </span>
                {{/if}}
              </div>
          {{/if}}
        </div>
        <div class="flex-right">
          {{#each model.selectedQueue.capacitiesBarChartData as |item|}}
            <span class="yarn-label primary">
              <span class="label-key"> {{lower item.label}}</span>
                <span class="label-value">{{item.value}}{{#if (eq model.queues.firstObject.type "fair")}} MB{{else}}%{{/if}}</span>
            </span>
          {{/each}}
        </div>
      </div>
    </div>
    <div class="panel-body yarn-app-body">
      {{outlet}}
    </div>
  </div>
</div>
