@tachybase/plugin-log-viewer 1.5.1 → 1.6.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/externalVersion.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.
|
|
4
|
-
"@ant-design/icons": "
|
|
5
|
-
"@tego/client": "1.
|
|
3
|
+
"@tachybase/client": "1.6.1",
|
|
4
|
+
"@ant-design/icons": "6.1.0",
|
|
5
|
+
"@tego/client": "1.6.0-alpha.9",
|
|
6
6
|
"ahooks": "3.9.0",
|
|
7
7
|
"antd": "5.22.5",
|
|
8
|
-
"@tego/server": "1.
|
|
8
|
+
"@tego/server": "1.6.0-alpha.9",
|
|
9
9
|
"react-i18next": "16.2.1"
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"tar-fs","version":"3.1.0","description":"filesystem bindings for tar-stream","dependencies":{"pump":"^3.0.0","tar-stream":"^3.1.5"},"optionalDependencies":{"bare-fs":"^4.0.1","bare-path":"^3.0.0"},"imports":{"fs":{"bare":"bare-fs","default":"fs"},"path":{"bare":"bare-path","default":"path"}},"files":["index.js"],"standard":{"ignore":["test/fixtures/**"]},"keywords":["tar","fs","file","tarball","directory","stream"],"devDependencies":{"brittle":"^3.1.3","rimraf":"^2.6.3","standard":"^17.0.1"},"scripts":{"test":"standard && brittle test/index.js"},"bugs":{"url":"https://github.com/mafintosh/tar-fs/issues"},"homepage":"https://github.com/mafintosh/tar-fs","main":"index.js","directories":{"test":"test"},"author":"Mathias Buus","license":"MIT","repository":{"type":"git","url":"https://github.com/mafintosh/tar-fs.git"},"_lastModified":"2025-
|
|
1
|
+
{"name":"tar-fs","version":"3.1.0","description":"filesystem bindings for tar-stream","dependencies":{"pump":"^3.0.0","tar-stream":"^3.1.5"},"optionalDependencies":{"bare-fs":"^4.0.1","bare-path":"^3.0.0"},"imports":{"fs":{"bare":"bare-fs","default":"fs"},"path":{"bare":"bare-path","default":"path"}},"files":["index.js"],"standard":{"ignore":["test/fixtures/**"]},"keywords":["tar","fs","file","tarball","directory","stream"],"devDependencies":{"brittle":"^3.1.3","rimraf":"^2.6.3","standard":"^17.0.1"},"scripts":{"test":"standard && brittle test/index.js"},"bugs":{"url":"https://github.com/mafintosh/tar-fs/issues"},"homepage":"https://github.com/mafintosh/tar-fs","main":"index.js","directories":{"test":"test"},"author":"Mathias Buus","license":"MIT","repository":{"type":"git","url":"https://github.com/mafintosh/tar-fs.git"},"_lastModified":"2025-12-05T07:15:26.258Z"}
|
|
File without changes
|
package/dist/server/plugin.js
CHANGED
|
@@ -39,7 +39,7 @@ class PluginLogViewerServer extends import_server.Plugin {
|
|
|
39
39
|
beforeLoad() {
|
|
40
40
|
}
|
|
41
41
|
async load() {
|
|
42
|
-
this.app.
|
|
42
|
+
this.app.resourcer.define(import_logger.default);
|
|
43
43
|
this.app.acl.registerSnippet({
|
|
44
44
|
name: "pm.system-services.log-viewer",
|
|
45
45
|
actions: ["logger:*"]
|
|
@@ -60,7 +60,7 @@ var logger_default = {
|
|
|
60
60
|
name: "logger",
|
|
61
61
|
actions: {
|
|
62
62
|
list: async (ctx, next) => {
|
|
63
|
-
const appName = ctx.
|
|
63
|
+
const appName = ctx.tego.name;
|
|
64
64
|
if (!appName) {
|
|
65
65
|
ctx.throw(400, ctx.t("App not found"));
|
|
66
66
|
}
|
|
@@ -93,7 +93,7 @@ var logger_default = {
|
|
|
93
93
|
}
|
|
94
94
|
return fileTree;
|
|
95
95
|
} catch (err) {
|
|
96
|
-
ctx.
|
|
96
|
+
ctx.logger.error("readDir error", { err, path: path2 });
|
|
97
97
|
return [];
|
|
98
98
|
}
|
|
99
99
|
};
|
|
@@ -102,7 +102,7 @@ var logger_default = {
|
|
|
102
102
|
await next();
|
|
103
103
|
},
|
|
104
104
|
download: async (ctx, next) => {
|
|
105
|
-
const appName = ctx.
|
|
105
|
+
const appName = ctx.tego.name;
|
|
106
106
|
if (!appName) {
|
|
107
107
|
ctx.throw(400, ctx.t("App not found"));
|
|
108
108
|
}
|
|
@@ -124,13 +124,13 @@ var logger_default = {
|
|
|
124
124
|
ctx.attachment("logs.tar.gz");
|
|
125
125
|
ctx.body = await tarFiles(files);
|
|
126
126
|
} catch (err) {
|
|
127
|
-
ctx.
|
|
127
|
+
ctx.logger.error(`download error: ${err.message}`, { files, err: err.stack });
|
|
128
128
|
ctx.throw(500, ctx.t("Download logs failed."));
|
|
129
129
|
}
|
|
130
130
|
await next();
|
|
131
131
|
},
|
|
132
132
|
preview: async (ctx, next) => {
|
|
133
|
-
const appName = ctx.
|
|
133
|
+
const appName = ctx.tego.name;
|
|
134
134
|
if (!appName) {
|
|
135
135
|
ctx.throw(400, ctx.t("App not found"));
|
|
136
136
|
}
|
|
@@ -148,7 +148,7 @@ var logger_default = {
|
|
|
148
148
|
const path = (0, import_server.getLoggerFilePath)();
|
|
149
149
|
ctx.body = await (0, import_promises.readFile)((0, import_node_path.join)(path, file), { encoding: "utf8" });
|
|
150
150
|
} catch (err) {
|
|
151
|
-
ctx.
|
|
151
|
+
ctx.logger.error(`preview error: ${err.message}`, { file, err: err.stack });
|
|
152
152
|
ctx.throw(500, ctx.t("Preview logs failed."));
|
|
153
153
|
}
|
|
154
154
|
await next();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-log-viewer",
|
|
3
3
|
"displayName": "Logger",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.1",
|
|
5
5
|
"description": "Server-side logs, mainly including API request logs and system runtime logs, and allows to package and download log files.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Logging and monitoring"
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "^
|
|
14
|
-
"@tachybase/test": "1.
|
|
15
|
-
"@tego/client": "1.
|
|
16
|
-
"@tego/server": "1.
|
|
13
|
+
"@ant-design/icons": "^6.1.0",
|
|
14
|
+
"@tachybase/test": "1.6.0-alpha.9",
|
|
15
|
+
"@tego/client": "1.6.0-alpha.9",
|
|
16
|
+
"@tego/server": "1.6.0-alpha.9",
|
|
17
17
|
"@types/tar-fs": "^2.0.4",
|
|
18
18
|
"ahooks": "^3.9.0",
|
|
19
19
|
"antd": "5.22.5",
|
|
20
20
|
"react-i18next": "16.2.1",
|
|
21
21
|
"tar-fs": "^3.1.0",
|
|
22
|
-
"@tachybase/client": "1.
|
|
22
|
+
"@tachybase/client": "1.6.1"
|
|
23
23
|
},
|
|
24
24
|
"description.zh-CN": "服务端日志,主要包括接口请求日志和系统运行日志,并支持打包和下载日志文件。",
|
|
25
25
|
"displayName.zh-CN": "日志",
|