84 lines
3.4 KiB
HTML
84 lines
3.4 KiB
HTML
<div class="models">
|
|
<div class="models__toolbar">
|
|
<mat-button-toggle-group hideSingleSelectionIndicator [value]="domain()" (change)="setDomain($event.value)" aria-label="Dominio">
|
|
@for (option of domains; track option.id) {
|
|
<mat-button-toggle [value]="option.id">{{ option.label }}</mat-button-toggle>
|
|
}
|
|
</mat-button-toggle-group>
|
|
<span class="models__spacer"></span>
|
|
<button mat-stroked-button type="button" [disabled]="training()" (click)="train()"
|
|
matTooltip="Entrena el modelo cacu/cin2_logistic con la cohorte de vigilancia vigente y lo pone en producción">
|
|
<mat-icon aria-hidden="true">model_training</mat-icon>Entrenar cacu/cin2_logistic
|
|
</button>
|
|
<button mat-icon-button type="button" (click)="reload()" aria-label="Recargar" matTooltip="Recargar">
|
|
<mat-icon aria-hidden="true">refresh</mat-icon>
|
|
</button>
|
|
</div>
|
|
|
|
@if (loading() || training()) {
|
|
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
|
|
}
|
|
@if (loadError(); as error) {
|
|
<p class="models__alert" role="alert"><mat-icon aria-hidden="true">error</mat-icon>{{ error }}</p>
|
|
}
|
|
|
|
<table mat-table [dataSource]="versions()" class="models__table">
|
|
<ng-container matColumnDef="version">
|
|
<th mat-header-cell *matHeaderCellDef>Versión</th>
|
|
<td mat-cell *matCellDef="let v">
|
|
<div class="models__tag">{{ v.name }}:{{ v.version }}</div>
|
|
@if (metrics(v).length) {
|
|
<mat-chip-set>
|
|
@for (metric of metrics(v); track metric.key) {
|
|
<mat-chip>{{ metric.key }}: {{ metric.value }}</mat-chip>
|
|
}
|
|
</mat-chip-set>
|
|
}
|
|
</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="scenario">
|
|
<th mat-header-cell *matHeaderCellDef>Dominio · escenario</th>
|
|
<td mat-cell *matCellDef="let v">{{ v.tags.domain }} · {{ v.tags.scenario }}</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="environment">
|
|
<th mat-header-cell *matHeaderCellDef>Entorno</th>
|
|
<td mat-cell *matCellDef="let v">
|
|
<span class="models__env" [class.models__env--prod]="v.tags.environment === 'PROD'">{{ v.tags.environment }}</span>
|
|
</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="armado">
|
|
<th mat-header-cell *matHeaderCellDef>Armado de cohorte</th>
|
|
<td mat-cell *matCellDef="let v">{{ v.tags['kit.armado_id'] ?? 'Sin enlazar' }}</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="status">
|
|
<th mat-header-cell *matHeaderCellDef>Estatus</th>
|
|
<td mat-cell *matCellDef="let v"><app-model-status [status]="v.status"></app-model-status></td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="created_at">
|
|
<th mat-header-cell *matHeaderCellDef>Creada</th>
|
|
<td mat-cell *matCellDef="let v">{{ v.created_at | date: 'short' }}</td>
|
|
</ng-container>
|
|
|
|
<ng-container matColumnDef="acciones">
|
|
<th mat-header-cell *matHeaderCellDef></th>
|
|
<td mat-cell *matCellDef="let v">
|
|
<button mat-button type="button" (click)="open(v)">
|
|
<mat-icon aria-hidden="true">info</mat-icon>Detalle
|
|
</button>
|
|
</td>
|
|
</ng-container>
|
|
|
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
|
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
|
|
</table>
|
|
|
|
@if (!loading() && versions().length === 0) {
|
|
<p class="models__empty"><mat-icon aria-hidden="true">model_training</mat-icon>Aún no hay versiones entrenadas para este filtro.</p>
|
|
}
|
|
</div>
|