Use correct image upload endpoint
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Build / Node ${{ matrix.node }} (14) (push) Has been cancelled
Build / Node ${{ matrix.node }} (16) (push) Has been cancelled
Build / Node ${{ matrix.node }} (18) (push) Has been cancelled

This commit is contained in:
grossmj 2024-12-31 18:57:36 +07:00
parent 7b633c29dd
commit e959a947cc
No known key found for this signature in database
GPG Key ID: 1E7DD6DBB53FF3D7
5 changed files with 7 additions and 15 deletions

View File

@ -142,7 +142,7 @@ export class ImportApplianceComponent implements OnInit {
}
this.template = template;
const url = this.getUploadPath(this.controller, template.template_type, name);
const url = this.getUploadPath(this.controller, name);
this.uploader.queue.forEach((elem) => (elem.url = url));
const itemToUpload = this.uploader.queue[0];
this.uploader.uploadItem(itemToUpload);
@ -150,7 +150,7 @@ export class ImportApplianceComponent implements OnInit {
fileReader.readAsText(file);
}
private getUploadPath(controller:Controller , emulator: string, filename: string) {
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/${emulator}/images/${filename}`;
private getUploadPath(controller:Controller , filename: string) {
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}`;
}
}

View File

@ -266,7 +266,7 @@ export class NewTemplateDialogComponent implements OnInit {
if (appliance.iou) emulator = 'iou';
if (appliance.qemu) emulator = 'qemu';
const url = this.applianceService.getUploadPath(this.controller, emulator, fileName);
const url = this.applianceService.getUploadPath(this.controller, fileName);
this.uploader.queue.forEach((elem) => (elem.url = url));
const itemToUpload = this.uploader.queue[0];
@ -381,7 +381,7 @@ export class NewTemplateDialogComponent implements OnInit {
if (this.applianceToInstall.dynamips) emulator = 'dynamips';
if (this.applianceToInstall.iou) emulator = 'iou';
const url = this.applianceService.getUploadPath(this.controller, emulator, imageName);
const url = this.applianceService.getUploadPath(this.controller, imageName);
this.uploaderImage.queue.forEach((elem) => (elem.url = url));
const itemToUpload = this.uploaderImage.queue[0];

View File

@ -17,8 +17,8 @@ export class ApplianceService {
return this.httpController.get<Appliance>(controller, url) as Observable<Appliance>;
}
getUploadPath(controller:Controller , emulator: string, filename: string) {
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}?allow_raw_image=true`;
getUploadPath(controller:Controller, filename: string) {
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}`;
}
updateAppliances(controller:Controller ): Observable<Appliance[]> {

View File

@ -14,10 +14,6 @@ export class ComputeService {
return this.httpController.get<Compute[]>(controller, '/computes') as Observable<Compute[]>;
}
getUploadPath(controller:Controller , emulator: string, filename: string) {
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/${emulator}/images/${filename}`;
}
getStatistics(controller:Controller ): Observable<ComputeStatistics[]> {
return this.httpController.get(controller, `/statistics`);
}

View File

@ -20,10 +20,6 @@ export class ImageManagerService {
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${image_path}?install_appliances=${install_appliance}`;
}
getUploadPath(controller:Controller , emulator: string, filename: string) {
return `${controller.protocol}//${controller.host}:${controller.port}/${environment.current_version}/images/upload/${filename}`;
}
uploadedImage(controller :Controller, install_appliance, image_path, flie){
return this.httpController.post<Image[]>(controller, `/images/upload/${image_path}?install_appliances=${install_appliance}`,flie) as Observable<Image[]>;
}