feat(system): add staged release updates

This commit is contained in:
jxxghp
2026-08-24 17:58:03 +08:00
parent 5415398027
commit 84326e20de
23 changed files with 1393 additions and 350 deletions
+2 -1
View File
@@ -364,6 +364,7 @@ SCHEMA_EXPORTS = {
'SystemErrorEventData': ('app.schemas.event', 'SystemErrorEventData'),
'SystemModuleInfo': ('app.schemas.system', 'SystemModuleInfo'),
'SystemModuleListData': ('app.schemas.system', 'SystemModuleListData'),
'SystemUpdateStatus': ('app.schemas.system', 'SystemUpdateStatus'),
'TMDbException': ('app.schemas.exception', 'TMDbException'),
'Tag': ('app.schemas.context', 'Tag'),
'TimeData': ('app.schemas.common', 'TimeData'),
@@ -448,7 +449,7 @@ SCHEMA_CONFLICTS = {
'FilterRuleGroup': ['app.schemas.rule', 'app.schemas.system'],
'JsonData': ['app.schemas.agent', 'app.schemas.common', 'app.schemas.context', 'app.schemas.dashboard', 'app.schemas.event', 'app.schemas.history', 'app.schemas.mediaserver', 'app.schemas.message', 'app.schemas.mfa', 'app.schemas.music', 'app.schemas.plugin', 'app.schemas.search', 'app.schemas.openai', 'app.schemas.servcookie', 'app.schemas.site', 'app.schemas.user', 'app.schemas.workflow', 'app.schemas.mcp'],
'List': ['app.schemas.agent', 'app.schemas.context', 'app.schemas.event', 'app.schemas.history', 'app.schemas.mediaserver', 'app.schemas.message', 'app.schemas.monitoring', 'app.schemas.plugin', 'app.schemas.openai', 'app.schemas.subscribe', 'app.schemas.transfer', 'app.schemas.workflow'],
'Literal': ['app.schemas.agent', 'app.schemas.music', 'app.schemas.plugin', 'app.schemas.search', 'app.schemas.servcookie', 'app.schemas.mcp'],
'Literal': ['app.schemas.agent', 'app.schemas.music', 'app.schemas.plugin', 'app.schemas.search', 'app.schemas.servcookie', 'app.schemas.system', 'app.schemas.mcp'],
'LocaleHelper': ['app.schemas.dashboard', 'app.schemas.response'],
'MediaInfo': ['app.schemas.context', 'app.schemas.system', 'app.schemas.transfer', 'app.schemas.workflow'],
'MediaSource': ['app.schemas.cache', 'app.schemas.context', 'app.schemas.event', 'app.schemas.history', 'app.schemas.mediaserver', 'app.schemas.music', 'app.schemas.subscribe', 'app.schemas.transfer'],
+27 -1
View File
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import Optional, Any
from typing import Optional, Any, Literal
from pydantic import BaseModel, Field, field_validator
@@ -142,6 +142,32 @@ class SystemEnvironmentUpdateData(BaseModel):
failed_updates: dict[str, tuple[Optional[bool], str]] = Field(default_factory=dict)
class SystemUpdateStatus(BaseModel):
"""主程序后台更新的可恢复状态快照。"""
state: Literal[
"idle",
"available",
"downloading",
"ready",
"installing",
"failed",
] = "idle"
current_version: str
version: Optional[str] = None
frontend_version: Optional[str] = None
release_name: Optional[str] = None
release_notes: Optional[str] = None
published_at: Optional[str] = None
checked_at: Optional[str] = None
downloaded_bytes: int = 0
total_bytes: int = 0
progress: int = 0
error: Optional[str] = None
can_update: bool = False
can_install: bool = False
class PluginMarketSyncData(BaseModel):
"""Wiki 插件市场仓库同步结果。"""