feat: multi-connection parallel support

- connection store: connectedIds array, per-connection health/serverInfo maps
- connect() no longer disconnects existing connections
- New switchTo(id), disconnectById(id), isConnectedById(id) methods
- Per-connection health check timers (Map-based)
- ConnectionCard: switch to connected, connect if not, disconnect if active
- MainArea: per-connection tab state (save/restore on switch)
- Connection switcher dropdown in tab bar showing all open connections
- Clean up tab state when connection disconnects
This commit is contained in:
2026-07-07 20:31:57 +08:00
parent 11a73494c0
commit 6a1f94cd48
4 changed files with 185 additions and 33 deletions
+8 -3
View File
@@ -9,14 +9,19 @@ const emit = defineEmits<{ edit: [conn: ConnectionConfig]; delete: [id: string]
const connStore = useConnectionStore()
const isActive = computed(() => connStore.activeId === props.connection.id)
const isConn = computed(() => connStore.isConnectedById(props.connection.id))
const statusColor = computed(() => {
if (isActive.value) return 'var(--success)'
if (isConn.value) return 'var(--success)'
return 'var(--text-muted)'
})
function handleClick() {
if (isActive.value) {
connStore.disconnect()
if (isConn.value) {
if (isActive.value) {
connStore.disconnect()
} else {
connStore.switchTo(props.connection.id)
}
} else {
connStore.connect(props.connection)
}