Updated partition assistant. Extented partition

pull/81/head
Manuel Aranda Rosales 2026-05-04 18:43:40 +02:00
parent 827f8557c9
commit 2519eb8054
5 changed files with 91 additions and 4 deletions

View File

@ -644,6 +644,41 @@
background-color: #c82333;
}
/* EXTENDED partition row */
.extended-row {
background-color: #fff8e1 !important;
border-left: 4px solid #ffa000;
}
.extended-row td {
border-bottom: 1px solid #ffe082;
}
/* Logical partitions (inside EXTENDED) */
.logical-row {
background-color: #fffde7 !important;
border-left: 4px solid #ffd54f;
}
.logical-row td {
border-bottom: 1px solid #fff9c4;
}
.logical-indent {
color: #ffa000;
font-size: 14px;
margin-right: 4px;
font-weight: bold;
}
/* Disabled size inputs */
.partition-table input[type="number"]:disabled {
background-color: #f5f5f5;
color: #9e9e9e;
cursor: not-allowed;
border-color: #e0e0e0;
}
.chart-container {
flex: 0 0 280px;
max-width: 280px;

View File

@ -187,8 +187,15 @@
</thead>
<tbody>
<ng-container *ngFor="let partition of selectedDisk.partitions; let j = index">
<tr *ngIf="!partition.removed">
<td>{{ partition.partitionNumber }}</td>
<tr *ngIf="!partition.removed"
[ngClass]="{
'extended-row': partition.partitionCode === 'EXTENDED',
'logical-row': isLogicalPartition(selectedDisk.partitions, j)
}">
<td>
<span *ngIf="isLogicalPartition(selectedDisk.partitions, j)" class="logical-indent">└</span>
{{ partition.partitionNumber }}
</td>
<td>
<select [(ngModel)]="partition.partitionCode" required>
<option *ngFor="let type of partitionTypes" [value]="type.name">
@ -205,10 +212,12 @@
</td>
<td>
<input type="number" [(ngModel)]="partition.size" required
[disabled]="partition.partitionCode === 'EXTENDED'"
(input)="updatePartitionSize(selectedDisk.diskNumber, j, partition.size)" />
</td>
<td>
<input type="number" [(ngModel)]="partition.percentage"
[disabled]="partition.partitionCode === 'EXTENDED'"
(input)="updatePartitionSizeFromPercentage(selectedDisk.diskNumber, j, partition.percentage)" />
</td>
<td>

View File

@ -892,11 +892,20 @@ export class PartitionAssistantComponent implements OnInit, AfterViewInit, OnDes
private recalculatePartitionNumbers(partitions: Partition[]): void {
const activePartitions = partitions.filter(partition => !partition.removed);
activePartitions.sort((a, b) => a.partitionNumber - b.partitionNumber);
activePartitions.forEach((partition, index) => {
partition.partitionNumber = index + 1;
});
}
isLogicalPartition(partitions: Partition[], currentIndex: number): boolean {
for (let i = 0; i < currentIndex; i++) {
if (!partitions[i].removed && partitions[i].partitionCode === 'EXTENDED') {
return true;
}
}
return false;
}
}

View File

@ -320,6 +320,14 @@
[buttonText]="'ejecutarComandos' | translate" [disabled]="selection.selected.length === 0"
[runScriptContext]="getRunScriptContext(selection.selected)"></app-execute-command>
</div>
<button *ngIf="classroomCalendarUuid && !syncingUds" class="action-button" (click)="syncUds($event)"
matTooltip="Sincronizar calendarios con UDS" matTooltipShowDelay="500">
<mat-icon>sync</mat-icon>
Sincronizar con UDS
</button>
<mat-spinner *ngIf="syncingUds" diameter="24" style="margin: 0 8px;"></mat-spinner>
<button class="action-button delete-button" [disabled]="selection.selected.length === 0" (click)="deleteMultipleClients($event)"
matTooltip="{{ 'deleteMultipleClientsTooltip' | translate }}" matTooltipShowDelay="1000">
<mat-icon>delete</mat-icon>

View File

@ -80,6 +80,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
selectedTreeFilter = '';
syncingClientIds = new Set<string>();
isCheckingNodeStatus = false;
syncingUds = false;
private originalTreeData: TreeNode[] = [];
arrayClients: any[] = [];
filters: { [key: string]: string } = {};
@ -1377,4 +1378,29 @@ export class GroupsComponent implements OnInit, OnDestroy {
dialogRef.afterClosed().subscribe(() => {
});
}
get classroomCalendarUuid(): string | null {
const client = this.selectedClients.data.find((c: any) => c.organizationalUnit?.remoteCalendar?.uuid);
return (client as any)?.organizationalUnit?.remoteCalendar?.uuid || null;
}
syncUds(event: MouseEvent): void {
event.stopPropagation();
const uuid = this.classroomCalendarUuid;
if (!uuid) {
this.toastr.warning('Este nodo no tiene un calendario remoto asociado');
return;
}
this.syncingUds = true;
this.http.post(`${this.baseUrl}/remote-calendars/${uuid}/sync-uds`, {}).subscribe({
next: () => {
this.toastr.success(this.translate.instant('calendarsSynchronizedCorrectly'));
this.syncingUds = false;
},
error: (error: any) => {
this.toastr.error(error.error?.['hydra:description'] || 'Error al sincronizar con UDS');
this.syncingUds = false;
}
});
}
}