42 lines
1.5 KiB
HTML
42 lines
1.5 KiB
HTML
<div class="env-settings">
|
|
<div class="header-container">
|
|
<div class="header-container-title">
|
|
<h2>Editar Variables de Entorno</h2>
|
|
</div>
|
|
</div>
|
|
|
|
<mat-table [dataSource]="envVars" class="mat-elevation-z8">
|
|
<!-- Nombre de la variable -->
|
|
<ng-container matColumnDef="name">
|
|
<mat-header-cell *matHeaderCellDef> Variable </mat-header-cell>
|
|
<mat-cell *matCellDef="let variable">{{ variable.name }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Valor de la variable -->
|
|
<ng-container matColumnDef="value">
|
|
<mat-header-cell *matHeaderCellDef> Valor </mat-header-cell>
|
|
<mat-cell *matCellDef="let variable">
|
|
<!-- Si es booleano, usamos checkbox -->
|
|
<mat-checkbox *ngIf="isBoolean(variable.value)"
|
|
[checked]="variable.value === 'true'"
|
|
(change)="variable.value = $event.checked ? 'true' : 'false'">
|
|
</mat-checkbox>
|
|
|
|
<!-- Si no es booleano, usamos input -->
|
|
<mat-form-field *ngIf="!isBoolean(variable.value)" class="value-input">
|
|
<input matInput [(ngModel)]="variable.value" />
|
|
</mat-form-field>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
|
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
|
</mat-table>
|
|
|
|
<div class="actions">
|
|
<button class="action-button" (click)="loadEnvVars()">Recargar</button>
|
|
<button class="submit-button" (click)="saveEnvVars()">Guardar Cambios</button>
|
|
</div>
|
|
</div>
|