mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-26 14:23:48 +00:00
This commit removes the deprecated frontend/web-old directory, updates various project configuration files including tsconfig, vite config, environment variables, and backend data models. It also fixes several API paths, adds tenant awareness to multiple models, and makes minor UI adjustments.
36 lines
1.4 KiB
Python
36 lines
1.4 KiB
Python
import enum
|
|
|
|
from sqlalchemy import String, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.core.base_model import ModelMixin, TenantMixin
|
|
|
|
|
|
class JobStatusEnum(enum.Enum):
|
|
"""执行状态枚举"""
|
|
|
|
PENDING = "pending"
|
|
RUNNING = "running"
|
|
SUCCESS = "success"
|
|
FAILED = "failed"
|
|
TIMEOUT = "timeout"
|
|
CANCELLED = "cancelled"
|
|
|
|
|
|
class JobModel(ModelMixin, TenantMixin):
|
|
"""
|
|
任务执行日志表
|
|
"""
|
|
|
|
__tablename__: str = "task_job"
|
|
__table_args__: dict[str, str] = {"comment": "任务执行日志表"}
|
|
|
|
job_id: Mapped[str] = mapped_column(String(64), nullable=False, index=True, comment="任务ID")
|
|
job_name: Mapped[str | None] = mapped_column(String(128), nullable=True, comment="任务名称")
|
|
trigger_type: Mapped[str | None] = mapped_column(String(32), nullable=True, comment="触发方式: cron/interval/date/manual")
|
|
status: Mapped[str] = mapped_column(String(16), nullable=False, default=JobStatusEnum.PENDING.value, comment="执行状态")
|
|
next_run_time: Mapped[str | None] = mapped_column(String(64), nullable=True, comment="下次执行时间")
|
|
job_state: Mapped[str | None] = mapped_column(Text, nullable=True, comment="任务状态信息")
|
|
result: Mapped[str | None] = mapped_column(Text, nullable=True, comment="执行结果")
|
|
error: Mapped[str | None] = mapped_column(Text, nullable=True, comment="错误信息")
|