From 39490c72b15983f5dcf041356da8c033a4aa241e Mon Sep 17 00:00:00 2001 From: Wu Zhou Date: Mon, 16 May 2022 14:34:05 +0800 Subject: [PATCH] config-tools: add validation to IVSHMEM widget Add validation to IVSHMEM widget, displaying error msg below the input line. Currently only check for empty line. Tracked-On: #7481 Signed-off-by: Zhou, Wu --- .../CustomWidget/IVSHMEM_REGION.vue | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue index 2103269c4..6e5aac1c1 100644 --- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue +++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/IVSHMEM_REGION.vue @@ -9,7 +9,10 @@ - + + + must have value + @@ -45,10 +48,16 @@ - + + + must have value + - +
@@ -148,6 +157,9 @@ export default { } }, methods: { + validation(value) { + return value.length != 0; + }, addSharedVM(vms, index) { // add new item after current item vms.splice(index + 1, 0, { @@ -175,11 +187,11 @@ export default { "IVSHMEM_VMS": { "IVSHMEM_VM": [ { - "VM_NAME": "PRE_RT_VM0", + "VM_NAME": "", "VBDF": "" }, { - "VM_NAME": "POST_STD_VM1", + "VM_NAME": "", "VBDF": "" } ] @@ -237,4 +249,4 @@ label:before { background: #f9f9f9; padding: 5px 5px 3px; } - \ No newline at end of file +