diff --git a/CHANGELOG.md b/CHANGELOG.md index 71f6c1f..b18f13f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ # Changelog +## [0.22.2] - 2025-09-05 +### Improved +- Se ha mejorado la UX en el asistente de ejecurcion de scripts. + +### Fixed +- Se ha corregido en el particionador, el que el tamaño de las particiones EFI no esten fijas a 512 cuando ya haya datos almacenados. +- Se ha corregido un bug que hacia que no pasara los clientes seleccionados en el asistente de script, y en las tareas programadas. + +--- ## [0.22.1] - 2025-09-05 ### Improved - Se ha mejorado la experiencia de usuario con el despleable de "tipos de particion" en el asistente de particonado. diff --git a/Jenkins/Jenkinsfile-deb-pkg b/Jenkins/Jenkinsfile-deb-pkg index 394bc73..ad33e30 100644 --- a/Jenkins/Jenkinsfile-deb-pkg +++ b/Jenkins/Jenkinsfile-deb-pkg @@ -99,8 +99,21 @@ pipeline { } } post { + success { + script { + // Solo lanzar cuando el build sea exitoso y en la rama main + if (env.BRANCH_NAME == 'main') { + build job: 'Aptly publish nightly repository', + wait: false, + parameters: [ + string(name: 'TRIGGERED_BY', value: "${env.JOB_NAME}-${env.BUILD_NUMBER}") + ] + } + } + + } always { - notifyBuildStatus('narenas@qindel.com') + notifyBuildStatus('opengnsys@qindel.com') } } } diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts index a349f28..2f5db22 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts @@ -445,23 +445,50 @@ export class DeployImageComponent implements OnInit{ dialogRef.afterClosed().subscribe((result: { [x: string]: any; }) => { if (result !== undefined) { - const payload = { + const basePayload: any = { method: this.selectedMethod, diskNumber: this.selectedPartition.diskNumber, partitionNumber: this.selectedPartition.partitionNumber, - p2pMode: this.selectedMethod === 'p2p' ? this.p2pMode : null, - p2pTime: this.selectedMethod === 'p2p' && this.p2pMode === 'seeder' ? this.p2pTime : null, - mcastIp: this.selectedMethod === 'udpcast' ? this.mcastIp : null, - mcastPort: this.selectedMethod === 'udpcast' ? this.mcastPort : null, - mcastMode: this.selectedMethod === 'udpcast' ? this.mcastMode : null, - mcastSpeed: this.selectedMethod === 'udpcast' ? this.mcastSpeed : null, - maxTime: this.selectedMethod === 'udpcast' ? this.mcastMaxTime : null, - maxClients: this.selectedMethod === 'udpcast' ? this.mcastMaxClients : null, + imageName: this.selectedImage.name, + imageUuid: this.selectedImage.uuid, + type: this.imageType }; + if (this.selectedMethod === 'p2p' && this.p2pMode) { + basePayload['p2pMode'] = this.p2pMode; + } + + if (this.selectedMethod === 'p2p' && this.p2pMode === 'seeder' && this.p2pTime) { + basePayload['p2pTime'] = this.p2pTime; + } + + if (this.selectedMethod === 'udpcast' || this.selectedMethod === 'udpcast-direct' && this.mcastIp) { + basePayload['mcastIp'] = this.mcastIp; + } + + if (this.selectedMethod === 'udpcast' || this.selectedMethod === 'udpcast-direct' && this.mcastPort) { + basePayload['mcastPort'] = this.mcastPort; + } + + if (this.selectedMethod === 'udpcast' || this.selectedMethod === 'udpcast-direct' && this.mcastMode) { + basePayload['mcastMode'] = this.mcastMode; + } + + if (this.selectedMethod === 'udpcast' || this.selectedMethod === 'udpcast-direct' && this.mcastSpeed) { + basePayload['mcastSpeed'] = this.mcastSpeed; + } + + if (this.selectedMethod === 'udpcast' || this.selectedMethod === 'udpcast-direct' && this.mcastMaxTime) { + basePayload['maxTime'] = this.mcastMaxTime; + } + + if (this.selectedMethod === 'udpcast' || this.selectedMethod === 'udpcast-direct' && this.mcastMaxClients) { + basePayload['maxClients'] = this.mcastMaxClients; + } + this.http.post(`${this.baseUrl}/command-task-scripts`, { commandTask: result['taskId'] ? result['taskId']['@id'] : result['@id'], - parameters: payload, + parameters: basePayload, order: result['executionOrder'] || 1, type: 'deploy-image', }).subscribe({ 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 729da20..cf4a8dd 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 @@ -246,14 +246,18 @@ export class PartitionAssistantComponent implements OnInit, AfterViewInit, OnDes if (partition.partitionNumber === 0) { disk!.totalDiskSize = this.convertBytesToGB(partition.size); } else { + const isFirstPartitionGPT = partition.partitionNumber === 1 && this.partitionCode === 'GPT'; + const hasValidExistingData = partition.size > 0 && partition.partitionCode && partition.filesystem; + const shouldUseEFIDefaults = isFirstPartitionGPT && !hasValidExistingData; + disk!.partitions.push({ uuid: partition.uuid, partitionNumber: partition.partitionNumber, - size: this.convertBytesToGB(partition.partitionNumber === 1 && this.partitionCode === 'GPT' ? 512 : partition.size), + size: this.convertBytesToGB(shouldUseEFIDefaults ? 512 : partition.size), memoryUsage: partition.memoryUsage, - partitionCode: partition.partitionNumber === 1 && this.partitionCode === 'GPT' ? 'EFI' : this.validatePartitionCode(partition.partitionCode), - filesystem: partition.partitionNumber === 1 && this.partitionCode === 'GPT' ? 'FAT32' : partition.filesystem, - sizeBytes: partition.partitionNumber === 1 && this.partitionCode === 'GPT' ? 512 : partition.size, + partitionCode: shouldUseEFIDefaults ? 'EFI' : this.validatePartitionCode(partition.partitionCode), + filesystem: shouldUseEFIDefaults ? 'FAT32' : partition.filesystem, + sizeBytes: shouldUseEFIDefaults ? 512 : partition.size, format: false, color: this.getColorForPartition(partition.partitionNumber), percentage: 0, diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css index 615b9b9..9227a68 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css @@ -533,4 +533,274 @@ mat-spinner { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +} + +.script-input-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + padding: 16px; + background: #f8f9fa; + border-radius: 8px; + border: 1px solid #e9ecef; +} + +.script-input-header h4 { + margin: 0; + display: flex; + align-items: center; + gap: 8px; + color: #2c3e50; + font-weight: 600; +} + +.script-stats { + display: flex; + gap: 16px; + align-items: center; +} + +.stat-item { + display: flex; + align-items: center; + gap: 4px; + font-size: 12px; + color: #6c757d; + background: white; + padding: 4px 8px; + border-radius: 4px; + border: 1px solid #e9ecef; +} + +.stat-item.valid { + color: #28a745; + border-color: #28a745; + background: #f8fff9; +} + +.stat-item.invalid { + color: #dc3545; + border-color: #dc3545; + background: #fff8f8; +} + +.stat-item mat-icon { + font-size: 14px; + width: 14px; + height: 14px; +} + +.script-textarea { + font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; + font-size: 14px; + line-height: 1.5; + background: #f8f9fa; +} + +.detected-params { + background: #fff3cd; + border: 1px solid #ffeaa7; + border-radius: 8px; + padding: 16px; + margin: 16px 0; +} + +.detected-params h4 { + margin: 0 0 12px 0; + display: flex; + align-items: center; + gap: 8px; + color: #856404; + font-weight: 600; +} + +.params-grid .mat-mdc-chip-listbox { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.param-chip { + background: #fff !important; + border: 1px solid #ffeaa7 !important; + color: #856404 !important; +} + +.action-buttons { + display: flex; + justify-content: flex-end; + gap: 12px; + margin-top: 16px; +} + +.action-buttons button { + display: flex; + align-items: center; + gap: 8px; +} + +.script-selector-container { + margin-bottom: 20px; +} + +.script-option { + display: flex; + flex-direction: column; + gap: 2px; +} + +.script-name { + font-weight: 500; + color: #2c3e50; +} + +.script-description { + font-size: 12px; + color: #6c757d; + opacity: 0.8; +} + +/* Tarjetas de vista previa */ +.script-preview-container { + margin-top: 20px; +} + +.script-card, .params-card { + margin-bottom: 16px; + border: 1px solid #e3f2fd !important; + border-radius: 12px !important; +} + +.script-card .mat-mdc-card-header, +.params-card .mat-mdc-card-header { + background: #f8f9fa; + border-radius: 12px 12px 0 0; +} + +.script-card .mat-mdc-card-title, +.params-card .mat-mdc-card-title { + display: flex; + align-items: center; + gap: 8px; + color: #2c3e50; + font-weight: 600; +} + +.script-card .mat-mdc-card-subtitle, +.params-card .mat-mdc-card-subtitle { + color: #6c757d; + margin-top: 4px; +} + +.script-content-wrapper { + background: #f8f9fa; + border-radius: 8px; + border: 1px solid #e9ecef; + max-height: 300px; + overflow-y: auto; +} + +.script-preview { + background-color: #ffffff; + border: 1px solid #e9ecef; + padding: 16px; + border-radius: 8px; + font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; + font-size: 13px; + line-height: 1.6; + white-space: pre-wrap; + min-height: 60px; + max-height: 280px; + overflow-y: auto; +} + +.script-params-section { + margin-top: 16px; +} + +.params-count { + background: #667eea !important; + color: white !important; + font-size: 11px; + height: 20px; + min-height: 20px; + padding: 0 8px; +} + +.params-form { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); + gap: 16px; +} + +.param-field { + position: relative; +} + +/* Estados vacíos */ +.empty-state { + display: flex; + justify-content: center; + align-items: center; + min-height: 200px; + background: #f8f9fa; + border: 2px dashed #e9ecef; + border-radius: 12px; + margin: 20px 0; +} + +.empty-state-content { + text-align: center; + color: #6c757d; +} + +.empty-state-content mat-icon { + font-size: 48px; + width: 48px; + height: 48px; + color: #dee2e6; + margin-bottom: 16px; +} + +.empty-state-content h3 { + margin: 0 0 8px 0; + color: #495057; + font-weight: 500; +} + +.empty-state-content p { + margin: 0; + font-size: 14px; + max-width: 300px; +} + +/* Mejoras en chips de acción */ +::ng-deep .action-chip mat-icon { + font-size: 18px !important; + width: 18px !important; + height: 18px !important; + margin-right: 4px !important; +} + +/* Responsive design */ +@media (max-width: 768px) { + .script-input-header { + flex-direction: column; + align-items: flex-start; + gap: 12px; + } + + .script-stats { + flex-wrap: wrap; + gap: 8px; + } + + .params-form { + grid-template-columns: 1fr; + } + + .action-buttons { + justify-content: center; + } } \ No newline at end of file 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 c9bef47..7e772c9 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 @@ -86,50 +86,168 @@
Elige un script guardado de la lista para ver su contenido y configurar parámetros.
+Crea un nuevo script escribiendo comandos de shell/bash en el editor de texto.
+