@nocobase/plugin-client 2.2.0-beta.8 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/externalVersion.js +5 -5
- package/dist/locale/en-US.json +12 -0
- package/dist/locale/index.js +4 -1
- package/dist/locale/zh-CN.json +10 -0
- package/dist/node_modules/cronstrue/package.json +1 -1
- package/dist/server/appPortals.d.ts +33 -0
- package/dist/server/appPortals.js +168 -0
- package/dist/server/cron.js +5 -3
- package/dist/server/localeResources.d.ts +12 -0
- package/dist/server/localeResources.js +56 -0
- package/dist/server/server.js +10 -2
- package/package.json +2 -2
package/dist/externalVersion.js
CHANGED
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"react-i18next": "11.18.6",
|
|
13
|
-
"@nocobase/client": "2.2.0
|
|
13
|
+
"@nocobase/client": "2.2.0",
|
|
14
14
|
"antd": "5.24.2",
|
|
15
15
|
"@ant-design/icons": "5.6.1",
|
|
16
16
|
"@formily/react": "2.3.7",
|
|
17
|
-
"@nocobase/utils": "2.2.0
|
|
17
|
+
"@nocobase/utils": "2.2.0",
|
|
18
18
|
"lodash": "4.18.1",
|
|
19
|
-
"@nocobase/database": "2.2.0
|
|
20
|
-
"@nocobase/client-v2": "2.2.0
|
|
21
|
-
"@nocobase/server": "2.2.0
|
|
19
|
+
"@nocobase/database": "2.2.0",
|
|
20
|
+
"@nocobase/client-v2": "2.2.0",
|
|
21
|
+
"@nocobase/server": "2.2.0"
|
|
22
22
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -205,6 +205,7 @@
|
|
|
205
205
|
"Block templates": "Block templates",
|
|
206
206
|
"Block title": "Block title",
|
|
207
207
|
"Menu linkage rules": "Menu linkage rules",
|
|
208
|
+
"Tab linkage rules": "Tab linkage rules",
|
|
208
209
|
"Built-in flow": "Specific flow",
|
|
209
210
|
"Built-in flow step": "Specific flow step",
|
|
210
211
|
"Block type": "Block type",
|
|
@@ -391,6 +392,7 @@
|
|
|
391
392
|
"Data blocks": "Data blocks",
|
|
392
393
|
"Data changes": "Data changes",
|
|
393
394
|
"Data fields": "Data fields",
|
|
395
|
+
"Data loading failed": "Data loading failed",
|
|
394
396
|
"Data loading mode": "Data loading mode",
|
|
395
397
|
"Data model": "Data model",
|
|
396
398
|
"Data model tools": "Data model tools",
|
|
@@ -874,6 +876,7 @@
|
|
|
874
876
|
"Move up": "Move up",
|
|
875
877
|
"Move {{title}} to": "Move {{title}} to",
|
|
876
878
|
"Multiple": "Multiple",
|
|
879
|
+
"Multiple of": "Multiple of",
|
|
877
880
|
"Multiple select": "Multiple select",
|
|
878
881
|
"Multiply by": "Multiply by",
|
|
879
882
|
"Must be 1-50 characters in length (excluding @.<>\"'/)": "Must be 1-50 characters in length (excluding @.<>\"'/)",
|
|
@@ -907,6 +910,7 @@
|
|
|
907
910
|
"No blocks to connect": "No blocks to connect",
|
|
908
911
|
"No camera device detected": "No camera device detected",
|
|
909
912
|
"No configuration available.": "No configuration available.",
|
|
913
|
+
"No configured entries": "No configured entries",
|
|
910
914
|
"No available data currently": "No available data currently",
|
|
911
915
|
"No data": "No data",
|
|
912
916
|
"No event flows": "No event flows",
|
|
@@ -959,6 +963,7 @@
|
|
|
959
963
|
"Open in new window": "Open in new window",
|
|
960
964
|
"Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>": "Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>",
|
|
961
965
|
"Open classic page access": "Open classic page access",
|
|
966
|
+
"Open from the original entry": "Open from the original entry",
|
|
962
967
|
"Open mode": "Open mode",
|
|
963
968
|
"Open mode configuration": "Open mode configuration",
|
|
964
969
|
"Operate on existing data": "Operate on existing data",
|
|
@@ -1258,6 +1263,7 @@
|
|
|
1258
1263
|
"Set block state": "Set block state",
|
|
1259
1264
|
"Set button state": "Set button state",
|
|
1260
1265
|
"Set menu item state": "Set menu item state",
|
|
1266
|
+
"Set tab state": "Set tab state",
|
|
1261
1267
|
"Set condition": "Set condition",
|
|
1262
1268
|
"Set data loading mode": "Set data loading mode",
|
|
1263
1269
|
"Set data scope": "Set data scope",
|
|
@@ -1400,6 +1406,10 @@
|
|
|
1400
1406
|
"The current user only has the UI configuration permission, but don't have \"{{actionName}}\" permission for collection \"{{name}}\"": "The current user only has the UI configuration permission, but don't have \"{{actionName}}\" permission for collection \"{{name}}\"",
|
|
1401
1407
|
"The current user only has the UI configuration permission, but don't have \"{{actionName}}\" permission for field \"{{name}}\"": "The current user only has the UI configuration permission, but don't have \"{{actionName}}\" permission for field \"{{name}}\"",
|
|
1402
1408
|
"The current user only has the UI configuration permission, but don't have view permission for collection \"{{name}}\"": "The current user only has the UI configuration permission, but don't have view permission for collection \"{{name}}\"",
|
|
1409
|
+
"The data source \"{{name}}\" is temporarily unavailable. Please try again later or contact an administrator.": "The data source \"{{name}}\" is temporarily unavailable. Please try again later or contact an administrator.",
|
|
1410
|
+
"The data source \"{{name}}\" used by this block is disabled or unavailable. Enable the data source to display this block.": "The data source \"{{name}}\" used by this block is disabled or unavailable. Enable the data source to display this block.",
|
|
1411
|
+
"The data source is temporarily unavailable. Please try again later or contact an administrator.": "The data source is temporarily unavailable. Please try again later or contact an administrator.",
|
|
1412
|
+
"The data source used by this block is disabled or unavailable. Enable the data source to display this block.": "The data source used by this block is disabled or unavailable. Enable the data source to display this block.",
|
|
1403
1413
|
"The deletion was successful.": "The deletion was successful.",
|
|
1404
1414
|
"The field has been deleted": "The field has been deleted",
|
|
1405
1415
|
"The field value cannot be greater than ": "The field value cannot be greater than ",
|
|
@@ -1411,6 +1421,7 @@
|
|
|
1411
1421
|
"The following field types are not compatible and do not support output and display": "The following field types are not compatible and do not support output and display",
|
|
1412
1422
|
"The selected fields will automatically populate the form": "The selected fields will automatically populate the form",
|
|
1413
1423
|
"The title field is used to identify the template record": "The title field is used to identify the template record",
|
|
1424
|
+
"The {{modernClientPath}} branch only supports new pages. This page is a legacy page. Please open it from the original entry.": "The {{modernClientPath}} branch only supports new pages. This page is a legacy page. Please open it from the original entry.",
|
|
1414
1425
|
"The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string.": "The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string.",
|
|
1415
1426
|
"The will interrupt service, it may take a few seconds to restart. Are you sure to continue?": "The will interrupt service, it may take a few seconds to restart. Are you sure to continue?",
|
|
1416
1427
|
"The {{type}} \"{{name}}\" may have been deleted. Please remove this {{blockType}}.": "The {{type}} \"{{name}}\" may have been deleted. Please remove this {{blockType}}.",
|
|
@@ -1427,6 +1438,7 @@
|
|
|
1427
1438
|
"This field is required": "This field is required",
|
|
1428
1439
|
"This is a demo text, **supports Markdown syntax**.": "This is a demo text, **supports Markdown syntax**.",
|
|
1429
1440
|
"This is likely a NocoBase internals bug. Please open an issue at <1>here</1>": "This is likely a NocoBase internals bug. Please open an issue at <1>here</1>",
|
|
1441
|
+
"This page is not supported in the {{modernClientPath}} branch": "This page is not supported in the {{modernClientPath}} branch",
|
|
1430
1442
|
"This month": "This month",
|
|
1431
1443
|
"This quarter": "This quarter",
|
|
1432
1444
|
"This variable has been deprecated and can be replaced with \"Current form\"": "This variable has been deprecated and can be replaced with \"Current form\"",
|
package/dist/locale/index.js
CHANGED
|
@@ -75,6 +75,7 @@ const dayjsLocale = {
|
|
|
75
75
|
"ml-IN": "ml",
|
|
76
76
|
"mn-MN": "mn",
|
|
77
77
|
"ms-MY": "ms",
|
|
78
|
+
"my-MM": "my",
|
|
78
79
|
"nb-NO": "nb",
|
|
79
80
|
"ne-NP": "ne",
|
|
80
81
|
"nl-BE": "nl-be",
|
|
@@ -144,6 +145,7 @@ const languageCodes = {
|
|
|
144
145
|
"ml-IN": { label: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02" },
|
|
145
146
|
"mn-MN": { label: "\u041C\u043E\u043D\u0433\u043E\u043B \u0445\u044D\u043B" },
|
|
146
147
|
"ms-MY": { label: "\u0628\u0647\u0627\u0633 \u0645\u0644\u0627\u064A\u0648" },
|
|
148
|
+
"my-MM": { label: "\u1019\u103C\u1014\u103A\u1019\u102C\u1018\u102C\u101E\u102C" },
|
|
147
149
|
"nb-NO": { label: "Norsk bokm\xE5l" },
|
|
148
150
|
"ne-NP": { label: "\u0928\u0947\u092A\u093E\u0932\u0940" },
|
|
149
151
|
"nl-BE": { label: "Vlaams" },
|
|
@@ -163,7 +165,8 @@ const languageCodes = {
|
|
|
163
165
|
"tk-TK": { label: "Turkmen" },
|
|
164
166
|
"tr-TR": { label: "T\xFCrk\xE7e" },
|
|
165
167
|
"uk-UA": { label: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430" },
|
|
166
|
-
"ur-PK": { label: "
|
|
168
|
+
"ur-PK": { label: "\u0627\u0631\u062F\u0648" },
|
|
169
|
+
"uz-UZ": { label: "O\u02BBzbekcha" },
|
|
167
170
|
"vi-VN": { label: "Ti\u1EBFng Vi\u1EC7t" },
|
|
168
171
|
"zh-CN": { label: "\u7B80\u4F53\u4E2D\u6587" },
|
|
169
172
|
"zh-HK": { label: "\u7E41\u9AD4\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09" },
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -205,6 +205,7 @@
|
|
|
205
205
|
"Block templates": "区块模板",
|
|
206
206
|
"Block title": "区块标题",
|
|
207
207
|
"Menu linkage rules": "菜单联动规则",
|
|
208
|
+
"Tab linkage rules": "标签页联动规则",
|
|
208
209
|
"Block type": "区块类型",
|
|
209
210
|
"Blocks": "区块",
|
|
210
211
|
"Blue": "拂晓蓝",
|
|
@@ -391,6 +392,7 @@
|
|
|
391
392
|
"Data blocks": "数据区块",
|
|
392
393
|
"Data changes": "数据变更",
|
|
393
394
|
"Data fields": "数据字段",
|
|
395
|
+
"Data loading failed": "数据加载失败",
|
|
394
396
|
"Data loading mode": "数据加载方式",
|
|
395
397
|
"Data model": "数据模型",
|
|
396
398
|
"Data model tools": "数据模型工具",
|
|
@@ -905,6 +907,7 @@
|
|
|
905
907
|
"No blocks to connect": "没有可连接的区块",
|
|
906
908
|
"No camera device detected": "未检测到摄像头设备",
|
|
907
909
|
"No configuration available.": "无可配置项。",
|
|
910
|
+
"No configured entries": "未配置入口",
|
|
908
911
|
"No available data currently": "当前无可用数据",
|
|
909
912
|
"No data": "暂无数据",
|
|
910
913
|
"No event flows": "暂无事件流",
|
|
@@ -957,6 +960,7 @@
|
|
|
957
960
|
"Open in new window": "新窗口打开",
|
|
958
961
|
"Open in<1><0>Modal</0><1>Drawer</1><2>Window</2></1>": "在 <1><0>对话框</0><1>抽屉</1><2>窗口</2></1> 内打开",
|
|
959
962
|
"Open classic page access": "跳转到旧版页面",
|
|
963
|
+
"Open from the original entry": "返回原入口访问",
|
|
960
964
|
"Open mode": "打开方式",
|
|
961
965
|
"Open mode configuration": "打开方式配置",
|
|
962
966
|
"Operate on existing data": "对已有数据操作",
|
|
@@ -1258,6 +1262,7 @@
|
|
|
1258
1262
|
"Set block state": "设置区块状态",
|
|
1259
1263
|
"Set button state": "设置按钮状态",
|
|
1260
1264
|
"Set menu item state": "设置菜单项状态",
|
|
1265
|
+
"Set tab state": "设置标签页状态",
|
|
1261
1266
|
"Set condition": "设置条件",
|
|
1262
1267
|
"Set data loading mode": "设置数据加载方式",
|
|
1263
1268
|
"Set data scope": "设置数据范围",
|
|
@@ -1400,7 +1405,9 @@
|
|
|
1400
1405
|
"The current user only has the UI configuration permission, but don't have \"{{actionName}}\" permission for collection \"{{name}}\"": "当前用户只有 UI 配置权限,但没有数据表 \"{{name}}\"的 \"{{actionName}}\"权限。",
|
|
1401
1406
|
"The current user only has the UI configuration permission, but don't have \"{{actionName}}\" permission for field \"{{name}}\"": "当前用户只有 UI 配置权限,但没有字段 \"{{name}}\"的 \"{{actionName}}\"权限。",
|
|
1402
1407
|
"The current user only has the UI configuration permission, but don't have view permission for collection \"{{name}}\"": "当前用户只有 UI 配置权限,但没有数据表 \"{{name}}\" 查看权限。",
|
|
1408
|
+
"The data source \"{{name}}\" is temporarily unavailable. Please try again later or contact an administrator.": "数据源“{{name}}”暂时不可用,请稍后重试或联系管理员。",
|
|
1403
1409
|
"The data source \"{{name}}\" used by this block is disabled or unavailable. Enable the data source to display this block.": "该区块使用的数据源“{{name}}”已禁用或不可用。启用该数据源后才能显示此区块。",
|
|
1410
|
+
"The data source is temporarily unavailable. Please try again later or contact an administrator.": "数据源暂时不可用,请稍后重试或联系管理员。",
|
|
1404
1411
|
"The data source used by this block is disabled or unavailable. Enable the data source to display this block.": "该区块使用的数据源已禁用或不可用。启用该数据源后才能显示此区块。",
|
|
1405
1412
|
"The deletion was successful.": "删除成功",
|
|
1406
1413
|
"The field has been deleted": "字段已删除",
|
|
@@ -1413,6 +1420,7 @@
|
|
|
1413
1420
|
"The following field types are not compatible and do not support output and display": "以下字段类型未适配,不支持输出和显示",
|
|
1414
1421
|
"The selected fields will automatically populate the form": "用于自动填充到表单",
|
|
1415
1422
|
"The title field is used to identify the template record": "用于识别模板数据",
|
|
1423
|
+
"The {{modernClientPath}} branch only supports new pages. This page is a legacy page. Please open it from the original entry.": "{{modernClientPath}} 分支仅支持新版页面,当前页面属于旧版页面。请返回原入口访问。",
|
|
1416
1424
|
"The value of this variable is derived from the query string of the page URL. This variable can only be used normally when the page has a query string.": "该变量的值是根据页面 URL 的 query string 得来的,只有当页面存在 query string 的时候,该变量才能正常使用。",
|
|
1417
1425
|
"The will interrupt service, it may take a few seconds to restart. Are you sure to continue?": "重启将会中断当前服务,这个过程可能需要一点时间,确定要继续吗?",
|
|
1418
1426
|
"The {{type}} \"{{name}}\" may have been deleted. Please remove this {{blockType}}.": "{{type}} \"{{name}}\" 可能已被删除。请删除当前{{blockType}}.",
|
|
@@ -1429,6 +1437,7 @@
|
|
|
1429
1437
|
"This field is required": "此字段为必填项",
|
|
1430
1438
|
"This is a demo text, **supports Markdown syntax**.": "这是一段演示文本,**支持 Markdown 语法**。",
|
|
1431
1439
|
"This is likely a NocoBase internals bug. Please open an issue at <1>here</1>": "这可能是 NocoBase 内部的问题,你可以在<1>这里</1>将该错误反馈给我们,我们会尽快修复",
|
|
1440
|
+
"This page is not supported in the {{modernClientPath}} branch": "此页面不支持在 {{modernClientPath}} 分支中使用",
|
|
1432
1441
|
"This month": "本月",
|
|
1433
1442
|
"This quarter": "本季度",
|
|
1434
1443
|
"This variable has been deprecated and can be replaced with \"Current form\"": "该变量已被弃用,可以使用“当前表单”替代",
|
|
@@ -1633,6 +1642,7 @@
|
|
|
1633
1642
|
"Enable select action": "启用选择操作",
|
|
1634
1643
|
"Enable remove action": "启用移除操作",
|
|
1635
1644
|
"Multiple": "多选",
|
|
1645
|
+
"Multiple of": "多倍数",
|
|
1636
1646
|
"Custom column width": "自定义列宽度",
|
|
1637
1647
|
"The block is hidden and only visible when the UI Editor is active": "当前区块已被隐藏,仅配置状态下显示",
|
|
1638
1648
|
"The field is hidden and only visible when the UI Editor is active": "当前字段已被隐藏,仅配置状态下显示",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cronstrue","title":"cRonstrue","version":"2.47.0","description":"Convert cron expressions into human readable descriptions","author":"Brady Holt","license":"MIT","bugs":{"url":"https://github.com/bradymholt/cronstrue/issues"},"homepage":"https://github.com/bradymholt/cronstrue","keywords":["cron","cronjob","crontab","schedule","parser","cron expression","cron description","pretty cron","cron for humans","cron translated","cron english","cron schedule","cron english","cron schedule"],"main":"dist/cronstrue.js","bin":{"cronstrue":"bin/cli.js"},"typings":"dist/cronstrue.d.ts","files":["dist/","locales/","i18n.js","i18n.d.ts"],"repository":{"type":"git","url":"git+https://github.com/bradymholt/cronstrue.git"},"publishConfig":{"access":"public"},"prettier":{"printWidth":120},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^8.0.0","chai":"^4.2.0","handlebars":"^4.7.6","marked":"^4.0.10","mocha":"^10.1.0","pixl-xml":"^1.0.13","prettier":"^2.1.1","terser-webpack-plugin":"^5.3.1","ts-loader":"^9.2.6","ts-node":"^10.5.0","typescript":"^4.6.2","webpack":"^5.69.1","webpack-cli":"^4.9.2","xml2js":"^0.5.0"},"scripts":{"start":"npm run build","build":"npx tsc -p ./src --emitDeclarationOnly","test":"npx mocha --reporter spec --require ts-node/register \"./test/**/*.ts\"","prepublishOnly":"rm -rf ./dist && ./node_modules/webpack-cli/bin/cli.js && git add -A"},"dependencies":{},"_lastModified":"2026-
|
|
1
|
+
{"name":"cronstrue","title":"cRonstrue","version":"2.47.0","description":"Convert cron expressions into human readable descriptions","author":"Brady Holt","license":"MIT","bugs":{"url":"https://github.com/bradymholt/cronstrue/issues"},"homepage":"https://github.com/bradymholt/cronstrue","keywords":["cron","cronjob","crontab","schedule","parser","cron expression","cron description","pretty cron","cron for humans","cron translated","cron english","cron schedule","cron english","cron schedule"],"main":"dist/cronstrue.js","bin":{"cronstrue":"bin/cli.js"},"typings":"dist/cronstrue.d.ts","files":["dist/","locales/","i18n.js","i18n.d.ts"],"repository":{"type":"git","url":"git+https://github.com/bradymholt/cronstrue.git"},"publishConfig":{"access":"public"},"prettier":{"printWidth":120},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^8.0.0","chai":"^4.2.0","handlebars":"^4.7.6","marked":"^4.0.10","mocha":"^10.1.0","pixl-xml":"^1.0.13","prettier":"^2.1.1","terser-webpack-plugin":"^5.3.1","ts-loader":"^9.2.6","ts-node":"^10.5.0","typescript":"^4.6.2","webpack":"^5.69.1","webpack-cli":"^4.9.2","xml2js":"^0.5.0"},"scripts":{"start":"npm run build","build":"npx tsc -p ./src --emitDeclarationOnly","test":"npx mocha --reporter spec --require ts-node/register \"./test/**/*.ts\"","prepublishOnly":"rm -rf ./dist && ./node_modules/webpack-cli/bin/cli.js && git add -A"},"dependencies":{},"_lastModified":"2026-08-22T01:43:13.634Z"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { AppStatus } from '@nocobase/server';
|
|
10
|
+
export type AppPortalAppStatus = AppStatus | Record<string, AppStatus> | null;
|
|
11
|
+
export type AppPortalAppItem = {
|
|
12
|
+
name: string;
|
|
13
|
+
title?: string | null;
|
|
14
|
+
icon?: string | null;
|
|
15
|
+
cname?: string | null;
|
|
16
|
+
ssoEnabled?: boolean;
|
|
17
|
+
target?: string;
|
|
18
|
+
status?: AppPortalAppStatus;
|
|
19
|
+
};
|
|
20
|
+
export type AppPortalItem = {
|
|
21
|
+
uid?: string | null;
|
|
22
|
+
appName: string;
|
|
23
|
+
title?: string | null;
|
|
24
|
+
icon?: string | null;
|
|
25
|
+
routePath: string;
|
|
26
|
+
layout?: string | null;
|
|
27
|
+
defaultPortal?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type StoredAppPortalItem = Omit<AppPortalItem, 'appName' | 'defaultPortal'>;
|
|
30
|
+
export declare function listAppPortals(currentAppName?: string | null): Promise<{
|
|
31
|
+
apps: AppPortalAppItem[];
|
|
32
|
+
portals: AppPortalItem[];
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var appPortals_exports = {};
|
|
28
|
+
__export(appPortals_exports, {
|
|
29
|
+
listAppPortals: () => listAppPortals
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(appPortals_exports);
|
|
32
|
+
var import_server = require("@nocobase/server");
|
|
33
|
+
const MAIN_APP_NAME = "main";
|
|
34
|
+
const MULTI_PORTAL_MANIFEST_NAMESPACE = "multi-portal";
|
|
35
|
+
const DEFAULT_PORTALS = [
|
|
36
|
+
{
|
|
37
|
+
uid: "__default_admin__",
|
|
38
|
+
title: "Admin",
|
|
39
|
+
icon: "DesktopOutlined",
|
|
40
|
+
routePath: "/admin",
|
|
41
|
+
layout: "desktop",
|
|
42
|
+
defaultPortal: true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
uid: "__default_mobile__",
|
|
46
|
+
title: "Mobile",
|
|
47
|
+
icon: "MobileOutlined",
|
|
48
|
+
routePath: "/mobile",
|
|
49
|
+
layout: "mobile",
|
|
50
|
+
defaultPortal: true
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
function getCname(cname) {
|
|
54
|
+
const trimmed = cname == null ? void 0 : cname.trim();
|
|
55
|
+
return trimmed || null;
|
|
56
|
+
}
|
|
57
|
+
function getAppName(appModel) {
|
|
58
|
+
return typeof appModel.name === "string" && appModel.name ? appModel.name : null;
|
|
59
|
+
}
|
|
60
|
+
function getAppStatus(appName, statuses) {
|
|
61
|
+
return statuses[appName] ?? null;
|
|
62
|
+
}
|
|
63
|
+
function shouldUseCnameVisitUrl(options) {
|
|
64
|
+
const { cname, ssoEnabled, ssoCnameEnabled } = options;
|
|
65
|
+
return Boolean(cname && (!ssoEnabled || ssoCnameEnabled));
|
|
66
|
+
}
|
|
67
|
+
function toAppPortalAppItem(appModel, appSsoIssuer, target) {
|
|
68
|
+
var _a, _b, _c, _d;
|
|
69
|
+
const name = getAppName(appModel);
|
|
70
|
+
if (!name || name === MAIN_APP_NAME) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const cname = getCname(appModel.cname);
|
|
74
|
+
const ssoEnabled = ((_b = (_a = appModel.options) == null ? void 0 : _a.sso) == null ? void 0 : _b.enabled) === true;
|
|
75
|
+
const ssoCnameEnabled = Boolean(((_d = (_c = appModel.options) == null ? void 0 : _c.sso) == null ? void 0 : _d.issuer) || appSsoIssuer);
|
|
76
|
+
return {
|
|
77
|
+
name,
|
|
78
|
+
title: appModel.title || name,
|
|
79
|
+
icon: appModel.icon || null,
|
|
80
|
+
cname: shouldUseCnameVisitUrl({ cname, ssoEnabled, ssoCnameEnabled }) ? cname : null,
|
|
81
|
+
ssoEnabled,
|
|
82
|
+
target
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function getPortalKey(item) {
|
|
86
|
+
return item.uid ? `${item.appName}:${item.uid}` : `${item.appName}:${item.routePath}`;
|
|
87
|
+
}
|
|
88
|
+
function addPortal(portals, item) {
|
|
89
|
+
if (!item.appName || !item.routePath) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
portals.set(getPortalKey(item), item);
|
|
93
|
+
}
|
|
94
|
+
function addDefaultPortals(portals, appNames) {
|
|
95
|
+
for (const appName of appNames) {
|
|
96
|
+
for (const portal of DEFAULT_PORTALS) {
|
|
97
|
+
addPortal(portals, {
|
|
98
|
+
...portal,
|
|
99
|
+
appName
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function addStoredPortals(portals, appName, storedPortals) {
|
|
105
|
+
if (!Array.isArray(storedPortals)) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
for (const portal of storedPortals) {
|
|
109
|
+
if (!portal || typeof portal.routePath !== "string" || !portal.routePath) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
addPortal(portals, {
|
|
113
|
+
uid: typeof portal.uid === "string" ? portal.uid : null,
|
|
114
|
+
appName,
|
|
115
|
+
title: typeof portal.title === "string" ? portal.title : null,
|
|
116
|
+
icon: typeof portal.icon === "string" ? portal.icon : null,
|
|
117
|
+
routePath: portal.routePath,
|
|
118
|
+
layout: typeof portal.layout === "string" ? portal.layout : null
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
async function listAppPortals(currentAppName) {
|
|
123
|
+
const supervisor = import_server.AppSupervisor.getInstance();
|
|
124
|
+
const appModels = await supervisor.listAppModels();
|
|
125
|
+
const apps = /* @__PURE__ */ new Map();
|
|
126
|
+
const appNames = /* @__PURE__ */ new Set([MAIN_APP_NAME]);
|
|
127
|
+
const target = currentAppName === MAIN_APP_NAME ? "_blank" : void 0;
|
|
128
|
+
const appSsoIssuer = supervisor.getAppSsoIssuer();
|
|
129
|
+
const appItems = appModels.map((appModel) => toAppPortalAppItem(appModel, appSsoIssuer, target));
|
|
130
|
+
if (currentAppName) {
|
|
131
|
+
appNames.add(currentAppName);
|
|
132
|
+
}
|
|
133
|
+
for (const app of appItems) {
|
|
134
|
+
if (!app) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
apps.set(app.name, app);
|
|
138
|
+
appNames.add(app.name);
|
|
139
|
+
}
|
|
140
|
+
if (appNames.size > 1 && !apps.has(MAIN_APP_NAME)) {
|
|
141
|
+
apps.set(MAIN_APP_NAME, {
|
|
142
|
+
name: MAIN_APP_NAME,
|
|
143
|
+
title: "Main",
|
|
144
|
+
icon: null
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const appStatuses = await supervisor.getAppsStatuses(Array.from(appNames));
|
|
148
|
+
for (const app of apps.values()) {
|
|
149
|
+
app.status = getAppStatus(app.name, appStatuses);
|
|
150
|
+
}
|
|
151
|
+
const manifests = await supervisor.getAppManifests(
|
|
152
|
+
MULTI_PORTAL_MANIFEST_NAMESPACE,
|
|
153
|
+
Array.from(appNames)
|
|
154
|
+
);
|
|
155
|
+
const portals = /* @__PURE__ */ new Map();
|
|
156
|
+
addDefaultPortals(portals, appNames);
|
|
157
|
+
for (const appName of appNames) {
|
|
158
|
+
addStoredPortals(portals, appName, manifests[appName]);
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
apps: [...apps.values()],
|
|
162
|
+
portals: [...portals.values()]
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
166
|
+
0 && (module.exports = {
|
|
167
|
+
listAppPortals
|
|
168
|
+
});
|
package/dist/server/cron.js
CHANGED
|
@@ -32,10 +32,12 @@ module.exports = __toCommonJS(cron_exports);
|
|
|
32
32
|
var import_utils = require("@nocobase/utils");
|
|
33
33
|
var import_path = require("path");
|
|
34
34
|
const getCronLocale = (lang) => {
|
|
35
|
-
const
|
|
36
|
-
const files =
|
|
35
|
+
const candidates = Array.from(/* @__PURE__ */ new Set([lang, lang.replace("-", "_")]));
|
|
36
|
+
const files = candidates.map((candidate) => (0, import_path.resolve)(__dirname, `./../locale/cron/${candidate}`));
|
|
37
37
|
if (process.env.APP_ENV !== "production") {
|
|
38
|
-
|
|
38
|
+
for (const candidate of candidates) {
|
|
39
|
+
files.push(`@nocobase/client/src/locale/cron/${candidate}`, `@nocobase/client/lib/locale/cron/${candidate}`);
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
for (const file of files) {
|
|
41
43
|
try {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseLocaleResourceNamespaces(value: unknown): string[];
|
|
10
|
+
export declare function filterLocaleResources<T extends {
|
|
11
|
+
resources?: Record<string, unknown>;
|
|
12
|
+
}>(payload: T, namespaceQuery: unknown): T;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var localeResources_exports = {};
|
|
28
|
+
__export(localeResources_exports, {
|
|
29
|
+
filterLocaleResources: () => filterLocaleResources,
|
|
30
|
+
parseLocaleResourceNamespaces: () => parseLocaleResourceNamespaces
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(localeResources_exports);
|
|
33
|
+
function parseLocaleResourceNamespaces(value) {
|
|
34
|
+
const values = Array.isArray(value) ? value : [value];
|
|
35
|
+
return [
|
|
36
|
+
...new Set(
|
|
37
|
+
values.flatMap((item) => typeof item === "string" ? item.split(",") : []).map((item) => item.trim()).filter(Boolean)
|
|
38
|
+
)
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
function filterLocaleResources(payload, namespaceQuery) {
|
|
42
|
+
const namespaces = parseLocaleResourceNamespaces(namespaceQuery);
|
|
43
|
+
if (!namespaces.length) return payload;
|
|
44
|
+
const resources = payload.resources || {};
|
|
45
|
+
return {
|
|
46
|
+
...payload,
|
|
47
|
+
resources: Object.fromEntries(
|
|
48
|
+
namespaces.filter((namespace) => Object.prototype.hasOwnProperty.call(resources, namespace)).map((namespace) => [namespace, resources[namespace]])
|
|
49
|
+
)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
filterLocaleResources,
|
|
55
|
+
parseLocaleResourceNamespaces
|
|
56
|
+
});
|
package/dist/server/server.js
CHANGED
|
@@ -45,9 +45,11 @@ var import_utils = require("@nocobase/utils");
|
|
|
45
45
|
var import_lodash = __toESM(require("lodash"));
|
|
46
46
|
var process = __toESM(require("node:process"));
|
|
47
47
|
var import_path = require("path");
|
|
48
|
+
var import_appPortals = require("./appPortals");
|
|
48
49
|
var import_antd = require("./antd");
|
|
49
50
|
var import_cron = require("./cron");
|
|
50
51
|
var import_cronstrue = require("./cronstrue");
|
|
52
|
+
var import_localeResources = require("./localeResources");
|
|
51
53
|
async function getLang(ctx) {
|
|
52
54
|
const SystemSetting = ctx.db.getRepository("systemSettings");
|
|
53
55
|
const systemSetting = await SystemSetting.findOne();
|
|
@@ -80,6 +82,7 @@ class PluginClientServer extends import_server.Plugin {
|
|
|
80
82
|
});
|
|
81
83
|
this.app.acl.allow("app", "getLang");
|
|
82
84
|
this.app.acl.allow("app", "getInfo");
|
|
85
|
+
this.app.acl.allow("app", "getPortals", "loggedIn");
|
|
83
86
|
this.app.acl.registerSnippet({
|
|
84
87
|
name: "app",
|
|
85
88
|
actions: ["app:restart", "app:refresh", "app:clearCache", "app:publishEvent"]
|
|
@@ -121,13 +124,18 @@ class PluginClientServer extends import_server.Plugin {
|
|
|
121
124
|
},
|
|
122
125
|
async getLang(ctx, next) {
|
|
123
126
|
const lang = await getLang(ctx);
|
|
124
|
-
const resources = await ctx.app.localeManager.get(lang);
|
|
127
|
+
const resources = (0, import_localeResources.filterLocaleResources)(await ctx.app.localeManager.get(lang), ctx.request.query.ns);
|
|
125
128
|
ctx.body = {
|
|
126
129
|
lang,
|
|
127
130
|
...resources
|
|
128
131
|
};
|
|
129
132
|
await next();
|
|
130
133
|
},
|
|
134
|
+
getPortals: async (ctx, next) => {
|
|
135
|
+
var _a;
|
|
136
|
+
ctx.body = await (0, import_appPortals.listAppPortals)((_a = ctx.app) == null ? void 0 : _a.name);
|
|
137
|
+
await next();
|
|
138
|
+
},
|
|
131
139
|
async clearCache(ctx, next) {
|
|
132
140
|
await ctx.cache.reset();
|
|
133
141
|
await next();
|
|
@@ -153,7 +161,7 @@ class PluginClientServer extends import_server.Plugin {
|
|
|
153
161
|
}
|
|
154
162
|
const { id, username } = ((_c = ctx.auth) == null ? void 0 : _c.user) ?? {};
|
|
155
163
|
const user = id ? { id, username } : void 0;
|
|
156
|
-
const eventName = `${command}
|
|
164
|
+
const eventName = `${command.replaceAll(":", ".")}.${plugin}`;
|
|
157
165
|
try {
|
|
158
166
|
await ctx.app.eventQueue.publish(eventName, {
|
|
159
167
|
plugin,
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Provides a client interface for the NocoBase server",
|
|
7
7
|
"description.ru-RU": "Предоставляет клиентский интерфейс для сервера NocoBase",
|
|
8
8
|
"description.zh-CN": "为 NocoBase 服务端提供客户端界面",
|
|
9
|
-
"version": "2.2.0
|
|
9
|
+
"version": "2.2.0",
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"devDependencies": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@nocobase/test": "2.x",
|
|
24
24
|
"@nocobase/utils": "2.x"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "d5052cae37177054c236f1bf7bba3aed6ef029d0"
|
|
27
27
|
}
|