From f7c5a3750a29f6abbd97efb9b645b19ec7910d88 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Fri, 25 Apr 2025 09:18:56 +0800 Subject: [PATCH] update --- packages/frontend/src/views/DashboardView.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/views/DashboardView.vue b/packages/frontend/src/views/DashboardView.vue index ec6f429..ebed3c6 100644 --- a/packages/frontend/src/views/DashboardView.vue +++ b/packages/frontend/src/views/DashboardView.vue @@ -117,6 +117,15 @@ const getActionTranslation = (actionType: string): string => { return translated === key ? actionType : translated; }; +// 辅助函数:判断活动类型是否表示失败 +const isFailedAction = (actionType: string): boolean => { + const lowerCaseAction = actionType.toLowerCase(); + // 检查常见的失败关键词 + return lowerCaseAction.includes('fail') || lowerCaseAction.includes('error') || lowerCaseAction.includes('denied'); + // 或者,如果 action_type 本身不包含明确的失败词,但翻译后包含,可以这样判断: + // const translatedAction = getActionTranslation(actionType); + // return translatedAction.includes('失败') || translatedAction.toLowerCase().includes('fail'); +};