PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 1 | <!-- |
| 2 | ========================LICENSE_START================================= |
| 3 | O-RAN-SC |
| 4 | %% |
| 5 | Copyright (C) 2019 Nordix Foundation |
| 6 | %% |
| 7 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | you may not use this file except in compliance with the License. |
| 9 | You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | ========================LICENSE_END=================================== |
| 19 | --> |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 20 | <table #table mat-table class="instances-table mat-elevation-z8" [ngClass]="{'table-dark': darkMode}" matSort |
| 21 | multiTemplateDataRows [dataSource]="instanceDataSource"> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 22 | |
| 23 | <ng-container matColumnDef="instanceId"> |
PatrikBuhr | dbb8eba | 2019-11-15 14:12:11 +0100 | [diff] [blame] | 24 | <mat-header-cell mat-sort-header *matHeaderCellDef>Instance</mat-header-cell> |
elinuxhenrik | b033eaf | 2020-02-03 16:02:21 +0100 | [diff] [blame^] | 25 | <mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{element.id}} |
| 26 | </mat-cell> |
| 27 | </ng-container> |
| 28 | |
| 29 | <ng-container matColumnDef="ric"> |
| 30 | <mat-header-cell mat-sort-header *matHeaderCellDef>Ric</mat-header-cell> |
| 31 | <mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{element.ric}} |
| 32 | </mat-cell> |
| 33 | </ng-container> |
| 34 | |
| 35 | <ng-container matColumnDef="service"> |
| 36 | <mat-header-cell mat-sort-header *matHeaderCellDef>Owner</mat-header-cell> |
| 37 | <mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{element.service}} |
| 38 | </mat-cell> |
| 39 | </ng-container> |
| 40 | |
| 41 | <ng-container matColumnDef="lastModified"> |
| 42 | <mat-header-cell mat-sort-header *matHeaderCellDef>Last modified</mat-header-cell> |
| 43 | <mat-cell *matCellDef="let element" (click)="modifyInstance(element)">{{toLocalTime(element.lastModified)}} |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 44 | </mat-cell> |
| 45 | </ng-container> |
| 46 | |
| 47 | <ng-container matColumnDef="action"> |
| 48 | <mat-header-cell class="action-cell" *matHeaderCellDef>Action</mat-header-cell> |
| 49 | <mat-cell class="action-cell" *matCellDef="let instance"> |
| 50 | <button mat-icon-button (click)="modifyInstance(instance)"> |
| 51 | <mat-icon>edit</mat-icon> |
| 52 | </button> |
| 53 | <button mat-icon-button color="warn" (click)="deleteInstance(instance)"> |
| 54 | <mat-icon>delete</mat-icon> |
| 55 | </button> |
| 56 | </mat-cell> |
| 57 | </ng-container> |
| 58 | |
| 59 | <ng-container matColumnDef="noRecordsFound"> |
| 60 | <mat-footer-cell *matFooterCellDef>No records found.</mat-footer-cell> |
| 61 | </ng-container> |
| 62 | |
elinuxhenrik | b033eaf | 2020-02-03 16:02:21 +0100 | [diff] [blame^] | 63 | <mat-header-row *matHeaderRowDef="['instanceId', 'ric', 'service', 'lastModified', 'action']" |
| 64 | [ngClass]="{'display-none': !this.hasInstances()}"> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 65 | </mat-header-row> |
elinuxhenrik | b033eaf | 2020-02-03 16:02:21 +0100 | [diff] [blame^] | 66 | <mat-row *matRowDef="let instance; columns: ['instanceId', 'ric', 'service', 'lastModified', 'action'];"></mat-row> |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 67 | |
| 68 | <mat-footer-row *matFooterRowDef="['noRecordsFound']" [ngClass]="{'display-none': this.hasInstances()}"> |
| 69 | </mat-footer-row> |
| 70 | |
| 71 | </table> |
| 72 | |
PatrikBuhr | a2bc79c | 2019-10-29 13:39:00 +0100 | [diff] [blame] | 73 | <div class="spinner-container" *ngIf="instanceDataSource.loading$ | async"> |
| 74 | <mat-spinner diameter="50"></mat-spinner> |
| 75 | </div> |