diff --git a/src/main/store.ts b/src/main/store.ts
index 07faa2a..db66e10 100644
--- a/src/main/store.ts
+++ b/src/main/store.ts
@@ -26,6 +26,7 @@ interface ConnectionConfig {
sentinelMasterName: string
sentinelNodePassword: string
separator: string
+ scanCount?: number
order: number
createdAt: number
color?: string
diff --git a/src/renderer/src/components/NewConnectionDialog.vue b/src/renderer/src/components/NewConnectionDialog.vue
index 6833f85..f1d9be0 100644
--- a/src/renderer/src/components/NewConnectionDialog.vue
+++ b/src/renderer/src/components/NewConnectionDialog.vue
@@ -28,6 +28,7 @@ const form = reactive({
sentinelNodePassword: '',
cluster: false,
separator: ':',
+ scanCount: 100,
sshEnabled: false,
sshHost: '',
sshPort: 22,
@@ -66,6 +67,7 @@ watch(() => props.visible, async (v) => {
sentinelNodePassword: props.connection.sentinelNodePassword || '',
cluster: props.connection.cluster || false,
separator: props.connection.separator,
+ scanCount: props.connection.scanCount ?? 100,
sshEnabled: props.connection.sshEnabled || false,
sshHost: props.connection.sshHost || '',
sshPort: props.connection.sshPort || 22,
@@ -84,6 +86,7 @@ watch(() => props.visible, async (v) => {
sentinelMasterName: '', sentinelNodePassword: '',
cluster: false,
separator: ':',
+ scanCount: 100,
sshEnabled: false, sshHost: '', sshPort: 22,
sshUsername: '', sshPassword: '', sshPrivateKeyPath: '', sshPassphrase: '',
})
@@ -203,6 +206,7 @@ async function handleSave() {
sshPrivateKeyPath: form.sshPrivateKeyPath,
sshPassphrase: form.sshPassphrase,
separator: form.separator || ':',
+ scanCount: form.scanCount,
order: props.connection?.order ?? connStore.connections.length,
createdAt: props.connection?.createdAt ?? Date.now(),
}
@@ -258,6 +262,9 @@ async function handleSave() {
+
+
+
diff --git a/src/renderer/src/components/SettingsView.vue b/src/renderer/src/components/SettingsView.vue
index 02d8526..4d43ca6 100644
--- a/src/renderer/src/components/SettingsView.vue
+++ b/src/renderer/src/components/SettingsView.vue
@@ -50,18 +50,6 @@ const fontOptions = [
-
-
-
-
-
{
const theme = ref((localStorage.getItem('theme') as ThemeMode) || 'system')
const isDark = ref(true)
const fontSize = ref(Number(localStorage.getItem('fontSize')) || 13)
- const scanCount = ref(Number(localStorage.getItem('scanCount')) || 100)
const zoom = ref(Number(localStorage.getItem('zoom')) || 1.0)
const fontFamily = ref(localStorage.getItem('fontFamily') || 'Cascadia Code')
@@ -41,11 +40,6 @@ export const useAppStore = defineStore('app', () => {
localStorage.setItem('fontSize', String(size))
}
- function setScanCount(count: number) {
- scanCount.value = count
- localStorage.setItem('scanCount', String(count))
- }
-
function setZoom(value: number) {
zoom.value = value
localStorage.setItem('zoom', String(value))
@@ -62,5 +56,5 @@ export const useAppStore = defineStore('app', () => {
document.body.style.zoom = String(zoom.value)
document.documentElement.style.setProperty('--font-mono', fontFamily.value)
- return { theme, isDark, fontSize, scanCount, zoom, fontFamily, setTheme, setFontSize, setScanCount, setZoom, setFontFamily }
+ return { theme, isDark, fontSize, zoom, fontFamily, setTheme, setFontSize, setZoom, setFontFamily }
})
diff --git a/src/renderer/src/stores/connection.ts b/src/renderer/src/stores/connection.ts
index 7d80a6d..4eac32e 100644
--- a/src/renderer/src/stores/connection.ts
+++ b/src/renderer/src/stores/connection.ts
@@ -27,6 +27,7 @@ export interface ConnectionConfig {
sentinelMasterName: string
sentinelNodePassword: string
separator: string
+ scanCount?: number
order: number
createdAt: number
color?: string
diff --git a/src/renderer/src/stores/key.ts b/src/renderer/src/stores/key.ts
index 9e107d6..db95de3 100644
--- a/src/renderer/src/stores/key.ts
+++ b/src/renderer/src/stores/key.ts
@@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { ref } from 'vue'
-import { useAppStore } from './app'
+import { useConnectionStore } from './connection'
export interface KeyItem {
name: string
@@ -93,7 +93,7 @@ export const useKeyStore = defineStore('key', () => {
loading.value = true
try {
const result: ScanResult = await window.electronAPI.redis.scanKeys(
- connId, cursor, pattern.value, useAppStore().scanCount
+ connId, cursor, pattern.value, useConnectionStore().activeConnection?.scanCount ?? 100
)
const newKeys = result.keys.map(k => ({
name: k,