60 lines
2.9 KiB
HTML
60 lines
2.9 KiB
HTML
<section class="reports">
|
|
<h3 class="report__title">Versiones candidatas de TEA</h3>
|
|
@if (loading()) {
|
|
<mat-progress-bar mode="indeterminate" aria-label="Cargando versiones"></mat-progress-bar>
|
|
}
|
|
@if (loadError(); as error) {
|
|
<p class="report__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
|
|
}
|
|
@if (!loading() && !loadError()) {
|
|
@if (rows().length) {
|
|
<table mat-table [dataSource]="rows()" class="report__table" aria-label="Versiones candidatas">
|
|
<ng-container matColumnDef="apply">
|
|
<th mat-header-cell *matHeaderCellDef>Aplicar</th>
|
|
<td mat-cell *matCellDef="let row">
|
|
<mat-checkbox [checked]="row.checked" [disabled]="applying()" (change)="toggle(row)" [aria-label]="'Aplicar a ' + row.label"></mat-checkbox>
|
|
</td>
|
|
</ng-container>
|
|
<ng-container matColumnDef="version">
|
|
<th mat-header-cell *matHeaderCellDef>Versión</th>
|
|
<td mat-cell *matCellDef="let row">{{ row.label }}</td>
|
|
</ng-container>
|
|
<ng-container matColumnDef="status">
|
|
<th mat-header-cell *matHeaderCellDef>Estado</th>
|
|
<td mat-cell *matCellDef="let row">
|
|
@if (row.status === 'applying') {
|
|
<span class="report__status"><mat-progress-bar mode="indeterminate" class="report__bar"></mat-progress-bar>Aplicando…</span>
|
|
} @else if (row.status === 'done') {
|
|
<span class="report__status report__status--ok"><mat-icon aria-hidden="true">check_circle</mat-icon>Aplicado</span>
|
|
} @else if (row.status === 'error') {
|
|
<span class="report__status report__status--fail"><mat-icon aria-hidden="true">error</mat-icon>{{ row.error }}</span>
|
|
} @else {
|
|
<span class="report__status report__muted">Pendiente</span>
|
|
}
|
|
</td>
|
|
</ng-container>
|
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
</table>
|
|
} @else {
|
|
<p class="report__muted">No hay versiones eeg-* candidatas.</p>
|
|
}
|
|
}
|
|
|
|
<h3 class="report__title">Reportes de validación</h3>
|
|
<form class="report__form" [formGroup]="reports" (ngSubmit)="apply()">
|
|
@for (field of fields; track field.field) {
|
|
<mat-form-field appearance="outline" subscriptSizing="dynamic">
|
|
<mat-label>{{ field.label }}</mat-label>
|
|
<input matInput [formControlName]="field.field" placeholder="Ruta o URL del reporte" />
|
|
</mat-form-field>
|
|
}
|
|
<button mat-flat-button type="submit" color="primary" [disabled]="applying() || !hasReports() || !rows().some((r) => r.checked)">
|
|
<mat-icon aria-hidden="true">attach_file</mat-icon>Aplicar a las versiones de TEA
|
|
</button>
|
|
</form>
|
|
@if (result(); as line) {
|
|
<p class="report__muted" role="status">{{ line }}</p>
|
|
}
|
|
</section>
|