@nocobase/plugin-data-visualization 0.15.0-alpha.3 → 0.15.0-alpha.5
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
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@nocobase/client": "0.15.0-alpha.
|
|
2
|
+
"@nocobase/client": "0.15.0-alpha.5",
|
|
3
3
|
"react": "18.2.0",
|
|
4
4
|
"@formily/react": "2.2.27",
|
|
5
5
|
"@formily/shared": "2.2.27",
|
|
6
|
-
"@nocobase/cache": "0.15.0-alpha.
|
|
7
|
-
"@nocobase/server": "0.15.0-alpha.
|
|
6
|
+
"@nocobase/cache": "0.15.0-alpha.5",
|
|
7
|
+
"@nocobase/server": "0.15.0-alpha.5",
|
|
8
8
|
"@ant-design/icons": "5.1.4",
|
|
9
9
|
"dayjs": "1.11.9",
|
|
10
10
|
"@formily/antd-v5": "1.1.7",
|
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
|
14
14
|
"@emotion/css": "11.11.2",
|
|
15
15
|
"react-i18next": "11.18.6",
|
|
16
16
|
"ahooks": "3.7.8",
|
|
17
|
-
"@nocobase/actions": "0.15.0-alpha.
|
|
18
|
-
"@nocobase/database": "0.15.0-alpha.
|
|
19
|
-
"@nocobase/utils": "0.15.0-alpha.
|
|
17
|
+
"@nocobase/actions": "0.15.0-alpha.5",
|
|
18
|
+
"@nocobase/database": "0.15.0-alpha.5",
|
|
19
|
+
"@nocobase/utils": "0.15.0-alpha.5"
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2023-11-
|
|
1
|
+
{"name":"koa-compose","description":"compose Koa middleware","repository":"koajs/compose","version":"4.1.0","keywords":["koa","middleware","compose"],"files":["index.js"],"dependencies":{},"devDependencies":{"codecov":"^3.0.0","jest":"^21.0.0","matcha":"^0.7.0","standard":"^10.0.3"},"scripts":{"bench":"matcha bench/bench.js","lint":"standard --fix .","test":"jest --forceExit --coverage"},"jest":{"testEnvironment":"node"},"license":"MIT","_lastModified":"2023-11-20T09:31:55.821Z"}
|
|
@@ -28,13 +28,14 @@ const dateFormatFn = (sequelize, dialect, field, format) => {
|
|
|
28
28
|
format = format.replace(/YYYY/g, "%Y").replace(/MM/g, "%m").replace(/DD/g, "%d").replace(/hh/g, "%H").replace(/mm/g, "%M").replace(/ss/g, "%S");
|
|
29
29
|
return sequelize.fn("strftime", format, sequelize.col(field));
|
|
30
30
|
case "mysql":
|
|
31
|
+
case "mariadb":
|
|
31
32
|
format = format.replace(/YYYY/g, "%Y").replace(/MM/g, "%m").replace(/DD/g, "%d").replace(/hh/g, "%H").replace(/mm/g, "%i").replace(/ss/g, "%S");
|
|
32
33
|
return sequelize.fn("date_format", sequelize.col(field), format);
|
|
33
34
|
case "postgres":
|
|
34
35
|
format = format.replace(/hh/g, "HH24").replace(/mm/g, "MI").replace(/ss/g, "SS");
|
|
35
36
|
return sequelize.fn("to_char", sequelize.col(field), format);
|
|
36
37
|
default:
|
|
37
|
-
return field;
|
|
38
|
+
return sequelize.col(field);
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
const formatFn = (sequelize, dialect, field, format) => {
|
|
@@ -261,8 +261,7 @@ const parseVariables = async (ctx, next) => {
|
|
|
261
261
|
};
|
|
262
262
|
const cacheMiddleware = async (ctx, next) => {
|
|
263
263
|
const { uid, cache: cacheConfig, refresh } = ctx.action.params.values;
|
|
264
|
-
const
|
|
265
|
-
const cache = plugin.cache;
|
|
264
|
+
const cache = ctx.app.cacheManager.getCache("data-visualization");
|
|
266
265
|
const useCache = (cacheConfig == null ? void 0 : cacheConfig.enabled) && uid;
|
|
267
266
|
if (useCache && !refresh) {
|
|
268
267
|
const data = await cache.get(uid);
|
|
@@ -273,7 +272,7 @@ const cacheMiddleware = async (ctx, next) => {
|
|
|
273
272
|
}
|
|
274
273
|
await next();
|
|
275
274
|
if (useCache) {
|
|
276
|
-
await cache.set(uid, ctx.body, (cacheConfig == null ? void 0 : cacheConfig.ttl)
|
|
275
|
+
await cache.set(uid, ctx.body, (cacheConfig == null ? void 0 : cacheConfig.ttl) * 1e3);
|
|
277
276
|
}
|
|
278
277
|
};
|
|
279
278
|
const checkPermission = (ctx, next) => {
|
package/dist/server/plugin.js
CHANGED
|
@@ -21,7 +21,6 @@ __export(plugin_exports, {
|
|
|
21
21
|
default: () => plugin_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(plugin_exports);
|
|
24
|
-
var import_cache = require("@nocobase/cache");
|
|
25
24
|
var import_server = require("@nocobase/server");
|
|
26
25
|
var import_query = require("./actions/query");
|
|
27
26
|
var import_path = require("path");
|
|
@@ -46,11 +45,12 @@ class DataVisualizationPlugin extends import_server.Plugin {
|
|
|
46
45
|
plugin: this
|
|
47
46
|
}
|
|
48
47
|
});
|
|
49
|
-
this.cache =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
this.cache = await this.app.cacheManager.createCache({
|
|
49
|
+
name: "data-visualization",
|
|
50
|
+
store: "memory",
|
|
51
|
+
ttl: 30 * 1e3,
|
|
52
|
+
// millseconds
|
|
53
|
+
max: 1e3
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
async install(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-visualization",
|
|
3
|
-
"version": "0.15.0-alpha.
|
|
3
|
+
"version": "0.15.0-alpha.5",
|
|
4
4
|
"displayName": "Data Visualization",
|
|
5
5
|
"displayName.zh-CN": "数据可视化",
|
|
6
6
|
"description": "Provides business intelligence and data visualization features",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"@nocobase/test": "0.x",
|
|
34
34
|
"@nocobase/utils": "0.x"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "4713b1a887dad4dadf27b65e3b3e2a46c6986cbf"
|
|
37
37
|
}
|