feat(settings): 增加全局表格分页配置,支持自定义

This commit is contained in:
IanShaw027
2026-04-09 18:14:28 +08:00
parent d8fa38d55a
commit ad80606a44
14 changed files with 591 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ import {
type ReleaseInfo
} from '@/api/admin/system'
import { getPublicSettings as fetchPublicSettingsAPI } from '@/api/auth'
import { syncPersistedPageSizeWithSystemDefault } from '@/composables/usePersistedPageSize'
export const useAppStore = defineStore('app', () => {
// ==================== State ====================
@@ -284,6 +285,10 @@ export const useAppStore = defineStore('app', () => {
* Apply settings to store state (internal helper to avoid code duplication)
*/
function applySettings(config: PublicSettings): void {
if (typeof window !== 'undefined') {
window.__APP_CONFIG__ = { ...config }
}
syncPersistedPageSizeWithSystemDefault(config.table_default_page_size)
cachedPublicSettings.value = config
siteName.value = config.site_name || 'Sub2API'
siteLogo.value = config.site_logo || ''
@@ -329,6 +334,8 @@ export const useAppStore = defineStore('app', () => {
hide_ccs_import_button: false,
purchase_subscription_enabled: false,
purchase_subscription_url: '',
table_default_page_size: 20,
table_page_size_options: [10, 20, 50],
custom_menu_items: [],
custom_endpoints: [],
linuxdo_oauth_enabled: false,