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({