<!--
Copyright 2017 The Kubernetes Authors.

Licensed 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.
-->

<kd-object-meta [initialized]="isInitialized"
                [objectMeta]="job?.objectMeta"></kd-object-meta>

<kd-card [initialized]="isInitialized">
  <div title
       i18n>Resource information</div>

  <div description>
    <div class="kd-inline-property"
         *ngIf="job?.completions">
      <span class="kd-muted-light"
            i18n>Completions:&nbsp;</span>
      <span>{{job.completions}}</span>
    </div>

    <div class="kd-inline-property"
         *ngIf="job?.parallelism">
      <span class="kd-muted-light"
            i18n>Parallelism:&nbsp;</span>
      <span>{{job.parallelism}}</span>
    </div>
  </div>

  <div content
       *ngIf="isInitialized"
       fxLayout="row wrap">
    <kd-property *ngIf="job?.completions">
      <div key
           i18n>Completions</div>
      <div value>{{job.completions}}</div>
    </kd-property>

    <kd-property *ngIf="job?.parallelism">
      <div key
           i18n>Parallelism</div>
      <div value>{{job.parallelism}}</div>
    </kd-property>

    <kd-property *ngIf="job?.containerImages"
                 fxFlex="100">
      <div key
           i18n>Images</div>
      <div value>
        <kd-chips [map]="job.containerImages"></kd-chips>
      </div>
    </kd-property>

    <kd-property *ngIf="job?.initContainerImages">
      <div key
           i18n>Init images</div>
      <div value>
        <kd-chips [map]="job.initContainerImages"></kd-chips>
      </div>
    </kd-property>
  </div>
</kd-card>

<kd-pod-status-card [podInfo]="job?.podInfo"
                    [initialized]="isInitialized"></kd-pod-status-card>

<kd-pod-list [endpoint]="podListEndpoint"></kd-pod-list>

<kd-event-list [endpoint]="eventListEndpoint"></kd-event-list>
