opcion para seleccionar sólo actualizar cache en una restauración de imagen
testing/ogGui-multibranch/pipeline/head There was a failure building this commit Details

pull/65/head^2
Juan Manuel Bardallo 2026-04-13 12:41:54 +02:00
parent 3174f5695d
commit f54eb5e45e
4 changed files with 154 additions and 49 deletions

View File

@ -708,11 +708,83 @@ table {
font-size: 13px;
}
.section-hint mat-icon {
color: #667eea;
font-size: 18px;
width: 18px;
height: 18px;
/* Deploy mode radio group */
.form-section-row {
display: flex;
align-items: flex-start;
gap: 20px;
flex-wrap: wrap;
margin-bottom: 20px;
padding: 16px 20px;
background: #f7faff;
border-radius: 10px;
border: 1px solid #e2e8ff;
}
.deploy-mode-label {
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
font-weight: 600;
color: #2c3e50;
min-width: 140px;
padding-top: 12px;
}
.deploy-mode-label mat-icon {
color: #667eea;
}
.deploy-mode-radio-group {
display: flex;
gap: 16px;
flex-wrap: wrap;
}
.deploy-mode-radio {
border: 2px solid #e2e8ff;
border-radius: 10px;
padding: 10px 16px;
background: white;
transition: border-color 0.2s, box-shadow 0.2s;
cursor: pointer;
}
.deploy-mode-radio:has(.mat-radio-button-checked),
.deploy-mode-radio:hover {
border-color: #667eea;
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}
.deploy-mode-option {
display: flex;
align-items: center;
gap: 10px;
}
.deploy-mode-option mat-icon {
color: #667eea;
font-size: 20px;
width: 20px;
height: 20px;
}
.deploy-mode-option div {
display: flex;
flex-direction: column;
}
.deploy-mode-option-title {
font-size: 13px;
font-weight: 600;
color: #2c3e50;
line-height: 1.2;
}
.deploy-mode-option-desc {
font-size: 11px;
color: #6c757d;
margin-top: 2px;
}

View File

@ -198,6 +198,36 @@
</mat-form-field>
</div>
<!-- Modo de despliegue: solo visible para métodos no-direct -->
@if (imageType === 'monolithic' && selectedMethod && !isDirectMethod()) {
<div class="form-section-row">
<div class="deploy-mode-label">
<mat-icon>cached</mat-icon>
<span>Modo de operación</span>
</div>
<mat-radio-group [(ngModel)]="deployMode" name="deployMode" class="deploy-mode-radio-group">
<mat-radio-button value="deploy" color="primary" class="deploy-mode-radio">
<div class="deploy-mode-option">
<mat-icon>storage</mat-icon>
<div>
<span class="deploy-mode-option-title">Despliegue completo</span>
<span class="deploy-mode-option-desc">Actualiza caché y restaura partición</span>
</div>
</div>
</mat-radio-button>
<mat-radio-button value="update-cache" color="primary" class="deploy-mode-radio">
<div class="deploy-mode-option">
<mat-icon>download</mat-icon>
<div>
<span class="deploy-mode-option-title">Solo actualizar caché</span>
<span class="deploy-mode-option-desc">Descarga imagen sin restaurar partición</span>
</div>
</div>
</mat-radio-button>
</mat-radio-group>
</div>
}
<div *ngIf="errorMessage" class="error-message">
{{ errorMessage }}
</div>

View File

@ -43,6 +43,7 @@ export class DeployImageComponent implements OnInit{
showInstructions: boolean = false;
loadingCommits: boolean = false;
selectedGitRepository: string = '';
deployMode: string = 'deploy'; // 'deploy' | 'update-cache'
protected p2pModeOptions = [
{ name: 'Leecher', value: 'leecher' },
@ -354,6 +355,7 @@ export class DeployImageComponent implements OnInit{
type: this.imageType,
queue: result,
clients: this.selectedClients.map((client: any) => client.uuid),
deployMode: this.isDirectMethod() ? 'deploy' : this.deployMode,
};
url = `${this.baseUrl}/image-image-repositories/${this.selectedImage.uuid}/deploy-image`;
@ -418,6 +420,11 @@ export class DeployImageComponent implements OnInit{
return true;
}
isDirectMethod(): boolean {
return this.selectedMethod === 'unicast-direct' ||
this.selectedMethod === 'udpcast-direct';
}
openScheduleModal(): void {
let scope = this.runScriptContext?.type || 'clients';

View File

@ -44,73 +44,69 @@
<h3 class="disk-card-title">Disco {{ disk.diskNumber }}</h3>
<div class="disk-card-metrics-wrapper">
<mat-chip class="disk-card-metrics-chip">
Total: {{ disk.total.toFixed(2) }} GB &nbsp;|&nbsp; Usado: {{ (disk.used).toFixed(2) }} GB ({{ disk.percentage }}%)
Total: {{ disk.total.toFixed(2) }} GB &nbsp;|&nbsp; Usado: {{ (disk.used).toFixed(2) }} GB ({{
disk.percentage }}%)
</mat-chip>
</div>
</div>
<div class="disk-card-layout">
<div class="disk-table-container">
<table mat-table [dataSource]="disk.partitions" class="disk-table">
@for (column of columns; track column.columnDef) {
<ng-container [matColumnDef]="column.columnDef">
<th mat-header-cell *matHeaderCellDef> {{ column.header }} </th>
<td mat-cell *matCellDef="let image">
@if (column.columnDef !== 'size' && column.columnDef !== 'operativeSystem') {
@for (column of columns; track column.columnDef) {
<ng-container [matColumnDef]="column.columnDef">
<th mat-header-cell *matHeaderCellDef> {{ column.header }} </th>
<td mat-cell *matCellDef="let image">
@if (column.columnDef !== 'size' && column.columnDef !== 'operativeSystem') {
{{ column.cell(image) }}
}
@if (column.columnDef === 'size') {
}
@if (column.columnDef === 'size') {
<mat-chip color="primary">
{{ (image.size / 1024).toFixed(2) }} GB
</mat-chip>
}
}
@if (column.columnDef === 'operativeSystem') {
@if (column.columnDef === 'operativeSystem') {
<div class="os-col-wrapper">
@if (image.filesystem === 'CACHE' && image.cacheContent) {
<span class="cache-title">Contenido:</span>
@for (item of parseCacheContent(image.cacheContent); track item.name) {
<div class="cache-item">
• {{ item.name }} ({{ item.size }})
</div>
}
<span class="cache-title">Contenido:</span>
@for (item of parseCacheContent(image.cacheContent); track item.name) {
<div class="cache-item">
• {{ item.name }} ({{ item.size }})
</div>
}
}
@if (image.filesystem !== 'CACHE' || !image.cacheContent) {
<span>{{image.operativeSystem?.name }}</span>
<span class="image-name">{{ image.image?.name }}</span>
@if (image.deployDate) {
<span class="image-date">Instalada el {{ image.deployDate | date:'dd/MM/yyyy HH:mm' }}</span>
}
<span>{{image.operativeSystem?.name }}</span>
<span class="image-name">{{ image.image?.name }}</span>
@if (image.deployDate) {
<span class="image-date">Desplegada: {{ image.deployDate | date:'dd/MM/yyyy HH:mm' }}</span>
}
}
</div>
}
</td>
</ng-container>
}
}
</td>
</ng-container>
}
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<ng-container>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [hidden]="row.partitionNumber === 0"></tr>
</ng-container>
</table>
<ng-container>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [hidden]="row.partitionNumber === 0">
</tr>
</ng-container>
</table>
</div>
</div>
<div class="charts-container disk-chart-container">
<div class="disk-chart-wrapper">
<ngx-charts-pie-chart
class="chart"
[view]="[360, 230]"
[results]="disk.chartData"
[doughnut]="true"
[legend]="true"
[legendPosition]="legendPosition"
[legendTitle]="''">
</ngx-charts-pie-chart>
<div class="charts-container disk-chart-container">
<div class="disk-chart-wrapper">
<ngx-charts-pie-chart class="chart" [view]="[360, 230]" [results]="disk.chartData" [doughnut]="true"
[legend]="true" [legendPosition]="legendPosition" [legendTitle]="''">
</ngx-charts-pie-chart>
</div>
</div>
</div>
</div>
</mat-card>
</div>