96 lines
5.2 KiB
HTML
96 lines
5.2 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 class="title" i18n="@@subnetsTitle" joyrideStep="titleStep"
|
|
text="Desde aquí puedes gestionar las subredes configuradas en el servidor OgDHCP.">Administrar Subredes {{ serverName ? 'de ' + serverName : '' }}</h2>
|
|
</div>
|
|
<div class="subnets-button-row">
|
|
<button class="action-button" (click)="openSubnetInfoDialog()" joyrideStep="viewInfoStep"
|
|
[disabled]="!serverId"
|
|
text="Haz clic para ver información detallada de las subredes en el servidor.">{{ 'viewExternalInfo' | translate }}</button>
|
|
<button class="action-button" (click)="syncSubnets()" style="margin-left: 0.5rem;"
|
|
[disabled]="!serverId"
|
|
text="Sincronizar las subredes configuradas externamente con oggui.">{{ 'buttonSync' | translate }}</button>
|
|
<button class="action-button" (click)="addSubnet()" joyrideStep="addSubnetStep" style="margin-left: 0.5rem;"
|
|
text="Haz clic para añadir una nueva subred.">{{ 'buttonCreateLocalSubnet' | translate }}</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-container">
|
|
<mat-form-field appearance="fill" class="search-string" joyrideStep="searchNameStep"
|
|
text="Busca subredes por nombre para localizar una subred específica rápidamente.">
|
|
<mat-label i18n="@@searchLabel">{{ 'placeholderSearchSubnetName' | translate }}</mat-label>
|
|
<input matInput [placeholder]="'labelSearch' | translate" [(ngModel)]="filters['name']" 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-string" joyrideStep="searchNetmaskStep"
|
|
text="Busca subredes usando una netmask específica.">
|
|
<mat-label i18n="@@searchLabel">{{ 'placeholderSearchNetmask' | translate }}</mat-label>
|
|
<input matInput [placeholder]="'labelSearch' | translate" [(ngModel)]="filters['netmask']" 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-string" joyrideStep="searchIpStep"
|
|
text="Busca subredes por dirección IP.">
|
|
<mat-label i18n="@@searchLabel">{{ 'labelSearchIP' | translate }}</mat-label>
|
|
<input matInput [placeholder]="'labelSearch' | translate" [(ngModel)]="filters['ip']" i18n-placeholder="@@searchPlaceholder">
|
|
<mat-icon matSuffix>search</mat-icon>
|
|
<mat-hint i18n="@@searchHint">{{ 'searchHint' | translate }}</mat-hint>
|
|
</mat-form-field>
|
|
</div>
|
|
|
|
<app-loading [isLoading]="loading"></app-loading>
|
|
@if (!loading) {
|
|
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8" joyrideStep="tableStep"
|
|
text="Visualiza y administra las subredes listadas según los filtros aplicados.">
|
|
@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 subnet">
|
|
@if (column.columnDef === 'synchronized') {
|
|
<mat-icon [color]="subnet[column.columnDef] ? 'primary' : 'warn'">
|
|
{{ subnet[column.columnDef] ? 'check_circle' : 'cancel' }}
|
|
</mat-icon>
|
|
}
|
|
|
|
@if (column.columnDef === 'clients') {
|
|
<button class="action-button" (click)="openShowClientsDialog(subnet)" >{{ 'viewClients' | translate }}</button>
|
|
}
|
|
|
|
@if (column.columnDef !== 'synchronized' && column.columnDef !== 'clients') {
|
|
{{ column.cell(subnet) }}
|
|
}
|
|
</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 subnet" style="text-align: center;" joyrideStep="actionsStep"
|
|
text="Gestiona cada subred con opciones para editar, eliminar y más.">
|
|
<button mat-icon-button color="primary" (click)="editSubnet(subnet)" i18n="@@editSubnet">
|
|
<mat-icon>edit</mat-icon>
|
|
</button>
|
|
<button mat-icon-button color="primary"
|
|
(click)="addClientsToSubnet(subnet)"><mat-icon>computer</mat-icon></button>
|
|
<button mat-icon-button color="primary" (click)="deleteSubnetLeases(subnet)"
|
|
[matTooltip]="'deleteSubnetLeases' | translate"><mat-icon>delete_sweep</mat-icon></button>
|
|
<button mat-icon-button color="warn" (click)="toggleAction(subnet, '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="Navega entre las páginas de subredes usando el paginador.">
|
|
<mat-paginator [length]="length" [pageSize]="itemsPerPage" [pageIndex]="page" [pageSizeOptions]="pageSizeOptions"
|
|
(page)="onPageChange($event)">
|
|
</mat-paginator>
|
|
</div>
|