-
+
{{ 'selectOptionLabel' | translate }} @@ -70,12 +70,12 @@ >>>>>>> Stashed changes
-
+
- + - + {{ result.name }} @@ -106,7 +106,7 @@
-
+
diff --git a/ogWebconsole/src/app/components/groups/components/advanced-search/advanced-search.component.ts b/ogWebconsole/src/app/components/groups/components/advanced-search/advanced-search.component.ts index fcf0bfe..59a2190 100644 --- a/ogWebconsole/src/app/components/groups/components/advanced-search/advanced-search.component.ts +++ b/ogWebconsole/src/app/components/groups/components/advanced-search/advanced-search.component.ts @@ -23,6 +23,7 @@ import { Router } from '@angular/router'; import { CreatePxeBootFileComponent } from "../../../ogboot/pxe-boot-files/create-pxeBootFile/create-pxe-boot-file/create-pxe-boot-file.component"; +import { JoyrideService } from 'ngx-joyride'; @Component({ @@ -69,7 +70,8 @@ export class AdvancedSearchComponent { private toastService: ToastrService, private _bottomSheet: MatBottomSheet, private http: HttpClient, - private router: Router + private router: Router, + private joyrideService: JoyrideService ) {} ngOnInit(): void { @@ -436,4 +438,23 @@ export class AdvancedSearchComponent { } } + iniciarTour(): void { + this.joyrideService.startTour({ + steps: [ + 'title2Step', + 'filterSelectionStep', + 'viewModeStep', + 'filtersStep', + 'selectAllStep', + 'saveFiltersStep', + 'sendActionStep', + 'addPxeStep', + 'resultsStep', + 'paginationStep' + ], + showPrevButton: true, + themeColor: '#3f51b5' + }); + } + } diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css index 0dad576..25ecb56 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css @@ -205,3 +205,37 @@ border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } + +.circular-chart { + display: block; + margin: 0 auto; + max-width: 100%; + max-height: 150px; +} + +.circle-bg { + fill: none; + stroke: #f0f0f0; + stroke-width: 3.8; +} + +.circle { + fill: none; + stroke-width: 3.8; + stroke-linecap: round; + animation: progress 1s ease-out forwards; +} + +/* Define colores distintos para cada partición */ +.partition-0 { stroke: #00bfa5; } /* Ejemplo: verde */ +.partition-1 { stroke: #ff6f61; } /* Ejemplo: rojo */ +.partition-2 { stroke: #ffb400; } /* Ejemplo: amarillo */ +.partition-3 { stroke: #3498db; } /* Ejemplo: azul */ + +/* Texto en el centro del gráfico */ +.percentage { + fill: #333; + font-size: 0.7rem; + text-anchor: middle; +} + diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html index 9ff63e6..41ccaee 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.html @@ -67,17 +67,20 @@

{{ 'diskTitle' | translate }} {{ disk.diskNumber }}

- - - - {{ disk.percentage }}% + + + + + + + + {{ (disk.used / disk.total * 100).toFixed(0) }}%

{{ 'diskUsedLabel' | translate }}: {{ disk.used }} GB ({{ disk.percentage }}%)

@@ -86,4 +89,5 @@
+
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.ts index 574dd78..3e4c70f 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.ts +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.ts @@ -4,6 +4,7 @@ import {DatePipe} from "@angular/common"; import {MatTableDataSource} from "@angular/material/table"; import {PartitionAssistantComponent} from "./partition-assistant/partition-assistant.component"; import {MatDialog} from "@angular/material/dialog"; +import {Router} from "@angular/router"; interface ClientInfo { property: string; @@ -62,7 +63,11 @@ export class ClientMainViewComponent implements OnInit { isDiskUsageEmpty: boolean = true; loading: boolean = true; - constructor(private http: HttpClient, private dialog: MatDialog) { + constructor( + private http: HttpClient, + private dialog: MatDialog, + private router: Router + ) { const url = window.location.href; const segments = url.split('/'); this.clientUuid = segments[segments.length - 1]; @@ -105,12 +110,13 @@ export class ClientMainViewComponent implements OnInit { } calculateDiskUsage() { - const diskUsageMap = new Map(); + const diskUsageMap = new Map(); this.partitions.forEach((partition: any) => { const diskNumber = partition.diskNumber; + if (!diskUsageMap.has(diskNumber)) { - diskUsageMap.set(diskNumber, { total: 0, used: 0 }); + diskUsageMap.set(diskNumber, { total: 0, used: 0, partitions: [] }); } const diskData = diskUsageMap.get(diskNumber); @@ -118,17 +124,28 @@ export class ClientMainViewComponent implements OnInit { if (partition.partitionNumber === 0) { diskData!.total = Number((partition.size / 1024).toFixed(2)); } else { - diskData!.used += Number(((partition.size * (partition.memoryUsage / 100))/ 1024).toFixed(2)); + diskData!.used += Number(((partition.size * (partition.memoryUsage / 100)) / 1024).toFixed(2)); + diskData!.partitions.push(partition); } }); - this.diskUsageData = Array.from(diskUsageMap.entries()).map(([diskNumber, { total, used }]) => { + this.diskUsageData = Array.from(diskUsageMap.entries()).map(([diskNumber, { total, used, partitions }]) => { const percentage = total > 0 ? Math.round((used / total) * 100) : 0; - return { diskNumber, total, used, percentage }; + return { diskNumber, total, used, percentage, partitions }; }); + this.isDiskUsageEmpty = this.diskUsageData.length === 0; } + getStrokeOffset(partitions: any[], index: number): number { + const totalSize = partitions.reduce((acc, part) => acc + (part.size / 1024), 0); + + const offset = partitions.slice(0, index).reduce((acc, part) => acc + (part.size / 1024), 0); + console.log(offset, totalSize) + + return totalSize > 0 ? (offset / totalSize) : 0; + } + loadPartitions(): void { this.http.get(`${this.baseUrl}/partitions?client.id=${this.clientData?.id}`).subscribe({ next: data => { @@ -155,18 +172,14 @@ export class ClientMainViewComponent implements OnInit { onCommandSelect(command: any): void { if (command.name === 'Particionar y Formatear') { - this.openPartitionDialog(); + this.openPartitionAssistant(); } } - openPartitionDialog(): void { - const dialogRef = this.dialog.open(PartitionAssistantComponent, { - width: '1000px', - data: this.clientData['@id'] - }); - - dialogRef.afterClosed().subscribe((result: any) => { - console.log('El diálogo se cerró', result); + openPartitionAssistant(): void { + console.log(this.clientData) + this.router.navigate([`/client/${this.clientData.uuid}/partition-assistant`]).then(r => { + console.log('navigated', r); }); } } diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.css b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.css index 1615bc2..284808b 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.css +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.css @@ -5,20 +5,12 @@ margin: 20px auto; } -.header { +.header-container { display: flex; - align-items: center; justify-content: space-between; - margin-bottom: 15px; + align-items: center; + height: 100px; padding: 10px; - background-color: #cecbcb; - border-radius: 8px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -} - -.header label { - font-weight: 500; - margin-right: 10px; } .disk-size { @@ -44,6 +36,11 @@ font-weight: 500; font-size: 0.9rem; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2); + border-right: 2px solid white; /* Borde de separación */ +} + +.partition-segment:last-child { + border-right: none; } .partition-table { diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.html b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.html index 2d8d3be..ad4b1e9 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.html +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.html @@ -24,17 +24,17 @@ Tamaño: {{ (disk.totalDiskSize / 1024).toFixed(2) }} GB
-
-
- {{ partition.type }} ({{ (partition.size / 1024).toFixed(2) }} GB) -
+
+
+ {{ partition.type }} ({{ (partition.size / 1024).toFixed(2) }} GB)
+
- +