From e89ff1f729bc7a8b276c496f7ccc8f7a54a39379 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 30 Jan 2024 23:18:53 +0800 Subject: [PATCH] refactor: code improve --- .../plugin-data-source-manager/src/client/schema/index.ts | 5 +++++ .../plugin-data-source-manager/src/locale/zh-CN.json | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/schema/index.ts b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/schema/index.ts index 3f0b5cbf5e..32e41d0a58 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/schema/index.ts +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/schema/index.ts @@ -46,6 +46,11 @@ const collection = { title: `{{t("Status", { ns: "${NAMESPACE}" })}}`, type: 'string', 'x-component': 'Select', + enum: [ + { value: 'loading', label: `{{t("Loading",{ns:"${NAMESPACE}"})}}`, color: 'orange' }, + { value: 'failed', label: `{{t("Failed",{ns:"${NAMESPACE}"})}}`, color: 'red' }, + { value: 'loaded', label: `{{t("Loaded",{ns:"${NAMESPACE}"})}}`, color: 'green' }, + ], } as ISchema, }, { diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/locale/zh-CN.json b/packages/plugins/@nocobase/plugin-data-source-manager/src/locale/zh-CN.json index e277638ba9..7912445558 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/locale/zh-CN.json +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/locale/zh-CN.json @@ -20,5 +20,8 @@ "The following field types are not compatible and do not support output and display": "以下字段类型未适配,不支持输出和显示", "Field database type": "字段数据库类型", "Field interface": "UI类型", - "Status":"状态" + "Status": "状态", + "Loading": "加载中", + "Failed": "加载失败", + "Loaded": "已加载" }