refactor: 重构设置、API、图库与存储页面前端结构。
将操作日志并入设置侧栏,补齐检查更新提示与版本接口刷新;拆分各模块组件并修复图库搜索分页变量。
This commit is contained in:
1 parent
270af4e707
commit
ac65c1eb9d
51 files changed
+5119
-2059
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { getStorageBackendRow } from './storage-backends'
|
||||
import { ALLOWED_MIME_TYPES } from './constants'
|
||||
|
||||
export function readBackendIdQuery(
|
||||
query: Record<string, unknown>
|
||||
@@ -7,3 +8,21 @@ export function readBackendIdQuery(
|
||||
if (!raw || raw === 'all') return undefined
|
||||
return getStorageBackendRow(raw)?.id ?? null
|
||||
}
|
||||
|
||||
export function readContentTypeQuery(
|
||||
query: Record<string, unknown>
|
||||
): string | undefined | null {
|
||||
const raw = typeof query.contentType === 'string' ? query.contentType.trim() : ''
|
||||
if (!raw || raw === 'all') return undefined
|
||||
if (!(ALLOWED_MIME_TYPES as readonly string[]).includes(raw)) return null
|
||||
return raw
|
||||
}
|
||||
|
||||
export function readUploadSourceQuery(
|
||||
query: Record<string, unknown>
|
||||
): 'web' | 'api' | undefined | null {
|
||||
const raw = typeof query.uploadSource === 'string' ? query.uploadSource.trim() : ''
|
||||
if (!raw || raw === 'all') return undefined
|
||||
if (raw === 'web' || raw === 'api') return raw
|
||||
return null
|
||||
}
|
||||
Reference in new issue
Block a user