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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user