feat: batch delete preview, FlushDB, search history, cancel scan

- P2-7: KeyList batch delete preview dialog (max 100 keys shown)
- P2-11: StatusView FlushDB with double confirmation (type FLUSHDB)
- P2-12: KeyList search history (localStorage, max 20, dropdown on focus)
- P2-13: key store cancelScan() + KeyList cancel button
- i18n keys for all features (zh-CN + en)
This commit is contained in:
2026-07-07 22:04:47 +08:00
parent b85e67541b
commit 90d56f2a12
6 changed files with 309 additions and 31 deletions
+14 -2
View File
@@ -26,6 +26,7 @@ export const useKeyStore = defineStore('key', () => {
const loading = ref(false)
const scanCursor = ref('0')
const hasMore = ref(false)
const scanAborted = ref(false)
const pattern = ref('*')
const useTree = ref(false)
const currentDb = ref(0)
@@ -71,11 +72,22 @@ export const useKeyStore = defineStore('key', () => {
return root
}
function cancelScan() {
scanAborted.value = true
}
async function scanKeys(connId: string, cursor: string = '0', reset: boolean = false) {
if (scanAborted.value) {
scanAborted.value = false
loading.value = false
return
}
if (reset) {
scanCursor.value = '0'
keys.value = []
hasMore.value = false
scanAborted.value = false
}
loading.value = true
@@ -180,7 +192,7 @@ export const useKeyStore = defineStore('key', () => {
return {
keys, treeKeys, selectedKey, selectedType, selectedTTL, keyData,
loading, scanCursor, hasMore, pattern, useTree, currentDb,
scanKeys, loadKeyTypeAndTTL, loadKeyData, selectDb,
loading, scanCursor, hasMore, scanAborted, pattern, useTree, currentDb,
scanKeys, cancelScan, loadKeyTypeAndTTL, loadKeyData, selectDb,
}
})