diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d4e7e4..b6047af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ # Changelog +## [0.13.0] - 2025-05-20 +### Added +- Se ha añadido nuevo campo "SSL_ENABLED" en el apartado configuracion. + +### Improved +- Mejoras en el asistente de particionado. +- Se han añadido mejoras en los filtros de las trazas. + +--- ## [0.12.0] - 2025-5-13 ### Added - Se ha añadido un nuevo modal del detalle de las acciones ejecutadas por cada cliente. diff --git a/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.html b/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.html index f4fbbc0..d9ef0db 100644 --- a/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.html +++ b/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.html @@ -16,12 +16,20 @@ Valor - + + + + + + + @@ -30,4 +38,4 @@ - \ No newline at end of file + diff --git a/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.ts b/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.ts index 8b8b79d..a47109d 100644 --- a/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.ts +++ b/ogWebconsole/src/app/components/admin/env-vars/env-vars.component.ts @@ -31,12 +31,15 @@ export class EnvVarsComponent { this.envVars = Object.entries(response.vars).map(([name, value]) => ({ name, value })); }, error: (err) => { - console.error('Error al cargar las variables de entorno:', err); this.toastService.error('No se pudieron cargar las variables de entorno.'); } }); } + isBoolean(value: string): boolean { + return value === 'true' || value === 'false'; + } + saveEnvVars(): void { const vars = this.envVars.reduce((acc, variable) => { acc[variable.name] = variable.value; diff --git a/ogWebconsole/src/app/components/commands/commands-task/create-task-schedule/create-task-schedule.component.ts b/ogWebconsole/src/app/components/commands/commands-task/create-task-schedule/create-task-schedule.component.ts index 9cf584f..b87c9c1 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/create-task-schedule/create-task-schedule.component.ts +++ b/ogWebconsole/src/app/components/commands/commands-task/create-task-schedule/create-task-schedule.component.ts @@ -115,6 +115,7 @@ export class CreateTaskScheduleComponent implements OnInit{ } convertDateToLocalISO(date: Date): string { + date = new Date(date); const adjustedDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); return adjustedDate.toISOString(); } diff --git a/ogWebconsole/src/app/components/commands/main-commands/create-command/create-command.component.ts b/ogWebconsole/src/app/components/commands/main-commands/create-command/create-command.component.ts index c7de763..a5f890b 100644 --- a/ogWebconsole/src/app/components/commands/main-commands/create-command/create-command.component.ts +++ b/ogWebconsole/src/app/components/commands/main-commands/create-command/create-command.component.ts @@ -75,6 +75,7 @@ export class CreateCommandComponent implements OnInit{ readOnly: this.createCommandForm.value.readOnly, enabled: this.createCommandForm.value.enabled, comments: this.createCommandForm.value.comments, + parameters: this.createCommandForm.value.parameters, }; if (this.commandId) { 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 34290de..ec2d67c 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 @@ -10,11 +10,11 @@
- +
-
@@ -101,15 +101,15 @@
- Espacio usado: {{ selectedDisk.used }} MB + Espacio usado: {{ selectedDisk.used | number:'1.2-2' }} MB
- Espacio libre: {{ selectedDisk.totalDiskSize - selectedDisk.used}} MB + Espacio libre: {{ (selectedDisk.totalDiskSize - selectedDisk.used) | number:'1.2-2' }} MB
- Espacio total: {{ selectedDisk.totalDiskSize }} MB + Espacio total: {{ selectedDisk.totalDiskSize | number:'1.2-2' }} MB
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts index 9632c68..2eb888d 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts @@ -109,8 +109,8 @@ export class PartitionAssistantComponent implements OnInit{ this.http.get(url).subscribe( (response) => { this.data = response; - this.initializeDisks(); this.partitionCode = this.data.partitions[0].partitionCode; + this.initializeDisks(); }, (error) => { console.error('Error al cargar los datos del cliente:', error); @@ -160,11 +160,11 @@ export class PartitionAssistantComponent implements OnInit{ disk!.partitions.push({ uuid: partition.uuid, partitionNumber: partition.partitionNumber, - size: this.convertBytesToGB(partition.size), + size: this.convertBytesToGB(partition.partitionNumber === 1 && this.partitionCode === 'GPT' ? 512 : partition.size), memoryUsage: partition.memoryUsage, - partitionCode: partition.partitionCode, + partitionCode: partition.partitionNumber === 1 && this.partitionCode === 'GPT' ? 'EFI' : partition.partitionCode, filesystem: partition.filesystem, - sizeBytes: partition.size, + sizeBytes: partition.partitionNumber === 1 && this.partitionCode === 'GPT' ? 512 : partition.size, format: false, color: '#1f1b91', percentage: 0, @@ -254,8 +254,6 @@ export class PartitionAssistantComponent implements OnInit{ if (disk) { const remainingGB = this.getRemainingGB(disk.partitions, disk.totalDiskSize); - console.log('Remaining GB:', remainingGB); - console.log('Total Disk Size:', disk); if (remainingGB > 0) { const removedPartitions = disk.partitions.filter((p) => !p.removed); diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html index 74465cf..c4daeef 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html @@ -101,7 +101,7 @@
-
+

Ingrese los parámetros:

diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts index 56dd99e..b463fc0 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts @@ -77,15 +77,12 @@ export class RunScriptAssistantComponent implements OnInit{ if (!ctx) { return ''; } - // Si es un array de clientes if (Array.isArray(ctx)) { return ctx.map(c => c.name).join(', '); } - // Si es un objeto con propiedad name if (typeof ctx === 'object' && 'name' in ctx) { return ctx.name; } - // Si es un string plano return String(ctx); } diff --git a/ogWebconsole/src/app/components/groups/shared/organizational-units/manage-organizational-unit/manage-organizational-unit.component.ts b/ogWebconsole/src/app/components/groups/shared/organizational-units/manage-organizational-unit/manage-organizational-unit.component.ts index 1ae3a86..792db32 100644 --- a/ogWebconsole/src/app/components/groups/shared/organizational-units/manage-organizational-unit/manage-organizational-unit.component.ts +++ b/ogWebconsole/src/app/components/groups/shared/organizational-units/manage-organizational-unit/manage-organizational-unit.component.ts @@ -177,12 +177,15 @@ export class ManageOrganizationalUnitComponent implements OnInit { } onParentChange(event: any): void { - this.setOrganizationalUnitDefaults(event.value); + if (!this.isEditMode) { + this.setOrganizationalUnitDefaults(event.value); + } } setOrganizationalUnitDefaults(unitId: string): void { const selectedUnit: any = this.parentUnitsWithPaths.find(unit => unit.id === unitId); - if (selectedUnit) { + const exclude = this.generalFormGroup.get('excludeParentChanges')?.value; + if (selectedUnit && !exclude) { this.networkSettingsFormGroup.patchValue({ repository: selectedUnit.repository || null, hardwareProfile: selectedUnit.hardwareProfile || null, @@ -204,6 +207,127 @@ export class ManageOrganizationalUnitComponent implements OnInit { } } + loadData(uuid: string): Promise { + return new Promise((resolve, reject) => { + const url = `${this.baseUrl}/organizational-units/${uuid}`; + + this.http.get(url).subscribe( + data => { + const exclude = data.excludeParentChanges; + + this.generalFormGroup.patchValue({ + name: data.name, + parent: data.parent ? data.parent['@id'] : '', + description: data.description, + type: data.type, + excludeParentChanges: exclude + }); + + this.additionalInfoFormGroup.patchValue({ + comments: data.comments + }); + + this.networkSettingsFormGroup.patchValue({ + proxy: data.networkSettings?.proxy, + dns: data.networkSettings?.dns, + netmask: data.networkSettings?.netmask, + router: data.networkSettings?.router, + ntp: data.networkSettings?.ntp, + netiface: data.networkSettings?.netiface, + p2pMode: data.networkSettings?.p2pMode, + p2pTime: data.networkSettings?.p2pTime, + mcastIp: data.networkSettings?.mcastIp, + mcastSpeed: data.networkSettings?.mcastSpeed, + mcastPort: data.networkSettings?.mcastPort, + mcastMode: data.networkSettings?.mcastMode, + menu: data.networkSettings?.menu ? data.networkSettings.menu['@id'] : null, + hardwareProfile: data.networkSettings?.hardwareProfile ? data.networkSettings.hardwareProfile['@id'] : null, + ogLive: data.networkSettings?.ogLive ? data.networkSettings.ogLive['@id'] : null, + repository: data.networkSettings?.repository ? data.networkSettings.repository['@id'] : null, + pxeTemplate: data.networkSettings?.pxeTemplate ? data.networkSettings.pxeTemplate['@id'] : null + }); + + this.classroomInfoFormGroup.patchValue({ + location: data.location, + projector: data.projector, + board: data.board, + capacity: data.capacity, + remoteCalendar: data.remoteCalendar ? data.remoteCalendar['@id'] : null + }); + + resolve(); + }, + + error => { + console.error('Error fetching data for edit:', error); + this.toastService.error('Error fetching data'); + reject(error); + this.onNoClick(); + } + ); + }); + } + + onSubmit() { + if (this.generalFormGroup.valid && this.additionalInfoFormGroup.valid && this.networkSettingsFormGroup.valid) { + const parentValue = this.generalFormGroup.value.parent; + const formData = { + name: this.generalFormGroup.value.name, + excludeParentChanges: this.generalFormGroup.value.excludeParentChanges, + parent: parentValue || null, + description: this.generalFormGroup.value.description, + comments: this.additionalInfoFormGroup.value.comments, + remoteCalendar: this.generalFormGroup.value.remoteCalendar, + type: this.generalFormGroup.value.type, + networkSettings: this.networkSettingsFormGroup.value, + location: this.classroomInfoFormGroup.value.location, + projector: this.classroomInfoFormGroup.value.projector, + board: this.classroomInfoFormGroup.value.board, + capacity: this.classroomInfoFormGroup.value.capacity, + }; + + if (this.isEditMode) { + const putUrl = `${this.baseUrl}/organizational-units/${this.data.uuid}`; + const headers = new HttpHeaders({ 'Content-Type': 'application/json' }); + + this.http.put(putUrl, formData, { headers }).subscribe( + response => { + this.unitAdded.emit(); + this.dialogRef.close({ success: true }); + this.toastService.success('Editado exitosamente', 'Éxito'); + }, + error => { + console.error('Error al realizar PUT:', error); + const errorMessages = error.error['hydra:description'].split('\n'); + errorMessages.forEach((message: string) => { + const cleanedMessage = message.replace(/networkSettings\.(\w+):/, 'Error $1:'); + this.toastService.error(cleanedMessage); + }); + } + ); + } else { + const postUrl = `${this.baseUrl}/organizational-units`; + const headers = new HttpHeaders({ 'Content-Type': 'application/json' }); + + this.http.post(postUrl, formData, { headers }).subscribe( + response => { + this.unitAdded.emit(response); + this.dialogRef.close({ success: true }); + this.toastService.success('Creado exitosamente', 'Éxito'); + }, + error => { + console.error('Error al realizar POST:', error); + const errorMessages = error.error['hydra:description'].split('\n'); + errorMessages.forEach((message: string) => { + const cleanedMessage = message.replace(/networkSettings\.(\w+):/, 'Error $1:'); + this.toastService.error(cleanedMessage); + }); + } + ); + } + } + } + getSelectedParentName(): string | undefined { const parentId = this.generalFormGroup.get('parent')?.value; return this.parentUnitsWithPaths.find(unit => unit.id === parentId)?.name; @@ -229,14 +353,14 @@ export class ManageOrganizationalUnitComponent implements OnInit { const url = `${this.baseUrl}/pxe-templates?page=1&itemsPerPage=10000`; this.http.get(url).subscribe( - response => { + response => { this.pxeTemplates = response['hydra:member']; resolve(); - }, - error => { + }, + error => { console.error('Error fetching pxe templates:', error); reject(error); - } + } ); }); } @@ -325,121 +449,6 @@ export class ManageOrganizationalUnitComponent implements OnInit { this.networkSettingsFormGroup.value.pxeTemplate = event.value; } - loadData(uuid: string): Promise { - return new Promise((resolve, reject) => { - const url = `${this.baseUrl}/organizational-units/${uuid}`; - - this.http.get(url).subscribe( - data => { - this.generalFormGroup.patchValue({ - name: data.name, - parent: data.parent ? data.parent['@id'] : '', - description: data.description, - type: data.type, - excludeParentChanges: data.excludeParentChanges - }); - this.additionalInfoFormGroup.patchValue({ - comments: data.comments - }); - this.networkSettingsFormGroup.patchValue({ - proxy: data.networkSettings?.proxy, - dns: data.networkSettings?.dns, - netmask: data.networkSettings?.netmask, - router: data.networkSettings?.router, - ntp: data.networkSettings?.ntp, - netiface: data.networkSettings?.netiface, - p2pMode: data.networkSettings?.p2pMode, - p2pTime: data.networkSettings?.p2pTime, - mcastIp: data.networkSettings?.mcastIp, - mcastSpeed: data.networkSettings?.mcastSpeed, - mcastPort: data.networkSettings?.mcastPort, - mcastMode: data.networkSettings?.mcastMode, - menu: data.networkSettings?.menu ? data.networkSettings.menu['@id'] : null, - hardwareProfile: data.networkSettings?.hardwareProfile ? data.networkSettings.hardwareProfile['@id'] : null, - ogLive: data.networkSettings?.ogLive ? data.networkSettings.ogLive['@id'] : null, - repository: data.networkSettings?.repository ? data.networkSettings.repository['@id'] : null, - pxeTemplate: data.networkSettings?.pxeTemplate ? data.networkSettings.pxeTemplate['@id'] : null - }); - this.classroomInfoFormGroup.patchValue({ - location: data.location, - projector: data.projector, - board: data.board, - capacity: data.capacity, - remoteCalendar: data.remoteCalendar ? data.remoteCalendar['@id'] : null - }); - resolve(); - }, - - error => { - console.error('Error fetching data for edit:', error); - this.toastService.error('Error fetching data'); - reject(error); - this.onNoClick(); - } - ); - }); - } - - onSubmit() { - if (this.generalFormGroup.valid && this.additionalInfoFormGroup.valid && this.networkSettingsFormGroup.valid) { - const parentValue = this.generalFormGroup.value.parent; - const formData = { - name: this.generalFormGroup.value.name, - excludeParentChanges: this.generalFormGroup.value.excludeParentChanges, - parent: parentValue || null, - description: this.generalFormGroup.value.description, - comments: this.additionalInfoFormGroup.value.comments, - remoteCalendar: this.generalFormGroup.value.remoteCalendar, - type: this.generalFormGroup.value.type, - networkSettings: this.networkSettingsFormGroup.value, - location: this.classroomInfoFormGroup.value.location, - projector: this.classroomInfoFormGroup.value.projector, - board: this.classroomInfoFormGroup.value.board, - capacity: this.classroomInfoFormGroup.value.capacity, - }; - - if (this.isEditMode) { - const putUrl = `${this.baseUrl}/organizational-units/${this.data.uuid}`; - const headers = new HttpHeaders({ 'Content-Type': 'application/json' }); - - this.http.put(putUrl, formData, { headers }).subscribe( - response => { - this.unitAdded.emit(); - this.dialogRef.close({ success: true }); - this.toastService.success('Editado exitosamente', 'Éxito'); - }, - error => { - console.error('Error al realizar PUT:', error); - const errorMessages = error.error['hydra:description'].split('\n'); - errorMessages.forEach((message: string) => { - const cleanedMessage = message.replace(/networkSettings\.(\w+):/, 'Error $1:'); - this.toastService.error(cleanedMessage); - }); - } - ); - } else { - const postUrl = `${this.baseUrl}/organizational-units`; - const headers = new HttpHeaders({ 'Content-Type': 'application/json' }); - - this.http.post(postUrl, formData, { headers }).subscribe( - response => { - this.unitAdded.emit(response); - this.dialogRef.close({ success: true }); - this.toastService.success('Creado exitosamente', 'Éxito'); - }, - error => { - console.error('Error al realizar POST:', error); - const errorMessages = error.error['hydra:description'].split('\n'); - errorMessages.forEach((message: string) => { - const cleanedMessage = message.replace(/networkSettings\.(\w+):/, 'Error $1:'); - this.toastService.error(cleanedMessage); - }); - } - ); - } - } - } - onNoClick(): void { this.dialogRef.close({ success: false }); } diff --git a/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.ts b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.ts index ae7c9d1..f53307d 100644 --- a/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.ts +++ b/ogWebconsole/src/app/components/ogboot/pxe/manage-pxeTemplate/create-pxe-template.component.ts @@ -129,8 +129,7 @@ export class CreatePxeTemplateComponent implements OnInit { this.dialogRef.close(true); }, error: error => { - this.toastService.error('Error al actualizar la plantilla PXE'); - this.dialogRef.close(false); + this.toastService.error(error.error['hydra:description']); } }); } diff --git a/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.html b/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.html index 2b89d16..57e84ba 100644 --- a/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.html +++ b/ogWebconsole/src/app/components/task-logs/client-task-logs/client-task-logs.component.html @@ -5,7 +5,7 @@
-

{{ 'adminCommandsTitle' | +

{{ 'adminCommandsTitle' | translate }}

@@ -17,7 +17,7 @@
-
+
{{ 'commandSelectStepText' | translate }} @@ -52,8 +52,8 @@
- +
- - + +
{{ column.header }} @@ -128,8 +128,8 @@ {{ 'columnActions' | translate }}{{ 'informationLabel' | translate }}
-

{{ 'adminCommandsTitle' | +

{{ 'adminCommandsTitle' | translate }}

@@ -16,9 +16,8 @@ -
- +
+
- +
- - + +
{{ column.header }} @@ -150,10 +149,11 @@ {{ 'columnActions' | translate }}{{ 'informationLabel' | translate }} -