<!--
Copyright 2020 TATA ELXSI

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.

Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
-->
<div class="modal-header">
  <h4 class="modal-title" id="modal-basic-title">{{'PAGE.WIMACCOUNTS.WIMDETAILS' | translate}}</h4>
  <button class="button-xs" type="button" class="close" aria-label="Close" (click)="activeModal.close()">
    <i class="fas fa-times-circle text-danger"></i>
  </button>
</div>
<div class="modal-body modal-body-custom-height p-0">
  <table class="table table-striped table-layout-fixed mb-0" *ngIf="wimDetails">
    <tr>
      <td colspan="2">
        <b>{{'ID' | translate}}:</b> {{(wimDetails._id)?wimDetails._id:''}}
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <b>{{'DETAILEDSTATUS' | translate}}:</b> {{(wimDetails._admin['detailed-status'])?wimDetails._admin['detailed-status']:''}}
      </td>
    </tr>
    <tr>
      <td>
        <b>{{'OPERATIONALSTATE' | translate}}:</b><span class="ml-1 badge" [ngClass]="{'badge-warning text-white':wimDetails._admin.operationalState === operationalStateFirstStep,
        'badge-success':wimDetails._admin.operationalState === operationalStateSecondStep,
        'badge-danger':wimDetails._admin.operationalState === operationalStateThirdStep}">
          {{(wimDetails._admin.operationalState)?wimDetails._admin.operationalState:''}}
        </span>
      </td>
      <td>
        <b>{{'PAGE.WIMACCOUNTS.SCHEMAVERSION' | translate}}:</b> {{(wimDetails.schema_version)?wimDetails.schema_version:''}}
      </td>
    </tr>
    <tr>
      <td>
        <b>{{'NAME' | translate}}:</b> {{(wimDetails.name)?wimDetails.name:''}}
      </td>
      <td>
        <b>{{'TYPE' | translate}}:</b> {{(wimDetails.wim_type)?wimDetails.wim_type:''}}
      </td>
    </tr>
    <tr>
      <td>
        <b>{{'URL' | translate}}:</b> {{(wimDetails.wim_url)?wimDetails.wim_url:''}}
      </td>
      <td>
        <b>{{'DESCRIPTION' | translate}}:</b> {{(wimDetails.description)?wimDetails.description:''}}
      </td>
    </tr>
    <tr>
      <td>
        <b>{{'CREATED' | translate}}:</b> {{(wimDetails._admin.created)?this.sharedService.convertEpochTime(wimDetails._admin.created):''}}
      </td>
      <td>
        <b>{{'MODIFIED' | translate}}:</b> {{(wimDetails._admin.modified)?this.sharedService.convertEpochTime(wimDetails._admin.modified):''}}
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <b>{{'DEPLOYED' | translate}}</b> <br>
        <b>{{'PAGE.WIMACCOUNTS.RO' | translate}}:</b> {{(wimDetails._admin.deployed.RO)?wimDetails._admin.deployed.RO:''}} <br>
        <b>{{'PAGE.WIMACCOUNTS.ROACCOUNT' | translate}}:</b> {{(wimDetails._admin.deployed['RO-account'])?wimDetails._admin.deployed['RO-account']:''}}
      </td>
    </tr>
  </table>
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-danger" (click)="activeModal.close()">{{'CANCEL' | translate}}</button>
</div>
<app-loader [waitingMessage]="message" *ngIf="isLoadingResults"></app-loader>
