Muestra el contenido de la cache de un disco, nombre del fichero y tamaño

pull/60/head
Juan Manuel Bardallo 2026-03-30 10:16:04 +02:00
parent 978a1a98ff
commit 566d200455
2 changed files with 21 additions and 3 deletions

View File

@ -47,8 +47,17 @@
<ng-container *ngIf="column.columnDef === 'operativeSystem'">
<div style="display: flex; flex-direction: column;">
<span>{{image.operativeSystem?.name }}</span>
<span style="font-size: 0.75rem; color: gray;">{{ image.image?.name }}</span>
<div *ngIf="image.filesystem === 'CACHE' && image.cacheContent">
<span style="font-weight: bold; font-size: 0.8rem; color: #666;">Contenido:</span>
<div *ngFor="let item of parseCacheContent(image.cacheContent)"
style="font-size: 0.75rem; color: #666;">
• {{ item.name }} ({{ item.size }})
</div>
</div>
<div *ngIf="image.filesystem !== 'CACHE' || !image.cacheContent">
<span>{{image.operativeSystem?.name }}</span>
<span style="font-size: 0.75rem; color: gray;">{{ image.image?.name }}</span>
</div>
</div>
</ng-container>
</td>
@ -80,4 +89,4 @@
</mat-dialog-content>
<mat-dialog-actions class="action-container">
<button class="ordinary-button" (click)="onNoClick()">{{ 'closeButton' | translate }}</button>
</mat-dialog-actions>
</mat-dialog-actions>

View File

@ -194,6 +194,15 @@ export class ClientDetailsComponent {
});
}
parseCacheContent(content: string): { name: string, size: string }[] {
if (!content) return [];
return content.split(',').map(item => {
const [name, bytes] = item.split(':');
const sizeMB = (parseInt(bytes) / (1024 * 1024)).toFixed(2) + ' MB';
return { name, size: sizeMB };
});
}
onNoClick(): void {
this.dialog.closeAll();
}