add searchTableSize limit

This commit is contained in:
pa
2026-02-01 01:58:09 +09:00
parent d9080205e5
commit 0b59423f61
28 changed files with 346 additions and 102 deletions
+45 -4
View File
@@ -5,6 +5,14 @@ import { useI18n } from 'vue-i18n';
import Noty from 'noty';
import {
DEFAULT_MAX_TABLE_SIZE,
DEFAULT_SEARCH_LIMIT,
LEGACY_MAX_TABLE_SIZE_DEFAULT,
SEARCH_LIMIT_MAX,
SEARCH_LIMIT_MIN,
TABLE_MAX_SIZE_MAX
} from '../shared/constants';
import {
clearPiniaActionTrail,
getPiniaActionTrail
@@ -74,7 +82,8 @@ export const useVrcxStore = defineStore('Vrcx', () => {
const isRegistryBackupDialogVisible = ref(false);
const ipcEnabled = ref(false);
const clearVRCXCacheFrequency = ref(172800);
const maxTableSize = ref(1000);
const maxTableSize = ref(DEFAULT_MAX_TABLE_SIZE);
const searchLimit = ref(DEFAULT_SEARCH_LIMIT);
const proxyServer = ref('');
async function init() {
@@ -148,13 +157,44 @@ export const useVrcxStore = defineStore('Vrcx', () => {
maxTableSize.value = await configRepository.getInt(
'VRCX_maxTableSize',
1000
LEGACY_MAX_TABLE_SIZE_DEFAULT
);
if (maxTableSize.value > 10000) {
maxTableSize.value = 1000;
if (maxTableSize.value > TABLE_MAX_SIZE_MAX) {
maxTableSize.value = TABLE_MAX_SIZE_MAX;
}
const maxTableSizeMigrated = await configRepository.getBool(
'VRCX_maxTableSizeMigrated500',
false
);
// Migrate old default table size (1000) to new default (500)
if (
maxTableSize.value === LEGACY_MAX_TABLE_SIZE_DEFAULT &&
!maxTableSizeMigrated
) {
maxTableSize.value = DEFAULT_MAX_TABLE_SIZE;
await configRepository.setInt(
'VRCX_maxTableSize',
maxTableSize.value
);
await configRepository.setBool(
'VRCX_maxTableSizeMigrated500',
true
);
}
database.setMaxTableSize(maxTableSize.value);
searchLimit.value = await configRepository.getInt(
'VRCX_searchLimit',
DEFAULT_SEARCH_LIMIT
);
if (searchLimit.value < SEARCH_LIMIT_MIN) {
searchLimit.value = SEARCH_LIMIT_MIN;
}
if (searchLimit.value > SEARCH_LIMIT_MAX) {
searchLimit.value = SEARCH_LIMIT_MAX;
}
database.setSearchTableSize(searchLimit.value);
refreshCustomScript();
}
@@ -787,6 +827,7 @@ export const useVrcxStore = defineStore('Vrcx', () => {
ipcEnabled,
clearVRCXCacheFrequency,
maxTableSize,
searchLimit,
clearVRCXCache,
eventVrcxMessage,
eventLaunchCommand,