All checks were successful
Test / test (push) Successful in 1m45s
- Migrate SQLModel base classes, mixins, and database management to external sqlmodel-ext package; remove sqlmodels/base/, sqlmodels/mixin/, and sqlmodels/database.py - Add file viewer/editor system with WOPI protocol support for collaborative editing (OnlyOffice, Collabora) - Add enterprise edition license verification module (ee/) - Add Dockerfile multi-stage build with Cython compilation support - Add new dependencies: sqlmodel-ext, cryptography, whatthepatch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
72 lines
1.4 KiB
Python
72 lines
1.4 KiB
Python
from enum import StrEnum
|
||
|
||
from sqlmodel_ext import SQLModelBase
|
||
|
||
|
||
class ChromaticColor(StrEnum):
|
||
"""有彩色枚举(17种 Tailwind 调色板颜色)"""
|
||
|
||
RED = "red"
|
||
ORANGE = "orange"
|
||
AMBER = "amber"
|
||
YELLOW = "yellow"
|
||
LIME = "lime"
|
||
GREEN = "green"
|
||
EMERALD = "emerald"
|
||
TEAL = "teal"
|
||
CYAN = "cyan"
|
||
SKY = "sky"
|
||
BLUE = "blue"
|
||
INDIGO = "indigo"
|
||
VIOLET = "violet"
|
||
PURPLE = "purple"
|
||
FUCHSIA = "fuchsia"
|
||
PINK = "pink"
|
||
ROSE = "rose"
|
||
|
||
|
||
class NeutralColor(StrEnum):
|
||
"""无彩色枚举(5种灰色调)"""
|
||
|
||
SLATE = "slate"
|
||
GRAY = "gray"
|
||
ZINC = "zinc"
|
||
NEUTRAL = "neutral"
|
||
STONE = "stone"
|
||
|
||
|
||
class ThemeColorsBase(SQLModelBase):
|
||
"""嵌套颜色 DTO,API 请求/响应层使用"""
|
||
|
||
primary: ChromaticColor
|
||
"""主色调"""
|
||
|
||
secondary: ChromaticColor
|
||
"""辅助色"""
|
||
|
||
success: ChromaticColor
|
||
"""成功色"""
|
||
|
||
info: ChromaticColor
|
||
"""信息色"""
|
||
|
||
warning: ChromaticColor
|
||
"""警告色"""
|
||
|
||
error: ChromaticColor
|
||
"""错误色"""
|
||
|
||
neutral: NeutralColor
|
||
"""中性色"""
|
||
|
||
|
||
BUILTIN_DEFAULT_COLORS = ThemeColorsBase(
|
||
primary=ChromaticColor.GREEN,
|
||
secondary=ChromaticColor.BLUE,
|
||
success=ChromaticColor.GREEN,
|
||
info=ChromaticColor.BLUE,
|
||
warning=ChromaticColor.YELLOW,
|
||
error=ChromaticColor.RED,
|
||
neutral=NeutralColor.ZINC,
|
||
)
|