mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-23 22:18:17 +00:00
config_tools: disallowed user set CAT CLOS_MASK to 0
disallowed user set CAT CLOS_MASK to 0 Tracked-On: #6691 Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
This commit is contained in:
parent
d7c7808fc2
commit
f5d3d71526
@ -11,6 +11,16 @@ 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));
|
||||||
|
|
||||||
|
let getHexValue = (value, max) => {
|
||||||
|
let newHexValue = '0'.repeat(value[0]) + '1'.repeat(value[1] - value[0]) + '0'.repeat(max - value[1])
|
||||||
|
newHexValue = (parseInt(newHexValue, 2).toString(16))
|
||||||
|
let zeroPadding = '0'.repeat(Number.parseInt('1'.repeat(max), 2).toString(16).length - newHexValue.length)
|
||||||
|
newHexValue = '0x' + zeroPadding + newHexValue;
|
||||||
|
return newHexValue;
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "HexBlockRangeSelector",
|
name: "HexBlockRangeSelector",
|
||||||
components: {
|
components: {
|
||||||
@ -54,22 +64,19 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
set(value) {
|
set(value) {
|
||||||
if (value[0] - value[1] === 0) {
|
if (value[1] - value[0] === 0) {
|
||||||
this.hexField = this.lastVal;
|
wait(50).then(() => {
|
||||||
return;
|
this.hexField = this.lastValue
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.lastValue = JSON.parse(JSON.stringify(value))
|
||||||
}
|
}
|
||||||
this.lastVal = this.hexField
|
this.$emit("update:modelValue", getHexValue(value, this.max))
|
||||||
let result = '0'.repeat(value[0]) + '1'.repeat(value[1] - value[0]) + '0'.repeat(this.max - value[1])
|
|
||||||
result = (parseInt(result, 2).toString(16))
|
|
||||||
let zeroPadding = '0'.repeat(Number.parseInt('1'.repeat(this.max), 2).toString(16).length - result.length)
|
|
||||||
result = '0x' + zeroPadding + result
|
|
||||||
console.log(result)
|
|
||||||
this.$emit("update:modelValue", result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {lastVal: [0, 1]}
|
return {lastValue: [0, 1]}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
isVcat: {
|
isVcat: {
|
||||||
|
Loading…
Reference in New Issue
Block a user