Skip to content

Commit 576b97b

Browse files
committed
Merge branch '4.20' of https://github.com/apache/cloudstack
2 parents ffc0d51 + 992c4b3 commit 576b97b

File tree

7 files changed

+27
-7
lines changed

7 files changed

+27
-7
lines changed

plugins/storage/volume/storpool/src/main/java/org/apache/cloudstack/storage/datastore/driver/StorPoolPrimaryDataStoreDriver.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,8 @@ public void copyAsync(DataObject srcData, DataObject dstData, AsyncCompletionCal
776776

777777
if (answer != null && answer.getResult()) {
778778
// successfully downloaded template to primary storage
779-
answer = createVolumeSnapshot(cmd, size, conn, volName, dstTO);
779+
TemplateObjectTO templ = (TemplateObjectTO) ((CopyCmdAnswer) answer).getNewData();
780+
answer = createVolumeSnapshot(cmd, size, conn, volName, templ);
780781
} else {
781782
err = answer != null ? answer.getDetails() : "Unknown error while downloading template. Null answer returned.";
782783
}
@@ -983,7 +984,6 @@ private Answer createVolumeSnapshot(StorageSubSystemCommand cmd, Long size, SpCo
983984
} else {
984985
dstTO.setPath(StorPoolUtil.devPath(
985986
StorPoolUtil.getSnapshotNameFromResponse(resp, false, StorPoolUtil.GLOBAL_ID)));
986-
dstTO.setSize(size);
987987
answer = new CopyCmdAnswer(dstTO);
988988
}
989989
return answer;

ui/public/locales/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -2930,6 +2930,7 @@
29302930
"message.confirm.remove.vmware.datacenter": "Please confirm you want to remove VMware datacenter.",
29312931
"message.confirm.remove.vpc.offering": "Are you sure you want to remove this VPC offering?",
29322932
"message.confirm.replace.acl.new.one": "Do you want to replace the ACL with a new one?",
2933+
"message.confirm.reset.configuration.value": "Are you sure you want reset configuration - %x?",
29332934
"message.confirm.reset.network.permissions": "Are you sure you want to reset this Network permissions?",
29342935
"message.confirm.scale.up.router.vm": "Do you really want to scale up the router Instance?",
29352936
"message.confirm.scale.up.system.vm": "Do you really want to scale up the system VM?",

ui/src/components/view/ListView.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@
543543
iconTwoToneColor="#52c41a" />
544544
<tooltip-button
545545
:tooltip="$t('label.reset.config.value')"
546-
@onClick="resetConfig(record)"
546+
@onClick="$resetConfigurationValueConfirm(item, resetConfig)"
547547
v-if="editableValueKey !== record.key"
548548
icon="reload-outlined"
549549
:disabled="!('updateConfiguration' in $store.getters.apis)" />

ui/src/main.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import {
3535
resourceTypePlugin,
3636
fileSizeUtilPlugin,
3737
genericUtilPlugin,
38-
localesPlugin
38+
localesPlugin,
39+
dialogUtilPlugin
3940
} from './utils/plugins'
4041
import { VueAxios } from './utils/request'
4142
import directives from './utils/directives'
@@ -51,6 +52,7 @@ vueApp.use(resourceTypePlugin)
5152
vueApp.use(fileSizeUtilPlugin)
5253
vueApp.use(localesPlugin)
5354
vueApp.use(genericUtilPlugin)
55+
vueApp.use(dialogUtilPlugin)
5456
vueApp.use(extensions)
5557
vueApp.use(directives)
5658

ui/src/utils/plugins.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import _ from 'lodash'
1919
import { i18n } from '@/locales'
2020
import { api } from '@/api'
21-
import { message, notification } from 'ant-design-vue'
21+
import { message, notification, Modal } from 'ant-design-vue'
2222
import eventBus from '@/config/eventBus'
2323
import store from '@/store'
2424
import { sourceToken } from '@/utils/request'
@@ -523,3 +523,18 @@ export function createPathBasedOnVmType (vmtype, virtualmachineid) {
523523

524524
return path + virtualmachineid
525525
}
526+
527+
export const dialogUtilPlugin = {
528+
install (app) {
529+
app.config.globalProperties.$resetConfigurationValueConfirm = function (configRecord, callback) {
530+
Modal.confirm({
531+
title: i18n.global.t('label.reset.config.value'),
532+
content: `${i18n.global.t('message.confirm.reset.configuration.value').replace('%x', configRecord.name)}`,
533+
okText: i18n.global.t('label.yes'),
534+
cancelText: i18n.global.t('label.no'),
535+
okType: 'primary',
536+
onOk: () => callback(configRecord)
537+
})
538+
}
539+
}
540+
}

ui/src/views/setting/ConfigurationValue.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
:disabled="valueLoading" />
185185
<tooltip-button
186186
:tooltip="$t('label.reset.config.value')"
187-
@onClick="resetConfigurationValue(configrecord)"
187+
@onClick="$resetConfigurationValueConfirm(configrecord, resetConfigurationValue)"
188188
v-if="editableValueKey === null"
189189
icon="reload-outlined"
190190
:disabled="(!('resetConfiguration' in $store.getters.apis) || configDisabled || valueLoading)" />

ui/tests/common/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import {
3131
showIconPlugin,
3232
resourceTypePlugin,
3333
fileSizeUtilPlugin,
34-
genericUtilPlugin
34+
genericUtilPlugin,
35+
dialogUtilPlugin
3536
} from '@/utils/plugins'
3637

3738
function createMockRouter (newRoutes = []) {
@@ -88,6 +89,7 @@ function createFactory (component, options) {
8889
resourceTypePlugin,
8990
fileSizeUtilPlugin,
9091
genericUtilPlugin,
92+
dialogUtilPlugin,
9193
StoragePlugin
9294
],
9395
mocks

0 commit comments

Comments
 (0)