blob: 8c305e4183e406a8f9c308c9a62bc96e35fb928c [file] [log] [blame]
<!--
========================LICENSE_START=================================
O-RAN-SC
%%
Copyright (C) 2019 Nordix Foundation
%%
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.
========================LICENSE_END===================================
-->
<table #table mat-table class="instances-table mat-elevation-z8" [ngClass]="{'table-dark': darkMode}" matSort
multiTemplateDataRows [dataSource]="instanceDataSource">
<ng-container matColumnDef="instanceId">
<mat-header-cell mat-sort-header *matHeaderCellDef>Instance</mat-header-cell>
<mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{element.id}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="ric">
<mat-header-cell mat-sort-header *matHeaderCellDef>Ric</mat-header-cell>
<mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{element.ric}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="service">
<mat-header-cell mat-sort-header *matHeaderCellDef>Owner</mat-header-cell>
<mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{element.service}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="lastModified">
<mat-header-cell mat-sort-header *matHeaderCellDef>Last modified</mat-header-cell>
<mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{toLocalTime(element.lastModified)}}
</mat-cell>
</ng-container>
<ng-container matColumnDef="action">
<mat-header-cell class="action-cell" *matHeaderCellDef>Action</mat-header-cell>
<mat-cell class="action-cell" *matCellDef="let instance">
<button mat-icon-button (click)="modifyInstance(instance)">
<mat-icon>edit</mat-icon>
</button>
<button mat-icon-button color="warn" (click)="deleteInstance(instance)">
<mat-icon>delete</mat-icon>
</button>
</mat-cell>
</ng-container>
<ng-container matColumnDef="noRecordsFound">
<mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="['instanceId', 'ric', 'service', 'lastModified', 'action']"
[ngClass]="{'display-none': !this.hasInstances()}">
</mat-header-row>
<mat-row *matRowDef="let instance; columns: ['instanceId', 'ric', 'service', 'lastModified', 'action'];"></mat-row>
<mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': this.hasInstances()}">
</mat-footer-row>
</table>
<div class="spinner-container" *ngIf="instanceDataSource.loading$ | async">
<mat-spinner diameter="50"></mat-spinner>
</div>