|
|
@@ -1,18 +1,52 @@
|
|
|
<div class="card-content-container">
|
|
|
- <div class="table-header">
|
|
|
- <h2 style="margin: 0; width: calc(100% - 160px);">Panel de Gestión de Perfiles (Total: 1)</h2>
|
|
|
- <button mat-flat-button style="width: 160px;">Crear Nuevo Perfil</button>
|
|
|
+ <div class="table-container" *ngIf="!isLoading && !hasError">
|
|
|
+ <div class="table-header">
|
|
|
+ <h2 style="margin: 0; width: calc(100% - 160px);">Panel de Gestión de Perfiles (Total: {{ profiles.length }})</h2>
|
|
|
+ <button mat-flat-button style="width: 160px;">Crear Nuevo Perfil</button>
|
|
|
+ </div>
|
|
|
+ <div class="table-row-white">
|
|
|
+ <mat-form-field class="example-full-width" appearance="outline" style="margin-bottom: -1.25em; width: calc(100% - 64px - 82px);padding: 0;">
|
|
|
+ <input matInput type="text" #searchInput (keyup.enter)="search(searchInput.value)">
|
|
|
+ </mat-form-field>
|
|
|
+ <button mat-flat-button style="margin-top: 4px;margin-left: -8px;margin-bottom: 5px; width: 82px;" color="primary"
|
|
|
+ (click)="search(searchInput.value)">Buscar</button>
|
|
|
+ <button mat-flat-button style="margin-top: 4px;margin-left: 8px;margin-bottom: 5px; width: 164px;" [disabled]="!searching"
|
|
|
+ (click)="clearSearch()">Limpiar búsqueda</button>
|
|
|
+ </div>
|
|
|
+ <div class="table-row-gray">
|
|
|
+ <div class="table-cell-header">ID</div>
|
|
|
+ <div class="table-cell-header">Nombre</div>
|
|
|
+ <div class="table-cell-header">Estatus</div>
|
|
|
+ <div class="table-cell-header">Permisos</div>
|
|
|
+ <div class="table-cell-header">Acciones</div>
|
|
|
+ </div>
|
|
|
+ <div *ngFor="let profile of profilesFinded; let i = index" [class.table-row-gray]="i % 2 == 1" [class.table-row-white]="i % 2 == 0">
|
|
|
+ <div class="table-cell">{{ profile.IDPERFIL }}</div>
|
|
|
+ <div class="table-cell">{{ profile.NOMBREPERFIL }}</div>
|
|
|
+ <div class="table-cell">{{ profile.ESTATUS }}</div>
|
|
|
+ <div class="table-cell">{{ profile.PERMISOS }}</div>
|
|
|
+ <div class="table-cell">
|
|
|
+ <button mat-mini-fab color="primary" #tooltip="matTooltip" matTooltip="Editar permisos"
|
|
|
+ (click)="openPermissions(profile.IDPERFIL, profile.NOMBREPERFIL, 'edit')">
|
|
|
+ <mat-icon>edit</mat-icon>
|
|
|
+ </button>
|
|
|
+ <button mat-mini-fab #tooltip="matTooltip" matTooltip="Ver permisos" style="margin-left: 4px;" class="green"
|
|
|
+ (click)="openPermissions(profile.IDPERFIL, profile.NOMBREPERFIL, 'see')">
|
|
|
+ <mat-icon>visibility</mat-icon>
|
|
|
+ </button>
|
|
|
+ <button mat-mini-fab #tooltip="matTooltip" matTooltip="Eliminar perfil" style="margin-left: 4px;" color="warn">
|
|
|
+ <mat-icon>delete</mat-icon>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="table-row-white">
|
|
|
- <mat-form-field class="example-full-width" appearance="outline" style="margin-bottom: -1.25em; width: 100%;padding: 0;">
|
|
|
- <input matInput type="text">
|
|
|
- </mat-form-field>
|
|
|
- <button mat-flat-button style="margin-top: 4px;margin-left: -8px;margin-bottom: 5px;" color="primary">Buscar</button>
|
|
|
+ <div class="loader-container" *ngIf="isLoading">
|
|
|
+ <mat-spinner></mat-spinner>
|
|
|
+ <h2 class="loader-label">Cargando...</h2>
|
|
|
</div>
|
|
|
- <div class="table-row-gray">
|
|
|
- <div class="table-cell-header">ID</div>
|
|
|
- <div class="table-cell-header">Nombre</div>
|
|
|
- <div class="table-cell-header">Permisos</div>
|
|
|
- <div class="table-cell-header">Acciones</div>
|
|
|
+ <div class="error-container" *ngIf="!isLoading && hasError">
|
|
|
+ <mat-icon style="color: #e53935; transform: scale(5); margin-bottom: 48px;">error</mat-icon>
|
|
|
+ <h1 style="color: #e53935;">¡Error!</h1>
|
|
|
+ <p style="font-style: italic; font-size: 16px;">{{ errorStr }}</p>
|
|
|
</div>
|
|
|
</div>
|