Remove opening status display when try open an opened connection

This commit is contained in:
tiny-craft 2023-07-01 02:38:23 +08:00
parent a402c6ac30
commit e1f6aed33b
3 changed files with 9 additions and 7 deletions

View File

@ -145,7 +145,7 @@ const renderPrefix = ({ option }) => {
NIcon, NIcon,
{ size: 20 }, { size: 20 },
{ {
default: () => h(ToggleServer, { modelValue: !!connecte }), default: () => h(ToggleServer, { modelValue: !!connected }),
} }
) )
} }
@ -166,10 +166,12 @@ const onUpdateSelectedKeys = (keys, option, meta) => {
*/ */
const openConnection = async (name) => { const openConnection = async (name) => {
try { try {
if (!connectionStore.isConnected(name)) {
openingConnection.value = true openingConnection.value = true
await connectionStore.openConnection(name) await connectionStore.openConnection(name)
}
tabStore.upsertTab({ tabStore.upsertTab({
server: name, server: nam,
}) })
} catch (e) { } catch (e) {
message.error(e.message) message.error(e.message)

View File

@ -168,7 +168,7 @@ const renderPrefix = ({ option }) => {
NIcon, NIcon,
{ size: 20 }, { size: 20 },
{ {
default: () => h(ToggleDb, { modelValue: option.opened === true }, default: () => h(ToggleDb, { modelValue: option.opened === true }),
} }
) )
case ConnectionType.RedisKey: case ConnectionType.RedisKey:
@ -331,11 +331,11 @@ const handleOutsideContextMenu = () => {
:data="connectionStore.databases[props.server] || []" :data="connectionStore.databases[props.server] || []"
:expand-on-click="false" :expand-on-click="false"
:expanded-keys="expandedKeys" :expanded-keys="expandedKeys"
:selected-keys="selectedKeys"
:on-update:selected-keys="onUpdateSelectedKeys" :on-update:selected-keys="onUpdateSelectedKeys"
:node-props="nodeProps" :node-props="nodeProps"
:on-load="onLoadTree" :on-load="onLoadTree"
:on-update:expanded-keys="onUpdateExpanded" :on-update:expanded-keys="onUpdateExpanded"
:selected-keys="selectedKeys"
:render-label="renderLabel" :render-label="renderLabel"
:render-prefix="renderPrefix" :render-prefix="renderPrefix"
:render-suffix="renderSuffix" :render-suffix="renderSuffix"

View File

@ -109,7 +109,7 @@ const useTabStore = defineStore('tab', {
type, type,
ttl, ttl,
key, key,
valu, value,
}) })
tabIndex = this.tabList.length - 1 tabIndex = this.tabList.length - 1
} }