Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,14 @@
},
"ConnectError": {
"ConnectFailed": "Connection failed",
"AclFailed": "The current asset is restricted by ACL policies and cannot be accessed via the client. Please use the Web console to connect."
"AclFailed": "The current asset is restricted by ACL policies and cannot be accessed via the client. Please use the Web console to connect.",
"ClientNotFound": "Desktop client not found. Please install or configure the client path.",
"ClientLaunchFailed": "Failed to launch desktop client. Please check installation or permissions.",
"ClientExited": "Desktop client exited unexpectedly.",
"RdpAppMissing": "No RDP application configured or found. Please set the executable path in Settings.",
"VncAppMissing": "No VNC application configured or found. Please set the executable path in Settings.",
"RdpAppFailed": "Failed to start the RDP application.",
"VncAppFailed": "Failed to start the VNC application."
},
"Update": {
"FoundNewVersion": "New version available",
Expand Down
9 changes: 8 additions & 1 deletion i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@
},
"ConnectError": {
"ConnectFailed": "连接失败",
"AclFailed": "当前资产受到 ACL 访问限制,无法通过客户端连接,请前往 Web 端进行访问"
"AclFailed": "当前资产受到 ACL 访问限制,无法通过客户端连接,请前往 Web 端进行访问",
"ClientNotFound": "未找到桌面客户端,请安装或在设置中配置路径",
"ClientLaunchFailed": "启动桌面客户端失败,请检查安装或权限",
"ClientExited": "桌面客户端异常退出",
"RdpAppMissing": "未配置或未找到 RDP 客户端,请在设置中选择路径",
"VncAppMissing": "未配置或未找到 VNC 客户端,请在设置中选择路径",
"RdpAppFailed": "启动 RDP 客户端失败",
"VncAppFailed": "启动 VNC 客户端失败"
},
"Update": {
"FoundNewVersion": "发现新版本",
Expand Down
23 changes: 21 additions & 2 deletions ui/composables/useAssetAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,30 @@ export const useAssetAction = () => {
}

const payload = event.payload as eventPayload;
const errorMessage = payload.error || t("ConnectError.ConnectFailed");
const raw = payload.error || "";
const lower = raw.toLowerCase();

let description = raw || t("ConnectError.ConnectFailed");

if (lower.includes("executable not found")) {
description = t("ConnectError.ClientNotFound");
} else if (lower.includes("failed to launch client")) {
description = t("ConnectError.ClientLaunchFailed");
} else if (lower.includes("client process exited")) {
description = t("ConnectError.ClientExited");
} else if (lower.includes("no rdp application")) {
description = t("ConnectError.RdpAppMissing");
} else if (lower.includes("no vnc application")) {
description = t("ConnectError.VncAppMissing");
} else if (lower.includes("failed to execute rdp application")) {
description = t("ConnectError.RdpAppFailed");
} else if (lower.includes("failed to execute vnc application")) {
description = t("ConnectError.VncAppFailed");
}

toast.add({
title: t("ConnectError.ConnectFailed"),
description: errorMessage,
description,
color: "error",
icon: "line-md:close-circle"
});
Expand Down