@nocobase/plugin-client 0.12.0-alpha.4 → 0.13.0-alpha.1
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/locale/zh_CN.d.ts +3 -1
- package/dist/locale/zh_CN.js +3 -1
- package/dist/server/server.js +5 -35
- package/dist/swagger/index.js +19 -0
- package/package.json +2 -2
package/dist/locale/zh_CN.d.ts
CHANGED
|
@@ -244,6 +244,7 @@ declare const _default: {
|
|
|
244
244
|
"Long text": string;
|
|
245
245
|
Phone: string;
|
|
246
246
|
Email: string;
|
|
247
|
+
Username: string;
|
|
247
248
|
Null: string;
|
|
248
249
|
Boolean: string;
|
|
249
250
|
Number: string;
|
|
@@ -460,6 +461,7 @@ declare const _default: {
|
|
|
460
461
|
"Verification code": string;
|
|
461
462
|
"Send code": string;
|
|
462
463
|
"Retry after {{count}} seconds": string;
|
|
464
|
+
'2 to 16 characters (excluding @.<>"\'/)': string;
|
|
463
465
|
Roles: string;
|
|
464
466
|
"Add role": string;
|
|
465
467
|
"Role name": string;
|
|
@@ -733,7 +735,7 @@ declare const _default: {
|
|
|
733
735
|
'Reload application': string;
|
|
734
736
|
'The application is reloading, please do not close the page.': string;
|
|
735
737
|
'Application reloading': string;
|
|
736
|
-
'
|
|
738
|
+
'Restart application': string;
|
|
737
739
|
"Allows to clear cache, reboot application": string;
|
|
738
740
|
'The will interrupt service, it may take a few seconds to restart. Are you sure to continue?': string;
|
|
739
741
|
Reboot: string;
|
package/dist/locale/zh_CN.js
CHANGED
|
@@ -250,6 +250,7 @@ var _default = {
|
|
|
250
250
|
"Long text": "多行文本",
|
|
251
251
|
"Phone": "手机号码",
|
|
252
252
|
"Email": "电子邮箱",
|
|
253
|
+
"Username": "用户名",
|
|
253
254
|
'Null': '空值',
|
|
254
255
|
"Boolean": "逻辑值",
|
|
255
256
|
"Number": "数字",
|
|
@@ -466,6 +467,7 @@ var _default = {
|
|
|
466
467
|
"Verification code": "验证码",
|
|
467
468
|
"Send code": "发送验证码",
|
|
468
469
|
"Retry after {{count}} seconds": "{{count}} 秒后重试",
|
|
470
|
+
'2 to 16 characters (excluding @.<>"\'/)': '2到16个字符(不包含@.<>"\'/)',
|
|
469
471
|
"Roles": "角色",
|
|
470
472
|
"Add role": "添加角色",
|
|
471
473
|
"Role name": "角色名称",
|
|
@@ -740,7 +742,7 @@ var _default = {
|
|
|
740
742
|
'Reload application': '重载应用',
|
|
741
743
|
'The application is reloading, please do not close the page.': '应用正在重新加载,请勿关闭页面。',
|
|
742
744
|
'Application reloading': '应用重新加载中',
|
|
743
|
-
'
|
|
745
|
+
'Restart application': '重启应用',
|
|
744
746
|
"Allows to clear cache, reboot application": "允许清除缓存,重启应用",
|
|
745
747
|
'The will interrupt service, it may take a few seconds to restart. Are you sure to continue?': '重启将会中断当前服务,这个过程可能需要一点时间,确定要继续吗?',
|
|
746
748
|
'Reboot': '重启',
|
package/dist/server/server.js
CHANGED
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var server = require('@nocobase/server');
|
|
6
6
|
var fs = require('fs');
|
|
7
|
-
var send = require('koa-send');
|
|
8
|
-
var serve = require('koa-static');
|
|
9
7
|
var path = require('path');
|
|
10
8
|
var antd = require('./antd');
|
|
11
9
|
var cron = require('./cron');
|
|
@@ -14,8 +12,6 @@ var cronstrue = require('./cronstrue');
|
|
|
14
12
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
13
|
|
|
16
14
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
17
|
-
var send__default = /*#__PURE__*/_interopDefault(send);
|
|
18
|
-
var serve__default = /*#__PURE__*/_interopDefault(serve);
|
|
19
15
|
|
|
20
16
|
async function getReadMe(name, locale) {
|
|
21
17
|
const packageName = server.PluginManager.getPackageName(name);
|
|
@@ -116,7 +112,7 @@ class ClientPlugin extends server.Plugin {
|
|
|
116
112
|
this.app.acl.allow("plugins", "*", "public");
|
|
117
113
|
this.app.acl.registerSnippet({
|
|
118
114
|
name: "app",
|
|
119
|
-
actions: ["app:
|
|
115
|
+
actions: ["app:restart", "app:clearCache"]
|
|
120
116
|
});
|
|
121
117
|
const dialect = this.app.db.sequelize.getDialect();
|
|
122
118
|
const restartMark = path.resolve(process.cwd(), "storage", "restart");
|
|
@@ -144,6 +140,7 @@ class ClientPlugin extends server.Plugin {
|
|
|
144
140
|
},
|
|
145
141
|
version: await ctx.app.version.get(),
|
|
146
142
|
lang,
|
|
143
|
+
name: ctx.app.name,
|
|
147
144
|
theme: ((_a = currentUser == null ? void 0 : currentUser.systemSettings) == null ? void 0 : _a.theme) || ((_b = systemSetting == null ? void 0 : systemSetting.options) == null ? void 0 : _b.theme) || "default"
|
|
148
145
|
};
|
|
149
146
|
await next();
|
|
@@ -183,18 +180,9 @@ class ClientPlugin extends server.Plugin {
|
|
|
183
180
|
await ctx.cache.reset();
|
|
184
181
|
await next();
|
|
185
182
|
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
if (code === RESTART_CODE && process.env.APP_ENV === "production") {
|
|
190
|
-
fs__default.default.writeFileSync(restartMark, "1");
|
|
191
|
-
console.log("Restart mark created.");
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
ctx.app.on("afterStop", () => {
|
|
195
|
-
process.exit(RESTART_CODE);
|
|
196
|
-
});
|
|
197
|
-
ctx.app.stop();
|
|
183
|
+
async restart(ctx, next) {
|
|
184
|
+
ctx.app.runAsCLI(["restart"], { from: "user" });
|
|
185
|
+
await next();
|
|
198
186
|
}
|
|
199
187
|
}
|
|
200
188
|
});
|
|
@@ -230,24 +218,6 @@ class ClientPlugin extends server.Plugin {
|
|
|
230
218
|
}
|
|
231
219
|
}
|
|
232
220
|
});
|
|
233
|
-
let root = this.options.dist || `${process.env.APP_PACKAGE_ROOT}/dist/client`;
|
|
234
|
-
if (!path.isAbsolute(root)) {
|
|
235
|
-
root = path.resolve(process.cwd(), root);
|
|
236
|
-
}
|
|
237
|
-
if (process.env.APP_ENV !== "production" && root) {
|
|
238
|
-
this.app.use(
|
|
239
|
-
async (ctx, next) => {
|
|
240
|
-
if (ctx.path.startsWith(this.app.resourcer.options.prefix)) {
|
|
241
|
-
return next();
|
|
242
|
-
}
|
|
243
|
-
await serve__default.default(root)(ctx, next);
|
|
244
|
-
if (ctx.status == 404) {
|
|
245
|
-
return send__default.default(ctx, "index.html", { root });
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
{ tag: "clientStatic", before: "cors" }
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
221
|
}
|
|
252
222
|
}
|
|
253
223
|
var server_default = ClientPlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var openapi = "3.0.2";
|
|
6
|
+
var info = {
|
|
7
|
+
title: "NocoBase API - Client plugin"
|
|
8
|
+
};
|
|
9
|
+
var paths = {};
|
|
10
|
+
var swagger_default = {
|
|
11
|
+
openapi,
|
|
12
|
+
info,
|
|
13
|
+
paths
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.default = swagger_default;
|
|
17
|
+
exports.info = info;
|
|
18
|
+
exports.openapi = openapi;
|
|
19
|
+
exports.paths = paths;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "WEB 客户端",
|
|
5
5
|
"description": "",
|
|
6
6
|
"description.zh-CN": "",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.13.0-alpha.1",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"license": "AGPL-3.0",
|
|
10
10
|
"devDependencies": {
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"@nocobase/test": "0.x",
|
|
21
21
|
"@nocobase/utils": "0.x"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "0ebd4e85a1b0b0d0943768ab6cb5c3d824562239"
|
|
24
24
|
}
|