mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-21 18:19:03 +08:00
feat(URL协议): 增强URL协议注册健壮性
- 新增check_url_protocol_status命令检测注册状态 - 新增unregister_url_protocol命令取消注册 - 改进register_url_protocol命令增加验证逻辑 - 前端增加状态检测、自动重试和操作日志功能 - 更新多语言翻译支持新功能
This commit is contained in:
+23
@@ -36,6 +36,8 @@ import { ThemeProvider, useTheme } from "./contexts/ThemeContext"
|
||||
import { MOBILE_NAV_ITEMS, MobileNavKey, sanitizeMobileNavKeys } from "./shared/mobileNavigation"
|
||||
import { resolveStoredFontFamily } from "./shared/fontFamily"
|
||||
import { getPluginRuntime } from "./plugins/runtime"
|
||||
import { sectlCloudSync } from "./services/sectlCloudSync"
|
||||
import { sectlAuth } from "./services/sectlAuth"
|
||||
|
||||
const DEFAULT_MOBILE_BOTTOM_NAV_ITEMS: MobileNavKey[] = MOBILE_NAV_ITEMS.map((item) => item.key)
|
||||
const DEFAULT_MOBILE_BOTTOM_PRIMARY_KEYS: MobileNavKey[] = DEFAULT_MOBILE_BOTTOM_NAV_ITEMS.slice(
|
||||
@@ -389,6 +391,27 @@ function MainContent(): React.JSX.Element {
|
||||
if (permission !== "admin") return
|
||||
try {
|
||||
syncCheckingRef.current = true
|
||||
|
||||
const settingsRes = await api.getAllSettings()
|
||||
const syncMethod = settingsRes?.success ? settingsRes.data?.sync_method : null
|
||||
|
||||
if (syncMethod === "sectl_cloud") {
|
||||
if (!sectlAuth.isAuthenticated()) return
|
||||
const status = sectlCloudSync.getStatus()
|
||||
if (!status.is_configured || status.is_syncing) return
|
||||
|
||||
const now = Date.now()
|
||||
const recentLocal = now - lastLocalMutationAtRef.current < 15000
|
||||
const direction = recentLocal ? "push" : "bidirectional"
|
||||
const result = await sectlCloudSync.fullSync(direction)
|
||||
if (result.success) {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("ss:data-updated", { detail: { category: "all", source: "sync" } })
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
const statusRes = await api.dbGetStatus()
|
||||
if (
|
||||
!statusRes?.success ||
|
||||
|
||||
Reference in New Issue
Block a user