oggui/ogWebconsole/src/app/components/hardware-profile/hardware-profile.component....

89 lines
4.8 KiB
HTML

<div class="header-container">
<button mat-icon-button color="primary" (click)="iniciarTour()">
<mat-icon>help</mat-icon>
</button>
<div class="header-container-title">
<h2 i18n="@@adminImagesTitle" joyrideStep="titleStep"
text="Administra los perfiles de hardware disponibles desde este componente.">{{ 'manageHardwareProfiles' | translate }}</h2>
</div>
</div>
<div class="search-container" joyrideStep="searchStep"
text="Utiliza los filtros para buscar entre el hardware listado.">
<mat-form-field appearance="fill" class="search-string" style="width: 50%; margin-right: 8px;">
<mat-label i18n="@@searchLabel">{{ 'placeholderSearchHardwareName' | translate }}</mat-label>
<input matInput name="searchBar" [placeholder]="'labelSearch' | translate" [(ngModel)]="filters['name']" (keyup.enter)="search()"
i18n-placeholder="@@searchPlaceholder">
<mat-icon matSuffix>search</mat-icon>
<mat-hint i18n="@@searchHint">{{ 'searchHint' | translate }}</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill" class="search-select" style="width: 50%; margin-left: 8px;">
<input type="text" matInput [formControl]="clientControl" [matAutocomplete]="clientAuto" #commandClientInput
placeholder="{{ 'filterClientPlaceholder' | translate }}">
<mat-autocomplete #clientAuto="matAutocomplete" [displayWith]="displayFnClient"
(optionSelected)="onOptionClientSelected($event.option.value)">
<mat-option *ngFor="let client of filteredClients | async" [value]="client">
<div class="client-option">
<span class="client-name">{{ client.name }}</span>
<span class="client-details">{{ client.ip }} — {{ client.mac }}</span>
</div>
</mat-option>
</mat-autocomplete>
<button *ngIf="commandClientInput.value" mat-icon-button matSuffix [attr.aria-label]="'clearInputSearch' | translate"
(click)="clearClientFilter($event, commandClientInput)">
<mat-icon>close</mat-icon>
</button>
<mat-hint>{{ 'enterClientName' | translate }}</mat-hint>
</mat-form-field>
</div>
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8" joyride="tableStep"
text="Aquí se mostrará todo el hardware disponible y sus características.">
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
<th mat-header-cell *matHeaderCellDef> {{ column.header | translate }} </th>
<td mat-cell *matCellDef="let image">
<ng-container *ngIf="column.columnDef === 'isDefault' || column.columnDef === 'installed'">
<mat-icon [color]="image[column.columnDef] ? 'primary' : 'warn'">
{{ image[column.columnDef] ? 'check_circle' : 'cancel' }}
</mat-icon>
</ng-container>
<ng-container *ngIf="column.columnDef === 'clients'">
<div *ngIf="column.cell(image) !== 'N/A'; else noClientData" class="client-info">
<div class="client-name" *ngFor="let assignedClient of getVisibleClients(column.cell(image))">{{ assignedClient.name }}</div>
<div class="client-name client-more" *ngIf="column.cell(image).length > maxVisibleClients"
[matTooltip]="getHiddenClientNames(column.cell(image))">
{{ 'andMoreClients' | translate: { count: column.cell(image).length - maxVisibleClients } }}
</div>
</div>
<ng-template #noClientData>
<span>{{ 'labelNa' | translate }}</span>
</ng-template>
</ng-container>
<ng-container
*ngIf="column.columnDef !== 'isDefault' && column.columnDef !== 'installed' && column.columnDef !== 'downloadUrl' && column.columnDef !== 'clients'">
{{ column.cell(image) }}
</ng-container>
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef i18n="@@columnActions" style="text-align: center;">{{ 'actions' | translate }}</th>
<td mat-cell *matCellDef="let hardware" style="text-align: center;">
<button mat-icon-button color="primary" (click)="viewHardwareCollection(hardware)"
[matTooltip]="'viewHardwareCollection' | translate" i18n-matTooltip="@@viewHardwareCollection">
<mat-icon>visibility</mat-icon>
</button>
<button mat-icon-button color="warn" (click)="deleteHardware(hardware)"
i18n="@@buttonDelete"><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">
<mat-paginator [length]="length" [pageSize]="itemsPerPage" [pageIndex]="page" [pageSizeOptions]="pageSizeOptions"
(page)="onPageChange($event)">
</mat-paginator>
</div>