107 lines
4.7 KiB
HTML
107 lines
4.7 KiB
HTML
<div class="header-container" [style.border-bottom]="isFromDashboard ? 'none' : '1px solid #ddd'" [style.padding]="isFromDashboard ? '10px 0' : '10px 10px'">
|
|
@if (!isFromDashboard) {
|
|
<button mat-icon-button color="primary" (click)="initTour()">
|
|
<mat-icon>help</mat-icon>
|
|
</button>
|
|
<div class="header-container-title">
|
|
<h2 joyrideStep="titleStep" text="{{ 'adminPxeDescription' | translate }}">{{ 'adminPxeTitle' |
|
|
translate }}</h2>
|
|
</div>
|
|
}
|
|
<div class="template-button-row" [style.margin-left]="isFromDashboard ? 'auto' : '0'">
|
|
<button class="action-button" joyrideStep="viewInfoStep" [text]="'viewInfoStepText' | translate" (click)="openInfoDialog()" [disabled]="!selectedServerId">{{ 'buttonViewInfo' | translate }}</button>
|
|
<button class="action-button" (click)="addPxeTemplate()" joyrideStep="addTemplateStep"
|
|
text="{{ 'addTemplateButtonDescription' | translate }}" [disabled]="!selectedServerId">{{ 'addTemplateTitle' | translate }}</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-container">
|
|
@if (!isFromDashboard) {
|
|
<mat-form-field appearance="fill" class="search-string">
|
|
<mat-label>{{ 'ogbootServer' | translate }}</mat-label>
|
|
<mat-select [(ngModel)]="selectedServerId" (selectionChange)="onServerChange()">
|
|
@for (server of bootServers; track server['@id']) {
|
|
<mat-option [value]="server.uuid || server['@id'].split('/').pop()">
|
|
{{ server.name }}
|
|
</mat-option>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|
|
}
|
|
|
|
<mat-form-field appearance="fill" class="search-string" joyrideStep="searchNameStep"
|
|
text="{{ 'searchNameDescription' | translate }}">
|
|
<mat-label>{{ 'labelSearch' | translate }}</mat-label>
|
|
<input matInput placeholder="{{ 'labelSearch' | translate }}" [(ngModel)]="filters['name']"
|
|
(keyup.enter)="search()">
|
|
<mat-icon matSuffix>search</mat-icon>
|
|
<mat-hint>{{ 'searchHint' | translate }}</mat-hint>
|
|
</mat-form-field>
|
|
<mat-form-field appearance="fill" class="search-boolean" joyrideStep="searchIsDefaultStep"
|
|
text="{{ 'searchIsDefaultText' | translate }}">
|
|
<mat-label>{{ 'labelIsDefault' | translate }}</mat-label>
|
|
<mat-select [(ngModel)]="filters['isDefault']" (selectionChange)="search()"
|
|
placeholder="{{ 'labelSelectOption' | translate }}">
|
|
<mat-option [value]="''">{{ 'all' | translate }}</mat-option>
|
|
<mat-option [value]="true">{{ 'buttonYes' | translate }}</mat-option>
|
|
<mat-option [value]="false">{{ 'buttonNo' | translate }}</mat-option>
|
|
</mat-select>
|
|
</mat-form-field>
|
|
</div>
|
|
|
|
<app-loading [isLoading]="loading"></app-loading>
|
|
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8" joyrideStep="tableStep"
|
|
text="{{ 'tableDatePxeTemplateText' | translate }}">
|
|
|
|
@for (column of columns; track column.columnDef) {
|
|
<ng-container [matColumnDef]="column.columnDef">
|
|
<th mat-header-cell *matHeaderCellDef>{{ column.header | translate }}</th>
|
|
<td mat-cell *matCellDef="let image">
|
|
@if (column.columnDef === 'synchronized') {
|
|
<mat-chip>
|
|
@if (image.synchronized) {
|
|
{{ 'buttonYes' | translate }}
|
|
} @else {
|
|
{{ 'buttonNo' | translate }}
|
|
}
|
|
</mat-chip>
|
|
} @else if (column.columnDef === 'isDefault') {
|
|
<mat-chip>
|
|
@if (image.isDefault) {
|
|
{{ 'buttonYes' | translate }}
|
|
} @else {
|
|
{{ 'buttonNo' | translate }}
|
|
}
|
|
</mat-chip>
|
|
} @else {
|
|
{{ column.cell(image) }}
|
|
}
|
|
</td>
|
|
</ng-container>
|
|
}
|
|
|
|
<ng-container matColumnDef="actions">
|
|
<th mat-header-cell *matHeaderCellDef style="text-align: center;">{{ 'actions' | translate }}</th>
|
|
<td mat-cell *matCellDef="let template" style="text-align: center;">
|
|
<button mat-icon-button color="info" (click)="showTemplate($event, template)">
|
|
<mat-icon>visibility</mat-icon>
|
|
</button>
|
|
<button mat-icon-button color="primary" (click)="editPxeTemplate(template)">
|
|
<mat-icon>edit</mat-icon>
|
|
</button>
|
|
<button mat-icon-button color="warn" [disabled]="template.isDefault" (click)="toggleAction(template, 'delete')">
|
|
<mat-icon>delete</mat-icon>
|
|
</button>
|
|
</td>
|
|
</ng-container>
|
|
|
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
|
</table>
|
|
|
|
<div class="paginator-container" joyrideStep="paginationStep" text="{{ 'paginationDescription' | translate }}">
|
|
<mat-paginator [length]="length" [pageSize]="itemsPerPage" [pageIndex]="page" [pageSizeOptions]="pageSizeOptions"
|
|
(page)="onPageChange($event)">
|
|
</mat-paginator>
|
|
</div>
|