mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 12:42:54 +00:00
config_tools: show confirm message when user deselecting checkbox in cat widget
show confirm message when user deselecting checkbox in cat widget Tracked-On: #6691 Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
This commit is contained in:
parent
21240fd84e
commit
8ac076a540
@ -135,6 +135,8 @@ function count(source, target) {
|
|||||||
return (source.match(new RegExp(target, 'g')) || []).length;
|
return (source.match(new RegExp(target, 'g')) || []).length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
|
||||||
|
|
||||||
// noinspection JSUnresolvedVariable
|
// noinspection JSUnresolvedVariable
|
||||||
export default {
|
export default {
|
||||||
@ -209,13 +211,21 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkboxController(name, event) {
|
checkboxController(name, event) {
|
||||||
|
// prevent default event
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
let oldValue = this.formDataProxy(name);
|
let oldValue = this.formDataProxy(name);
|
||||||
let newValue = oldValue === 'y' ? 'n' : 'y';
|
let newValue = oldValue === 'y' ? 'n' : 'y';
|
||||||
let message = newValue === 'y' ? "Selecting Cache Allocation Technology, Code and Data Prioritization, " +
|
if (newValue === 'y') {
|
||||||
"or Virtual Cache Allocation Technology will remove any prior configurations. " +
|
wait(50).then(() => {
|
||||||
"To see your current configuration, go to the Hypervisor’s Advanced tab, " +
|
this.formDataProxy(name, newValue, true);
|
||||||
"Memory Isolation for Performance section.\n\n" +
|
})
|
||||||
"Are you sure you want to continue?" : "Deselecting Cache Allocation Technology, " +
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// newValue === 'n'
|
||||||
|
// show confirm dialog to confirm disable CAT feature
|
||||||
|
let message = "Deselecting Cache Allocation Technology, " +
|
||||||
"Code and Data Prioritization, or Virtual Cache Allocation Technology will remove any prior configurations. " +
|
"Code and Data Prioritization, or Virtual Cache Allocation Technology will remove any prior configurations. " +
|
||||||
"To see your current configuration, go to the Hypervisor’s Advanced tab, " +
|
"To see your current configuration, go to the Hypervisor’s Advanced tab, " +
|
||||||
"Memory Isolation for Performance section.\n\n" +
|
"Memory Isolation for Performance section.\n\n" +
|
||||||
@ -225,8 +235,6 @@ export default {
|
|||||||
.then((confirmed) => {
|
.then((confirmed) => {
|
||||||
this.formDataProxy(name, confirmed ? newValue : oldValue, true)
|
this.formDataProxy(name, confirmed ? newValue : oldValue, true)
|
||||||
})
|
})
|
||||||
event.preventDefault()
|
|
||||||
event.stopPropagation()
|
|
||||||
},
|
},
|
||||||
formDataProxy(name, data = null, update = false) {
|
formDataProxy(name, data = null, update = false) {
|
||||||
let path = {
|
let path = {
|
||||||
@ -241,7 +249,7 @@ export default {
|
|||||||
if (oldValue === undefined) {
|
if (oldValue === undefined) {
|
||||||
let t = path.split('.');
|
let t = path.split('.');
|
||||||
let parentPath = t.splice(0, t.length - 1).join('.');
|
let parentPath = t.splice(0, t.length - 1).join('.');
|
||||||
if(!vueUtils.getPathVal(this.rootFormData, parentPath)) {
|
if (!vueUtils.getPathVal(this.rootFormData, parentPath)) {
|
||||||
vueUtils.setPathVal(this.rootFormData, parentPath, {});
|
vueUtils.setPathVal(this.rootFormData, parentPath, {});
|
||||||
}
|
}
|
||||||
// set to checkbox default value
|
// set to checkbox default value
|
||||||
|
Loading…
Reference in New Issue
Block a user