mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-04-24 02:32:01 +08:00
feat: 添加事件类型中文名称翻译字典
This commit is contained in:
@@ -17,7 +17,7 @@ from app.db.user_oper import get_current_active_user
|
||||
from app.db.workflow_oper import WorkflowOper
|
||||
from app.helper.workflow import WorkflowHelper
|
||||
from app.scheduler import Scheduler
|
||||
from app.schemas.types import EventType
|
||||
from app.schemas.types import EventType, EVENT_TYPE_NAMES
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@@ -74,7 +74,7 @@ def get_event_types(_: schemas.TokenPayload = Depends(get_current_active_user))
|
||||
获取所有事件类型
|
||||
"""
|
||||
return [{
|
||||
"title": event_type.name,
|
||||
"title": EVENT_TYPE_NAMES.get(event_type, event_type.name),
|
||||
"value": event_type.value
|
||||
} for event_type in EventType]
|
||||
|
||||
|
||||
@@ -69,6 +69,36 @@ class EventType(Enum):
|
||||
WorkflowExecute = "workflow.execute"
|
||||
|
||||
|
||||
# EventType中文名称翻译字典
|
||||
EVENT_TYPE_NAMES = {
|
||||
EventType.PluginReload: "插件重载",
|
||||
EventType.PluginAction: "触发插件动作",
|
||||
EventType.PluginTriggered: "触发插件事件",
|
||||
EventType.CommandExcute: "执行命令",
|
||||
EventType.SiteDeleted: "站点已删除",
|
||||
EventType.SiteUpdated: "站点已更新",
|
||||
EventType.SiteRefreshed: "站点已刷新",
|
||||
EventType.TransferComplete: "整理完成",
|
||||
EventType.DownloadAdded: "添加下载",
|
||||
EventType.HistoryDeleted: "删除历史记录",
|
||||
EventType.DownloadFileDeleted: "删除下载源文件",
|
||||
EventType.DownloadDeleted: "删除下载任务",
|
||||
EventType.UserMessage: "收到用户消息",
|
||||
EventType.WebhookMessage: "收到Webhook消息",
|
||||
EventType.NoticeMessage: "发送消息通知",
|
||||
EventType.SubscribeAdded: "添加订阅",
|
||||
EventType.SubscribeModified: "订阅已调整",
|
||||
EventType.SubscribeDeleted: "订阅已删除",
|
||||
EventType.SubscribeComplete: "订阅已完成",
|
||||
EventType.SystemError: "系统错误",
|
||||
EventType.MetadataScrape: "刮削元数据",
|
||||
EventType.ModuleReload: "模块重载",
|
||||
EventType.ConfigChanged: "配置项更新",
|
||||
EventType.MessageAction: "消息交互动作",
|
||||
EventType.WorkflowExecute: "执行工作流",
|
||||
}
|
||||
|
||||
|
||||
# 同步链式事件
|
||||
class ChainEventType(Enum):
|
||||
# 名称识别
|
||||
|
||||
Reference in New Issue
Block a user