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,
{ 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) => {
try {
if (!connectionStore.isConnected(name)) {
openingConnection.value = true
await connectionStore.openConnection(name)
}
tabStore.upsertTab({
server: name,
server: nam,
})
} catch (e) {
message.error(e.message)

View File

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

View File

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