品牌化设置 + Claude米色衬线体主题 + 全站中文
- 品牌设置API: GET/PUT /api/settings/brand (名称/标语/Logo) - 管理页系统设置: 品牌编辑器表单(名称/标语/Logo URL) - 恢复Anthropic风格: 米色(#FBF9F6) 底色, Source Serif 4 + Noto Serif SC 衬线体 - 暖棕(#C2693A) 主色调, 更充裕的间距与留白, 庄重大气 - 全站中文: antd zhCN locale, 所有页面文本汉化 - 数据存储在 Config singleton, 运行时更新
This commit is contained in:
1 parent
409e5d314e
commit
efde5597bd
16 files changed
+403
-672
No files matched your search
@@ -38,6 +38,10 @@ class Settings(BaseSettings):
|
||||
multicast_address_base: str = "239.0.0.1"
|
||||
multicast_port_base: int = 5000
|
||||
|
||||
brand_name: str = "StreamCore"
|
||||
brand_tagline: str = "Enterprise Streaming Platform"
|
||||
brand_logo_url: str = ""
|
||||
|
||||
model_config = {"env_prefix": "LS_"}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import httpx
|
||||
from database import init_db
|
||||
from services.transcoder import transcode_mgr
|
||||
from routes import streams_router, nodes_router, auth_router
|
||||
from routes.settings_route import router as settings_router
|
||||
from config import settings
|
||||
|
||||
|
||||
@@ -32,6 +33,7 @@ app.add_middleware(
|
||||
app.include_router(streams_router)
|
||||
app.include_router(nodes_router)
|
||||
app.include_router(auth_router)
|
||||
app.include_router(settings_router)
|
||||
|
||||
|
||||
@app.get("/api/health")
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from config import settings
|
||||
from routes.auth import require_auth
|
||||
|
||||
router = APIRouter(prefix="/api/settings", tags=["settings"])
|
||||
|
||||
|
||||
class BrandUpdate(BaseModel):
|
||||
brand_name: Optional[str] = None
|
||||
brand_tagline: Optional[str] = None
|
||||
brand_logo_url: Optional[str] = None
|
||||
|
||||
|
||||
@router.get("/brand")
|
||||
async def get_brand():
|
||||
return {
|
||||
"brand_name": settings.brand_name,
|
||||
"brand_tagline": settings.brand_tagline,
|
||||
"brand_logo_url": settings.brand_logo_url,
|
||||
}
|
||||
|
||||
|
||||
@router.put("/brand")
|
||||
async def update_brand(body: BrandUpdate, _: bool = Depends(require_auth)):
|
||||
if body.brand_name is not None:
|
||||
settings.brand_name = body.brand_name
|
||||
if body.brand_tagline is not None:
|
||||
settings.brand_tagline = body.brand_tagline
|
||||
if body.brand_logo_url is not None:
|
||||
settings.brand_logo_url = body.brand_logo_url
|
||||
return {"ok": True}
|
||||
Reference in new issue
Block a user