diff --git a/frontend/src/components/common/FileOpenInput.vue b/frontend/src/components/common/FileOpenInput.vue
new file mode 100644
index 0000000..369cb9e
--- /dev/null
+++ b/frontend/src/components/common/FileOpenInput.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+ ...
+
+
+
+
diff --git a/frontend/src/components/common/SwitchButton.vue b/frontend/src/components/common/SwitchButton.vue
new file mode 100644
index 0000000..3dd33be
--- /dev/null
+++ b/frontend/src/components/common/SwitchButton.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ props.tTooltips ? $t(props.tTooltips[i]) : '' }}
+
+
+
+
+
diff --git a/frontend/src/components/dialogs/ConnectionDialog.vue b/frontend/src/components/dialogs/ConnectionDialog.vue
index 9f53685..d396b5b 100644
--- a/frontend/src/components/dialogs/ConnectionDialog.vue
+++ b/frontend/src/components/dialogs/ConnectionDialog.vue
@@ -6,7 +6,7 @@ import { ListSentinelMasters, TestConnection } from 'wailsjs/go/services/connect
import useDialog, { ConnDialogType } from 'stores/dialog'
import Close from '@/components/icons/Close.vue'
import useConnectionStore from 'stores/connections.js'
-import { SelectFile } from 'wailsjs/go/services/systemService.js'
+import FileOpenInput from '@/components/common/FileOpenInput.vue'
/**
* Dialog for new or edit connection
@@ -83,39 +83,6 @@ const sshLoginType = computed(() => {
return get(generalForm.value, 'ssh.loginType', 'pwd')
})
-const onSSHChooseKey = async () => {
- const { success, data } = await SelectFile()
- const path = get(data, 'path', '')
- if (!isEmpty(path)) {
- generalForm.value.ssh.pkFile = path
- }
-}
-
-const onSSLChooseCert = async () => {
- const { success, data } = await SelectFile()
- const path = get(data, 'path', '')
- if (!isEmpty(path)) {
- generalForm.value.ssl.certFile = path
- }
-}
-
-const onSSLChooseKey = async () => {
- const { success, data } = await SelectFile()
- const path = get(data, 'path', '')
- if (!isEmpty(path)) {
- generalForm.value.ssl.keyFile = path
- }
-}
-
-const onSSLChooseCA = async () => {
- const { success, data } = await SelectFile()
- if (!success) {
- generalForm.value.ssl.caFile = ''
- } else {
- generalForm.value.ssl.caFile = get(data, 'path', '')
- }
-}
-
const loadingSentinelMaster = ref(false)
const masterNameOptions = ref([])
const onLoadSentinelMasters = async () => {
@@ -434,43 +401,22 @@ const onClose = () => {
:show-require-mark="false"
label-placement="top">
-
-
-
- ...
-
-
+
-
-
-
- ...
-
-
+
-
-
-
- ...
-
-
+
@@ -519,18 +465,10 @@ const onClose = () => {
type="password" />
-
-
-
- ...
-
-
+