mirror of https://github.com/apache/cloudstack.git
ui: confirm on reset configurations (#10745)
This commit is contained in:
parent
4a1d80ddc8
commit
431e4f9e1d
|
|
@ -2672,6 +2672,7 @@
|
||||||
"message.confirm.remove.vmware.datacenter": "Please confirm you want to remove VMware datacenter.",
|
"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.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.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.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.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?",
|
"message.confirm.scale.up.system.vm": "Do you really want to scale up the system VM?",
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@
|
||||||
iconTwoToneColor="#52c41a" />
|
iconTwoToneColor="#52c41a" />
|
||||||
<tooltip-button
|
<tooltip-button
|
||||||
:tooltip="$t('label.reset.config.value')"
|
:tooltip="$t('label.reset.config.value')"
|
||||||
@onClick="resetConfig(record)"
|
@onClick="$resetConfigurationValueConfirm(item, resetConfig)"
|
||||||
v-if="editableValueKey !== record.key"
|
v-if="editableValueKey !== record.key"
|
||||||
icon="reload-outlined"
|
icon="reload-outlined"
|
||||||
:disabled="!('updateConfiguration' in $store.getters.apis)" />
|
:disabled="!('updateConfiguration' in $store.getters.apis)" />
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
iconTwoToneColor="#52c41a" />
|
iconTwoToneColor="#52c41a" />
|
||||||
<tooltip-button
|
<tooltip-button
|
||||||
:tooltip="$t('label.reset.config.value')"
|
:tooltip="$t('label.reset.config.value')"
|
||||||
@onClick="resetConfig(item)"
|
@onClick="$resetConfigurationValueConfirm(item, resetConfig)"
|
||||||
v-if="editableValueKey !== index"
|
v-if="editableValueKey !== index"
|
||||||
icon="reload-outlined"
|
icon="reload-outlined"
|
||||||
:disabled="!('updateConfiguration' in $store.getters.apis)" />
|
:disabled="!('updateConfiguration' in $store.getters.apis)" />
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ import {
|
||||||
resourceTypePlugin,
|
resourceTypePlugin,
|
||||||
fileSizeUtilPlugin,
|
fileSizeUtilPlugin,
|
||||||
genericUtilPlugin,
|
genericUtilPlugin,
|
||||||
localesPlugin
|
localesPlugin,
|
||||||
|
dialogUtilPlugin
|
||||||
} from './utils/plugins'
|
} from './utils/plugins'
|
||||||
import { VueAxios } from './utils/request'
|
import { VueAxios } from './utils/request'
|
||||||
import directives from './utils/directives'
|
import directives from './utils/directives'
|
||||||
|
|
@ -51,6 +52,7 @@ vueApp.use(resourceTypePlugin)
|
||||||
vueApp.use(fileSizeUtilPlugin)
|
vueApp.use(fileSizeUtilPlugin)
|
||||||
vueApp.use(localesPlugin)
|
vueApp.use(localesPlugin)
|
||||||
vueApp.use(genericUtilPlugin)
|
vueApp.use(genericUtilPlugin)
|
||||||
|
vueApp.use(dialogUtilPlugin)
|
||||||
vueApp.use(extensions)
|
vueApp.use(extensions)
|
||||||
vueApp.use(directives)
|
vueApp.use(directives)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { i18n } from '@/locales'
|
import { i18n } from '@/locales'
|
||||||
import { api } from '@/api'
|
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 eventBus from '@/config/eventBus'
|
||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { sourceToken } from '@/utils/request'
|
import { sourceToken } from '@/utils/request'
|
||||||
|
|
@ -527,3 +527,18 @@ export function createPathBasedOnVmType (vmtype, virtualmachineid) {
|
||||||
|
|
||||||
return path + 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)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
:disabled="valueLoading" />
|
:disabled="valueLoading" />
|
||||||
<tooltip-button
|
<tooltip-button
|
||||||
:tooltip="$t('label.reset.config.value')"
|
:tooltip="$t('label.reset.config.value')"
|
||||||
@onClick="resetConfigurationValue(configrecord)"
|
@onClick="$resetConfigurationValueConfirm(configrecord, resetConfigurationValue)"
|
||||||
v-if="editableValueKey === null"
|
v-if="editableValueKey === null"
|
||||||
icon="reload-outlined"
|
icon="reload-outlined"
|
||||||
:disabled="(!('resetConfiguration' in $store.getters.apis) || configDisabled || valueLoading)" />
|
:disabled="(!('resetConfiguration' in $store.getters.apis) || configDisabled || valueLoading)" />
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,8 @@ import {
|
||||||
showIconPlugin,
|
showIconPlugin,
|
||||||
resourceTypePlugin,
|
resourceTypePlugin,
|
||||||
fileSizeUtilPlugin,
|
fileSizeUtilPlugin,
|
||||||
genericUtilPlugin
|
genericUtilPlugin,
|
||||||
|
dialogUtilPlugin
|
||||||
} from '@/utils/plugins'
|
} from '@/utils/plugins'
|
||||||
|
|
||||||
function createMockRouter (newRoutes = []) {
|
function createMockRouter (newRoutes = []) {
|
||||||
|
|
@ -88,6 +89,7 @@ function createFactory (component, options) {
|
||||||
resourceTypePlugin,
|
resourceTypePlugin,
|
||||||
fileSizeUtilPlugin,
|
fileSizeUtilPlugin,
|
||||||
genericUtilPlugin,
|
genericUtilPlugin,
|
||||||
|
dialogUtilPlugin,
|
||||||
StoragePlugin
|
StoragePlugin
|
||||||
],
|
],
|
||||||
mocks
|
mocks
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue