Compare commits

..

No commits in common. "a2b0fc183f032999225a5d198c365b5d7926ccb8" and "3c43f960c3a0d4068a357d6700b90ec322108c42" have entirely different histories.

4 changed files with 23 additions and 17 deletions

View File

@ -133,14 +133,23 @@ const onKeyShortcut = (e) => {
case 'Delete': case 'Delete':
onDelete() onDelete()
return return
case 'd':
if (e.metaKey && isMacOS()) {
onDelete()
}
return
case 'F5': case 'F5':
onReload() onReload()
return return
case 'r': case 'r':
if (e.metaKey && isMacOS()) { if (e.metaKey && isMacOS()) {
onReload() onReload()
} }
return return
case 'F2': case 'F2':
onRename() onRename()
return return

View File

@ -154,11 +154,7 @@ const onAdd = async () => {
value = defaultValue[type] value = defaultValue[type]
} }
// await browserStore.reloadKey({server, db, key: trim(key)}) // await browserStore.reloadKey({server, db, key: trim(key)})
const { const { success, msg, nodeKey } = await browserStore.setKey({
success,
msg,
nodeKey = '',
} = await browserStore.setKey({
server, server,
db, db,
key: trim(key), key: trim(key),
@ -169,11 +165,8 @@ const onAdd = async () => {
if (success) { if (success) {
// select current key // select current key
await nextTick() await nextTick()
const selectedDB = browserStore.getSelectedDB(server) tabStore.setSelectedKeys(server, nodeKey)
if (selectedDB === db) { browserStore.reloadKey({ server, db, key })
tabStore.setSelectedKeys(server, nodeKey)
browserStore.reloadKey({ server, db, key })
}
} else if (!isEmpty(msg)) { } else if (!isEmpty(msg)) {
$message.error(msg) $message.error(msg)
} }

View File

@ -355,6 +355,11 @@ const onKeyShortcut = (e) => {
case 'Delete': case 'Delete':
handleKeyDelete() handleKeyDelete()
break break
case 'd':
if (e.metaKey && isMacOS()) {
handleKeyDelete()
}
break
case 'F5': case 'F5':
handleSelectContextMenu('value_reload') handleSelectContextMenu('value_reload')
break break

View File

@ -832,7 +832,7 @@ const useBrowserStore = defineStore('browser', {
if (success) { if (success) {
/** @type RedisServerState **/ /** @type RedisServerState **/
const serverInst = this.servers[server] const serverInst = this.servers[server]
if (serverInst != null && serverInst.db === db) { if (serverInst != null) {
// const { value } = data // const { value } = data
// update tree view data // update tree view data
const { newKey = 0 } = serverInst.addKeyNodes([key], true) const { newKey = 0 } = serverInst.addKeyNodes([key], true)
@ -840,12 +840,11 @@ const useBrowserStore = defineStore('browser', {
serverInst.tidyNode(key) serverInst.tidyNode(key)
serverInst.updateDBKeyCount(db, newKey) serverInst.updateDBKeyCount(db, newKey)
} }
}
const { value: updatedValue } = data const { value: updatedValue } = data
if (updatedValue != null) { if (updatedValue != null) {
const tab = useTabStore() const tab = useTabStore()
tab.updateValue({ server, db, key, value: updatedValue }) tab.updateValue({ server, db, key, value: updatedValue })
}
} }
// this.loadKeySummary({ server, db, key }) // this.loadKeySummary({ server, db, key })
return { return {