From 56af869bcc9afc5fa7806551d00de9d24d1dfe75 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Thu, 1 May 2025 17:45:12 +0800 Subject: [PATCH] Update AddConnectionForm.vue --- packages/frontend/src/components/AddConnectionForm.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/components/AddConnectionForm.vue b/packages/frontend/src/components/AddConnectionForm.vue index 9d06e26..73c6c22 100644 --- a/packages/frontend/src/components/AddConnectionForm.vue +++ b/packages/frontend/src/components/AddConnectionForm.vue @@ -25,6 +25,8 @@ const tagsStore = useTagsStore(); // 获取标签 store 实例 const { isLoading: isConnLoading, error: connStoreError } = storeToRefs(connectionsStore); const { proxies, isLoading: isProxyLoading, error: proxyStoreError } = storeToRefs(proxiesStore); // 获取代理列表和状态 const { tags, isLoading: isTagLoading, error: tagStoreError } = storeToRefs(tagsStore); // 获取标签列表和状态 +const sshKeysStore = useSshKeysStore(); // +++ Get SSH Key store instance +++ +const { isLoading: isSshKeyLoading, error: sshKeyStoreError } = storeToRefs(sshKeysStore); // +++ Get SSH Key store state +++ // 表单数据模型 const initialFormData = { @@ -46,8 +48,8 @@ const formData = reactive({ ...initialFormData }); const formError = ref(null); // 表单级别的错误信息 // 合并所有 store 的加载和错误状态 -const isLoading = computed(() => isConnLoading.value || isProxyLoading.value || isTagLoading.value); -const storeError = computed(() => connStoreError.value || proxyStoreError.value || tagStoreError.value); +const isLoading = computed(() => isConnLoading.value || isProxyLoading.value || isTagLoading.value || isSshKeyLoading.value); // +++ Include SSH Key loading +++ +const storeError = computed(() => connStoreError.value || proxyStoreError.value || tagStoreError.value || sshKeyStoreError.value); // +++ Include SSH Key error +++ // 测试连接状态 const testStatus = ref<'idle' | 'testing' | 'success' | 'error'>('idle'); @@ -98,6 +100,7 @@ watch(() => props.connectionToEdit, (newVal) => { onMounted(() => { proxiesStore.fetchProxies(); tagsStore.fetchTags(); // 获取标签列表 + sshKeysStore.fetchSshKeys(); // +++ Fetch SSH keys +++ }); // 监听连接类型变化,动态调整默认端口