mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
(cherry picked from commit cb452b962794b38105626b3d55ce6bcdf6e01ee6) Co-authored-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
965c7d9b72
commit
580b2892cb
@ -212,28 +212,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.deleteExistImage) {
|
|
||||||
// if not select image, show error
|
|
||||||
if (!this.deleteImageId) {
|
|
||||||
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.deleteImage'));
|
|
||||||
buttonCb(false);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if select image, delete image
|
|
||||||
const image = this.$store.getters['harvester/byId'](HCI.IMAGE, this.deleteImageId);
|
|
||||||
|
|
||||||
if (image) {
|
|
||||||
this.handleImageDelete(image);
|
|
||||||
buttonCb(true);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.imageSource === IMAGE_METHOD.NEW) {
|
if (this.imageSource === IMAGE_METHOD.NEW) {
|
||||||
this.imageValue.metadata.annotations[HCI_ANNOTATIONS.OS_UPGRADE_IMAGE] = 'True';
|
this.imageValue.metadata.annotations[HCI_ANNOTATIONS.OS_UPGRADE_IMAGE] = 'True';
|
||||||
|
|
||||||
@ -241,6 +219,7 @@ export default {
|
|||||||
this.value.spec.image = this.uploadImageId;
|
this.value.spec.image = this.uploadImageId;
|
||||||
} else if (this.sourceType === DOWNLOAD) {
|
} else if (this.sourceType === DOWNLOAD) {
|
||||||
this.imageValue.spec.sourceType = DOWNLOAD;
|
this.imageValue.spec.sourceType = DOWNLOAD;
|
||||||
|
|
||||||
if (!this.imageValue.spec.url) {
|
if (!this.imageValue.spec.url) {
|
||||||
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.imageUrl'));
|
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.imageUrl'));
|
||||||
buttonCb(false);
|
buttonCb(false);
|
||||||
@ -254,6 +233,7 @@ export default {
|
|||||||
} else if (this.imageSource === IMAGE_METHOD.EXIST) {
|
} else if (this.imageSource === IMAGE_METHOD.EXIST) {
|
||||||
if (!this.imageId) {
|
if (!this.imageId) {
|
||||||
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.chooseFile'));
|
this.errors.push(this.$store.getters['i18n/t']('harvester.setting.upgrade.chooseFile'));
|
||||||
|
buttonCb(false);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user