diff --git a/plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java b/plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java index c04538271a1..18d924bcd52 100644 --- a/plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java +++ b/plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java @@ -776,7 +776,8 @@ public class StorPoolPrimaryDataStoreDriver implements PrimaryDataStoreDriver { if (answer != null && answer.getResult()) { // successfully downloaded template to primary storage - answer = createVolumeSnapshot(cmd, size, conn, volName, dstTO); + TemplateObjectTO templ = (TemplateObjectTO) ((CopyCmdAnswer) answer).getNewData(); + answer = createVolumeSnapshot(cmd, size, conn, volName, templ); } else { err = answer != null ? answer.getDetails() : "Unknown error while downloading template. Null answer returned."; } @@ -983,7 +984,6 @@ public class StorPoolPrimaryDataStoreDriver implements PrimaryDataStoreDriver { } else { dstTO.setPath(StorPoolUtil.devPath( StorPoolUtil.getSnapshotNameFromResponse(resp, false, StorPoolUtil.GLOBAL_ID))); - dstTO.setSize(size); answer = new CopyCmdAnswer(dstTO); } return answer; diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 7bd555b36c3..7d2f0327dfb 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -2930,6 +2930,7 @@ "message.confirm.remove.vmware.datacenter": "Please confirm you want to remove VMware datacenter.", "message.confirm.remove.vpc.offering": "Are you sure you want to remove this VPC offering?", "message.confirm.replace.acl.new.one": "Do you want to replace the ACL with a new one?", +"message.confirm.reset.configuration.value": "Are you sure you want reset configuration - %x?", "message.confirm.reset.network.permissions": "Are you sure you want to reset this Network permissions?", "message.confirm.scale.up.router.vm": "Do you really want to scale up the router Instance?", "message.confirm.scale.up.system.vm": "Do you really want to scale up the system VM?", diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue index 30b0d4bf671..e1f166a1215 100644 --- a/ui/src/components/view/ListView.vue +++ b/ui/src/components/view/ListView.vue @@ -543,7 +543,7 @@ iconTwoToneColor="#52c41a" /> diff --git a/ui/src/main.js b/ui/src/main.js index e22cca334e5..1add433265b 100644 --- a/ui/src/main.js +++ b/ui/src/main.js @@ -35,7 +35,8 @@ import { resourceTypePlugin, fileSizeUtilPlugin, genericUtilPlugin, - localesPlugin + localesPlugin, + dialogUtilPlugin } from './utils/plugins' import { VueAxios } from './utils/request' import directives from './utils/directives' @@ -51,6 +52,7 @@ vueApp.use(resourceTypePlugin) vueApp.use(fileSizeUtilPlugin) vueApp.use(localesPlugin) vueApp.use(genericUtilPlugin) +vueApp.use(dialogUtilPlugin) vueApp.use(extensions) vueApp.use(directives) diff --git a/ui/src/utils/plugins.js b/ui/src/utils/plugins.js index 353fe2ac052..624702a41b8 100644 --- a/ui/src/utils/plugins.js +++ b/ui/src/utils/plugins.js @@ -18,7 +18,7 @@ import _ from 'lodash' import { i18n } from '@/locales' import { api } from '@/api' -import { message, notification } from 'ant-design-vue' +import { message, notification, Modal } from 'ant-design-vue' import eventBus from '@/config/eventBus' import store from '@/store' import { sourceToken } from '@/utils/request' @@ -523,3 +523,18 @@ export function createPathBasedOnVmType (vmtype, virtualmachineid) { return path + virtualmachineid } + +export const dialogUtilPlugin = { + install (app) { + app.config.globalProperties.$resetConfigurationValueConfirm = function (configRecord, callback) { + Modal.confirm({ + title: i18n.global.t('label.reset.config.value'), + content: `${i18n.global.t('message.confirm.reset.configuration.value').replace('%x', configRecord.name)}`, + okText: i18n.global.t('label.yes'), + cancelText: i18n.global.t('label.no'), + okType: 'primary', + onOk: () => callback(configRecord) + }) + } + } +} diff --git a/ui/src/views/setting/ConfigurationValue.vue b/ui/src/views/setting/ConfigurationValue.vue index 3ed0807520a..b4a44fdcd20 100644 --- a/ui/src/views/setting/ConfigurationValue.vue +++ b/ui/src/views/setting/ConfigurationValue.vue @@ -184,7 +184,7 @@ :disabled="valueLoading" /> diff --git a/ui/tests/common/index.js b/ui/tests/common/index.js index a517fc2d08d..d03c31a706f 100644 --- a/ui/tests/common/index.js +++ b/ui/tests/common/index.js @@ -31,7 +31,8 @@ import { showIconPlugin, resourceTypePlugin, fileSizeUtilPlugin, - genericUtilPlugin + genericUtilPlugin, + dialogUtilPlugin } from '@/utils/plugins' function createMockRouter (newRoutes = []) { @@ -88,6 +89,7 @@ function createFactory (component, options) { resourceTypePlugin, fileSizeUtilPlugin, genericUtilPlugin, + dialogUtilPlugin, StoragePlugin ], mocks