From ad52a9d764efffc36a3f371a5e551ea4ef3fa689 Mon Sep 17 00:00:00 2001 From: mabasian <54101509+mabasian@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:25:39 +0100 Subject: [PATCH] ADD: validation on the installation path (#2103) fix #2056 --- .../components/CustomPath.vue | 30 +++++++++++-------- .../components/plugin/ConfigFooter.vue | 16 +++++++++- .../components/plugin/InstallationPath.vue | 18 ++++++++++- launcher/src/store/clickInstallation.js | 1 + 4 files changed, 50 insertions(+), 15 deletions(-) diff --git a/launcher/src/components/UI/custom-installation/components/CustomPath.vue b/launcher/src/components/UI/custom-installation/components/CustomPath.vue index b528acf41..ea543d381 100755 --- a/launcher/src/components/UI/custom-installation/components/CustomPath.vue +++ b/launcher/src/components/UI/custom-installation/components/CustomPath.vue @@ -69,9 +69,11 @@
@@ -79,11 +81,11 @@ - + diff --git a/launcher/src/components/UI/one-click/components/plugin/InstallationPath.vue b/launcher/src/components/UI/one-click/components/plugin/InstallationPath.vue index 368fd91e2..b522a152b 100644 --- a/launcher/src/components/UI/one-click/components/plugin/InstallationPath.vue +++ b/launcher/src/components/UI/one-click/components/plugin/InstallationPath.vue @@ -9,7 +9,13 @@ {{ $t("pluginName.path") }}
- +
@@ -25,6 +31,7 @@ name="Start up client after installation?" class="h-5 w-5 rounded-md border-gray-200 bg-white shadow-sm" /> + {{ $t("pluginName.startOnInstall") }}
@@ -66,9 +73,15 @@ import { onMounted } from "vue"; const clickStore = useClickInstall(); +const validatePath = () => { + const pathRegex = /^\/(?:[^ /\0*?<>|&{}$;][^ /\0]*\/?)*[^ /\0*?<>|&{}$;]{1,}$/; + clickStore.isPathValid = pathRegex.test(clickStore.installationPath.trim()); +}; + onMounted(() => { clickStore.installMonitoring = false; clickStore.startServicesAfterInstall = true; + clickStore.isPathValid = true; }); diff --git a/launcher/src/store/clickInstallation.js b/launcher/src/store/clickInstallation.js index 9dc6bc0ae..8c3a47b33 100755 --- a/launcher/src/store/clickInstallation.js +++ b/launcher/src/store/clickInstallation.js @@ -3,6 +3,7 @@ import { defineStore } from "pinia"; export const useClickInstall = defineStore("clickInstallation", { state: () => { return { + isPathValid: true, startServicesAfterInstall: false, isConfigButtonEnbabled: false, installMonitoring: false,