diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 6888159d6..b2f5697b6 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -148,7 +148,8 @@ "DownloadApplication": "Download Application" }, "ConnectError": { - "ConnectFailed": "Connection failed" + "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." }, "Update": { "FoundNewVersion": "New version available", diff --git a/i18n/locales/zh.json b/i18n/locales/zh.json index 84922c2f0..d93225537 100644 --- a/i18n/locales/zh.json +++ b/i18n/locales/zh.json @@ -152,7 +152,8 @@ "DownloadApplication": "下载应用" }, "ConnectError": { - "ConnectFailed": "连接失败" + "ConnectFailed": "连接失败", + "AclFailed": "当前资产受到 ACL 访问限制,无法通过客户端连接,请前往 Web 端进行访问" }, "Update": { "FoundNewVersion": "发现新版本", diff --git a/ui/composables/useAssetAction.ts b/ui/composables/useAssetAction.ts index 6c283d0bd..ac325d6ba 100644 --- a/ui/composables/useAssetAction.ts +++ b/ui/composables/useAssetAction.ts @@ -408,6 +408,16 @@ export const useAssetAction = () => { const payload = event.payload as eventPayload; const errorData = JSON.parse(payload.data); + const errorCode = errorData?.code as string; + + if (errorCode.includes('acl')) { + return toast.add({ + title: t("ConnectError.ConnectFailed"), + description: t("ConnectError.AclFailed"), + color: "error", + icon: "line-md:close-circle" + }); + } toast.add({ title: t("ConnectError.ConnectFailed"),