feat: Library 批量注册 + PeopleView 修复 + 国际化
Library: - 添加 checkbox 和鼠标框选功能 - Unregistered 卡片添加快速注册按钮 - 状态标签移至左下方,人脸图标移至左侧中间 - Deep Scan 改为 unregister -> register -> process - 完整国际化(日语、繁体中文、英语) PeopleView: - 修复卡片不显示问题(使用 get_file_traces API) - 移除对 identity_id 字段的依赖 其他: - 添加日语语言包 - 添加 useDragSelect composable - 新增文档:Face Bbox Null Bug Report
This commit is contained in:
28
src/stores/autoScan.ts
Normal file
28
src/stores/autoScan.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Auto Scan Store - controls whether registering a file triggers an automatic deep scan
|
||||
import { ref, computed } from 'vue'
|
||||
|
||||
const AUTO_SCAN_KEY = 'momentry_auto_scan_after_register'
|
||||
|
||||
// Load initial state (default OFF: pure registration, no auto deep scan)
|
||||
const savedAutoScan = localStorage.getItem(AUTO_SCAN_KEY)
|
||||
const autoScanEnabled = ref(savedAutoScan === 'true')
|
||||
|
||||
export function useAutoScan() {
|
||||
const autoScanAfterRegister = computed(() => autoScanEnabled.value)
|
||||
|
||||
function toggleAutoScan() {
|
||||
autoScanEnabled.value = !autoScanEnabled.value
|
||||
localStorage.setItem(AUTO_SCAN_KEY, autoScanEnabled.value.toString())
|
||||
}
|
||||
|
||||
function setAutoScan(value: boolean) {
|
||||
autoScanEnabled.value = value
|
||||
localStorage.setItem(AUTO_SCAN_KEY, value.toString())
|
||||
}
|
||||
|
||||
return {
|
||||
autoScanAfterRegister,
|
||||
toggleAutoScan,
|
||||
setAutoScan,
|
||||
}
|
||||
}
|
||||
32
src/stores/themeStore.ts
Normal file
32
src/stores/themeStore.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
|
||||
const THEME_KEY = 'momentry_theme'
|
||||
const saved = localStorage.getItem(THEME_KEY) || 'auto'
|
||||
const theme = ref(saved)
|
||||
|
||||
function applyTheme(t: string) {
|
||||
if (t === 'auto') {
|
||||
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
document.documentElement.setAttribute('data-theme', prefersDark ? 'dark' : 'light')
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-theme', t)
|
||||
}
|
||||
}
|
||||
|
||||
watch(theme, (v) => {
|
||||
localStorage.setItem(THEME_KEY, v)
|
||||
applyTheme(v)
|
||||
})
|
||||
|
||||
export function useTheme() {
|
||||
onMounted(() => applyTheme(theme.value))
|
||||
|
||||
function toggleTheme() {
|
||||
const current = theme.value === 'auto'
|
||||
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
|
||||
: theme.value
|
||||
theme.value = current === 'dark' ? 'light' : 'dark'
|
||||
}
|
||||
|
||||
return { theme, toggleTheme }
|
||||
}
|
||||
Reference in New Issue
Block a user