[PATCH] config_tools: add tooltips for cpu affinity


Kunhui Li
 

add tooltips for cpu affinity and tiny fix for virtio console device.

Tracked-On: #7933
Signed-off-by: Kunhui-Li <kunhuix.li@...>
---
.../CustomWidget/Virtio/Console.vue | 2 +-
.../ConfigForm/CustomWidget/cpu_affinity.vue | 19 ++++++++++++++++---
2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index 173dd7168..17fe4b7ec 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -131,7 +131,7 @@ export default {
},
data() {
return {
- ConsoleConfiguration: this.rootSchema.definitions['BasicVirtioConsoleBackendType'],
+ ConsoleConfiguration: this.rootSchema.definitions['VirtioConsoleConfiguration'],
enumNames: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames'],
enum: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue
index c796a2d56..387bc08d9 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue
@@ -13,8 +13,15 @@
<b-row class="align-items-center"
v-for="(cpu,index) in defaultVal.pcpu">
<b-col>
- <span v-if="index===0" style="color: red; margin-left: -10px;margin-right: 4px">*</span>
- pCPU ID
+ <label class="requiredField" v-if="index===0"></label>
+ <label>
+ <n-popover trigger="hover" placement="top-start">
+ <template #trigger>
+ <IconInfo/>
+ </template>
+ <span v-html="this.CPUAffinityConfiguration.properties.pcpu_id.description"></span>
+ </n-popover>pCPU ID
+ </label>
</b-col>
<b-col>
<b-form-select :state="validateCPUAffinity(cpu.pcpu_id)" v-model="cpu.pcpu_id"
@@ -73,10 +80,11 @@ import _ from 'lodash'
import {Icon} from "@vicons/utils";
import {Plus, Minus} from '@vicons/fa'
import {BFormInput, BRow} from "bootstrap-vue-3";
+import IconInfo from '@lljj/vjsf-utils/icons/IconInfo.vue';

export default {
name: "cpu_affinity",
- components: {BRow, BFormInput, Icon, Plus, Minus},
+ components: {BRow, BFormInput, Icon, Plus, Minus, IconInfo},
props: {
...fieldProps,
},
@@ -110,6 +118,7 @@ export default {
},
data() {
return {
+ CPUAffinityConfiguration: this.rootSchema.definitions['CPUAffinityConfiguration'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
}
},
@@ -141,6 +150,10 @@ export default {
</script>

<style scoped>
+.requiredField:before {
+ content: '*';
+ color: red;
+}

.ToolSet {
display: flex;
--
2.25.1


Junjie Mao
 

Kunhui-Li <kunhuix.li@...> writes:

add tooltips for cpu affinity and tiny fix for virtio console device.

Tracked-On: #7933
Signed-off-by: Kunhui-Li <kunhuix.li@...>
For UI only changes, you can PR once tested that the issue is properly fixed.

---
.../CustomWidget/Virtio/Console.vue | 2 +-
.../ConfigForm/CustomWidget/cpu_affinity.vue | 19 ++++++++++++++++---
2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
index 173dd7168..17fe4b7ec 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/Virtio/Console.vue
@@ -131,7 +131,7 @@ export default {
},
data() {
return {
- ConsoleConfiguration: this.rootSchema.definitions['BasicVirtioConsoleBackendType'],
+ ConsoleConfiguration: this.rootSchema.definitions['VirtioConsoleConfiguration'],
enumNames: this.rootSchema.definitions['VirtioConsoleUseType']['enumNames'],
enum: this.rootSchema.definitions['VirtioConsoleUseType']['enum'],
ConsoleBackendType: this.rootSchema.definitions['BasicVirtioConsoleBackendType']['enum'],
diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue
index c796a2d56..387bc08d9 100644
--- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue
+++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue
@@ -13,8 +13,15 @@
<b-row class="align-items-center"
v-for="(cpu,index) in defaultVal.pcpu">
<b-col>
- <span v-if="index===0" style="color: red; margin-left: -10px;margin-right: 4px">*</span>
- pCPU ID
+ <label class="requiredField" v-if="index===0"></label>
+ <label>
+ <n-popover trigger="hover" placement="top-start">
+ <template #trigger>
+ <IconInfo/>
+ </template>
+ <span v-html="this.CPUAffinityConfiguration.properties.pcpu_id.description"></span>
+ </n-popover>pCPU ID
+ </label>
</b-col>
<b-col>
<b-form-select :state="validateCPUAffinity(cpu.pcpu_id)" v-model="cpu.pcpu_id"
@@ -73,10 +80,11 @@ import _ from 'lodash'
import {Icon} from "@vicons/utils";
import {Plus, Minus} from '@vicons/fa'
import {BFormInput, BRow} from "bootstrap-vue-3";
+import IconInfo from '@lljj/vjsf-utils/icons/IconInfo.vue';

export default {
name: "cpu_affinity",
- components: {BRow, BFormInput, Icon, Plus, Minus},
+ components: {BRow, BFormInput, Icon, Plus, Minus, IconInfo},
props: {
...fieldProps,
},
@@ -110,6 +118,7 @@ export default {
},
data() {
return {
+ CPUAffinityConfiguration: this.rootSchema.definitions['CPUAffinityConfiguration'],
defaultVal: vueUtils.getPathVal(this.rootFormData, this.curNodePath)
}
},
@@ -141,6 +150,10 @@ export default {
</script>

<style scoped>
+.requiredField:before {
+ content: '*';
+ color: red;
+}

.ToolSet {
display: flex;
--
Best Regards
Junjie Mao