@pisell/core 0.0.2
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/README.md +1 -0
- package/es/app/app.d.ts +101 -0
- package/es/app/app.js +177 -0
- package/es/app/const.d.ts +4 -0
- package/es/app/const.js +6 -0
- package/es/app/index.d.ts +14 -0
- package/es/app/index.js +52 -0
- package/es/applicationManager/application.d.ts +197 -0
- package/es/applicationManager/application.js +469 -0
- package/es/applicationManager/index.d.ts +19 -0
- package/es/applicationManager/index.js +206 -0
- package/es/aws/index.d.ts +16 -0
- package/es/aws/index.js +76 -0
- package/es/cmd/const.d.ts +11 -0
- package/es/cmd/const.js +13 -0
- package/es/cmd/index.d.ts +13 -0
- package/es/cmd/index.js +91 -0
- package/es/cmd/type.d.ts +5 -0
- package/es/cmd/type.js +1 -0
- package/es/communicationManager/index.d.ts +59 -0
- package/es/communicationManager/index.js +174 -0
- package/es/config.d.ts +3 -0
- package/es/config.js +14 -0
- package/es/cookie/index.d.ts +13 -0
- package/es/cookie/index.js +47 -0
- package/es/css/global.less +73 -0
- package/es/css/index.less +31 -0
- package/es/css/variables.css +84 -0
- package/es/data/index.d.ts +8 -0
- package/es/data/index.js +16 -0
- package/es/history/config.d.ts +24 -0
- package/es/history/config.js +43 -0
- package/es/history/index.d.ts +26 -0
- package/es/history/index.js +80 -0
- package/es/history/type.d.ts +2 -0
- package/es/history/type.js +1 -0
- package/es/hooks/index.d.ts +12 -0
- package/es/hooks/index.js +13 -0
- package/es/hooks/useDelayedValue/index.d.ts +2 -0
- package/es/hooks/useDelayedValue/index.js +26 -0
- package/es/hooks/useDispatch/index.d.ts +2 -0
- package/es/hooks/useDispatch/index.js +2 -0
- package/es/hooks/useLowCode/index.d.ts +13 -0
- package/es/hooks/useLowCode/index.js +74 -0
- package/es/hooks/useStore/index.d.ts +6 -0
- package/es/hooks/useStore/index.js +11 -0
- package/es/index.d.ts +8 -0
- package/es/index.js +10 -0
- package/es/indexDB/index.d.ts +296 -0
- package/es/indexDB/index.js +1619 -0
- package/es/locales/en.d.ts +3 -0
- package/es/locales/en.js +5 -0
- package/es/locales/index.d.ts +39 -0
- package/es/locales/index.js +199 -0
- package/es/locales/original.d.ts +3 -0
- package/es/locales/original.js +7 -0
- package/es/locales/type.d.ts +19 -0
- package/es/locales/type.js +1 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +5 -0
- package/es/locales/zh-HK.d.ts +3 -0
- package/es/locales/zh-HK.js +5 -0
- package/es/logger/feishu.d.ts +11 -0
- package/es/logger/feishu.js +50 -0
- package/es/logger/index.d.ts +135 -0
- package/es/logger/index.js +870 -0
- package/es/menuManager/hooks.d.ts +17 -0
- package/es/menuManager/hooks.js +136 -0
- package/es/menuManager/index.d.ts +28 -0
- package/es/menuManager/index.js +165 -0
- package/es/models/global.d.ts +32 -0
- package/es/models/global.js +66 -0
- package/es/models/index.d.ts +45 -0
- package/es/models/index.js +65 -0
- package/es/models/type.d.ts +2 -0
- package/es/models/type.js +1 -0
- package/es/plugin/index.d.ts +0 -0
- package/es/plugin/index.js +0 -0
- package/es/pubsub/example.d.ts +5 -0
- package/es/pubsub/example.js +92 -0
- package/es/pubsub/index.d.ts +73 -0
- package/es/pubsub/index.js +166 -0
- package/es/render/index.d.ts +0 -0
- package/es/render/index.js +0 -0
- package/es/request/cache.d.ts +46 -0
- package/es/request/cache.js +372 -0
- package/es/request/cancelToken.d.ts +38 -0
- package/es/request/cancelToken.js +59 -0
- package/es/request/config.d.ts +3 -0
- package/es/request/config.js +63 -0
- package/es/request/constants.d.ts +2 -0
- package/es/request/constants.js +6 -0
- package/es/request/index.d.ts +24 -0
- package/es/request/index.js +267 -0
- package/es/request/pisell2Request.d.ts +6 -0
- package/es/request/pisell2Request.js +62 -0
- package/es/request/type.d.ts +57 -0
- package/es/request/type.js +10 -0
- package/es/request/utils.d.ts +46 -0
- package/es/request/utils.js +147 -0
- package/es/routes/config.d.ts +7 -0
- package/es/routes/config.js +17 -0
- package/es/routes/index.d.ts +28 -0
- package/es/routes/index.js +151 -0
- package/es/socket/components/SocketMonitorPage.d.ts +6 -0
- package/es/socket/components/SocketMonitorPage.js +485 -0
- package/es/socket/components/index.d.ts +2 -0
- package/es/socket/components/index.js +2 -0
- package/es/socket/constants.d.ts +33 -0
- package/es/socket/constants.js +39 -0
- package/es/socket/events.d.ts +31 -0
- package/es/socket/events.js +19 -0
- package/es/socket/heartbeat.d.ts +66 -0
- package/es/socket/heartbeat.js +184 -0
- package/es/socket/index.d.ts +61 -0
- package/es/socket/index.js +246 -0
- package/es/socket/monitor.d.ts +169 -0
- package/es/socket/monitor.js +448 -0
- package/es/socket/reconnect.d.ts +61 -0
- package/es/socket/reconnect.js +199 -0
- package/es/socket/socket.d.ts +130 -0
- package/es/socket/socket.js +613 -0
- package/es/socket/types.d.ts +85 -0
- package/es/socket/types.js +35 -0
- package/es/storage/index.d.ts +17 -0
- package/es/storage/index.js +46 -0
- package/es/tasks/index.d.ts +127 -0
- package/es/tasks/index.js +1119 -0
- package/es/tasks/scheduledTasksExample.d.ts +61 -0
- package/es/tasks/scheduledTasksExample.js +351 -0
- package/es/tasks/type.d.ts +100 -0
- package/es/tasks/type.js +1 -0
- package/es/tasks/useTasks.d.ts +5 -0
- package/es/tasks/useTasks.js +25 -0
- package/es/type.d.ts +2 -0
- package/es/type.js +1 -0
- package/es/utils/adaptiveThrottle/index.d.ts +36 -0
- package/es/utils/adaptiveThrottle/index.js +136 -0
- package/es/variables/VariablesProvider.d.ts +7 -0
- package/es/variables/VariablesProvider.js +12 -0
- package/es/variables/config.d.ts +3 -0
- package/es/variables/config.js +16 -0
- package/es/variables/index.d.ts +6 -0
- package/es/variables/index.js +5 -0
- package/es/variables/type.d.ts +2 -0
- package/es/variables/type.js +1 -0
- package/es/website/index.d.ts +6 -0
- package/es/website/index.js +65 -0
- package/lib/app/app.d.ts +101 -0
- package/lib/app/app.js +171 -0
- package/lib/app/const.d.ts +4 -0
- package/lib/app/const.js +33 -0
- package/lib/app/index.d.ts +14 -0
- package/lib/app/index.js +76 -0
- package/lib/applicationManager/application.d.ts +197 -0
- package/lib/applicationManager/application.js +280 -0
- package/lib/applicationManager/index.d.ts +19 -0
- package/lib/applicationManager/index.js +88 -0
- package/lib/aws/index.d.ts +16 -0
- package/lib/aws/index.js +67 -0
- package/lib/cmd/const.d.ts +11 -0
- package/lib/cmd/const.js +39 -0
- package/lib/cmd/index.d.ts +13 -0
- package/lib/cmd/index.js +96 -0
- package/lib/cmd/type.d.ts +5 -0
- package/lib/cmd/type.js +17 -0
- package/lib/communicationManager/index.d.ts +59 -0
- package/lib/communicationManager/index.js +102 -0
- package/lib/config.d.ts +3 -0
- package/lib/config.js +36 -0
- package/lib/cookie/index.d.ts +13 -0
- package/lib/cookie/index.js +62 -0
- package/lib/css/global.less +73 -0
- package/lib/css/index.less +31 -0
- package/lib/css/variables.css +84 -0
- package/lib/data/index.d.ts +8 -0
- package/lib/data/index.js +38 -0
- package/lib/history/config.d.ts +24 -0
- package/lib/history/config.js +41 -0
- package/lib/history/index.d.ts +26 -0
- package/lib/history/index.js +99 -0
- package/lib/history/type.d.ts +2 -0
- package/lib/history/type.js +17 -0
- package/lib/hooks/index.d.ts +12 -0
- package/lib/hooks/index.js +44 -0
- package/lib/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/hooks/useDelayedValue/index.js +36 -0
- package/lib/hooks/useDispatch/index.d.ts +2 -0
- package/lib/hooks/useDispatch/index.js +26 -0
- package/lib/hooks/useLowCode/index.d.ts +13 -0
- package/lib/hooks/useLowCode/index.js +75 -0
- package/lib/hooks/useStore/index.d.ts +6 -0
- package/lib/hooks/useStore/index.js +33 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +58 -0
- package/lib/indexDB/index.d.ts +296 -0
- package/lib/indexDB/index.js +767 -0
- package/lib/locales/en.d.ts +3 -0
- package/lib/locales/en.js +29 -0
- package/lib/locales/index.d.ts +39 -0
- package/lib/locales/index.js +159 -0
- package/lib/locales/original.d.ts +3 -0
- package/lib/locales/original.js +31 -0
- package/lib/locales/type.d.ts +19 -0
- package/lib/locales/type.js +17 -0
- package/lib/locales/zh-CN.d.ts +3 -0
- package/lib/locales/zh-CN.js +29 -0
- package/lib/locales/zh-HK.d.ts +3 -0
- package/lib/locales/zh-HK.js +29 -0
- package/lib/logger/feishu.d.ts +11 -0
- package/lib/logger/feishu.js +52 -0
- package/lib/logger/index.d.ts +135 -0
- package/lib/logger/index.js +476 -0
- package/lib/menuManager/hooks.d.ts +17 -0
- package/lib/menuManager/hooks.js +135 -0
- package/lib/menuManager/index.d.ts +28 -0
- package/lib/menuManager/index.js +125 -0
- package/lib/models/global.d.ts +32 -0
- package/lib/models/global.js +62 -0
- package/lib/models/index.d.ts +45 -0
- package/lib/models/index.js +69 -0
- package/lib/models/type.d.ts +2 -0
- package/lib/models/type.js +17 -0
- package/lib/plugin/index.d.ts +0 -0
- package/lib/plugin/index.js +0 -0
- package/lib/pubsub/example.d.ts +5 -0
- package/lib/pubsub/example.js +61 -0
- package/lib/pubsub/index.d.ts +73 -0
- package/lib/pubsub/index.js +141 -0
- package/lib/render/index.d.ts +0 -0
- package/lib/render/index.js +0 -0
- package/lib/request/cache.d.ts +46 -0
- package/lib/request/cache.js +195 -0
- package/lib/request/cancelToken.d.ts +38 -0
- package/lib/request/cancelToken.js +59 -0
- package/lib/request/config.d.ts +3 -0
- package/lib/request/config.js +69 -0
- package/lib/request/constants.d.ts +2 -0
- package/lib/request/constants.js +34 -0
- package/lib/request/index.d.ts +24 -0
- package/lib/request/index.js +210 -0
- package/lib/request/pisell2Request.d.ts +6 -0
- package/lib/request/pisell2Request.js +75 -0
- package/lib/request/type.d.ts +57 -0
- package/lib/request/type.js +36 -0
- package/lib/request/utils.d.ts +46 -0
- package/lib/request/utils.js +113 -0
- package/lib/routes/config.d.ts +7 -0
- package/lib/routes/config.js +50 -0
- package/lib/routes/index.d.ts +28 -0
- package/lib/routes/index.js +121 -0
- package/lib/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/socket/components/SocketMonitorPage.js +340 -0
- package/lib/socket/components/index.d.ts +2 -0
- package/lib/socket/components/index.js +39 -0
- package/lib/socket/constants.d.ts +33 -0
- package/lib/socket/constants.js +62 -0
- package/lib/socket/events.d.ts +31 -0
- package/lib/socket/events.js +44 -0
- package/lib/socket/heartbeat.d.ts +66 -0
- package/lib/socket/heartbeat.js +157 -0
- package/lib/socket/index.d.ts +61 -0
- package/lib/socket/index.js +198 -0
- package/lib/socket/monitor.d.ts +169 -0
- package/lib/socket/monitor.js +350 -0
- package/lib/socket/reconnect.d.ts +61 -0
- package/lib/socket/reconnect.js +157 -0
- package/lib/socket/socket.d.ts +130 -0
- package/lib/socket/socket.js +426 -0
- package/lib/socket/types.d.ts +85 -0
- package/lib/socket/types.js +36 -0
- package/lib/storage/index.d.ts +17 -0
- package/lib/storage/index.js +64 -0
- package/lib/tasks/index.d.ts +127 -0
- package/lib/tasks/index.js +710 -0
- package/lib/tasks/scheduledTasksExample.d.ts +61 -0
- package/lib/tasks/scheduledTasksExample.js +267 -0
- package/lib/tasks/type.d.ts +100 -0
- package/lib/tasks/type.js +17 -0
- package/lib/tasks/useTasks.d.ts +5 -0
- package/lib/tasks/useTasks.js +37 -0
- package/lib/type.d.ts +2 -0
- package/lib/type.js +17 -0
- package/lib/utils/adaptiveThrottle/index.d.ts +36 -0
- package/lib/utils/adaptiveThrottle/index.js +121 -0
- package/lib/variables/VariablesProvider.d.ts +7 -0
- package/lib/variables/VariablesProvider.js +51 -0
- package/lib/variables/config.d.ts +3 -0
- package/lib/variables/config.js +38 -0
- package/lib/variables/index.d.ts +6 -0
- package/lib/variables/index.js +29 -0
- package/lib/variables/type.d.ts +2 -0
- package/lib/variables/type.js +17 -0
- package/lib/website/index.d.ts +6 -0
- package/lib/website/index.js +75 -0
- package/package.json +49 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/logger/index.ts
|
|
30
|
+
var logger_exports = {};
|
|
31
|
+
__export(logger_exports, {
|
|
32
|
+
default: () => logger_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(logger_exports);
|
|
35
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
36
|
+
var import_feishu = require("./feishu");
|
|
37
|
+
var LoggerManager = class {
|
|
38
|
+
// 私有属性
|
|
39
|
+
logBuffer = [];
|
|
40
|
+
// 日志缓冲区
|
|
41
|
+
timer = null;
|
|
42
|
+
// 定时器
|
|
43
|
+
checkInterval;
|
|
44
|
+
// 检查间隔时间(毫秒)
|
|
45
|
+
prefix = "app";
|
|
46
|
+
// 日志文件前缀
|
|
47
|
+
metadata;
|
|
48
|
+
db = null;
|
|
49
|
+
// IndexDB 实例
|
|
50
|
+
app;
|
|
51
|
+
feishuConfig;
|
|
52
|
+
retentionDays;
|
|
53
|
+
// 日志保留天数
|
|
54
|
+
metadataFunction;
|
|
55
|
+
status = "running";
|
|
56
|
+
// 日志管理器状态
|
|
57
|
+
/**
|
|
58
|
+
* 构造函数
|
|
59
|
+
* @param prefix 日志前缀
|
|
60
|
+
* @param checkInterval 检查间隔时间,默认5分钟
|
|
61
|
+
*/
|
|
62
|
+
constructor(app, options) {
|
|
63
|
+
this.prefix = (options == null ? void 0 : options.prefix) || "app";
|
|
64
|
+
this.checkInterval = (options == null ? void 0 : options.checkInterval) || 5 * 60 * 1e3;
|
|
65
|
+
this.app = app;
|
|
66
|
+
this.feishuConfig = options == null ? void 0 : options.feishuConfig;
|
|
67
|
+
this.retentionDays = (options == null ? void 0 : options.retentionDays) || 7;
|
|
68
|
+
this.initDB();
|
|
69
|
+
}
|
|
70
|
+
async init() {
|
|
71
|
+
this.setStatus("running");
|
|
72
|
+
this.initTimer();
|
|
73
|
+
this.cleanupOldLogs();
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 初始化 IndexDB
|
|
77
|
+
*/
|
|
78
|
+
async initDB() {
|
|
79
|
+
if (this.app.dbManager) {
|
|
80
|
+
this.db = this.app.dbManager;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 设置元数据
|
|
85
|
+
* @param metadata 元数据
|
|
86
|
+
*/
|
|
87
|
+
setMetadata(metadata) {
|
|
88
|
+
this.metadata = metadata;
|
|
89
|
+
}
|
|
90
|
+
setMetadataFunction(metadataFunction) {
|
|
91
|
+
this.metadataFunction = metadataFunction;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 初始化定时器
|
|
95
|
+
*/
|
|
96
|
+
initTimer() {
|
|
97
|
+
this.timer = setInterval(() => {
|
|
98
|
+
if (this.logBuffer.length > 0) {
|
|
99
|
+
this.storeLog();
|
|
100
|
+
}
|
|
101
|
+
}, this.checkInterval);
|
|
102
|
+
}
|
|
103
|
+
setStatus(status) {
|
|
104
|
+
this.status = status;
|
|
105
|
+
}
|
|
106
|
+
stop() {
|
|
107
|
+
this.setStatus("stop");
|
|
108
|
+
if (this.timer) {
|
|
109
|
+
clearInterval(this.timer);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 添加日志
|
|
114
|
+
* @param log 日志项
|
|
115
|
+
*/
|
|
116
|
+
addLog(log) {
|
|
117
|
+
if (this.status === "stop") {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const { feishu, ...restLog } = log || {};
|
|
121
|
+
const logItem = {
|
|
122
|
+
...restLog,
|
|
123
|
+
date: log.date || (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss"),
|
|
124
|
+
metadata: JSON.stringify(log.metadata || {}),
|
|
125
|
+
// 以时间戳生成logId
|
|
126
|
+
logId: (0, import_dayjs.default)().valueOf()
|
|
127
|
+
};
|
|
128
|
+
console.log("---- 行为日志", logItem);
|
|
129
|
+
this.logBuffer.push(logItem);
|
|
130
|
+
if (log.type === "error" || log.type === "warning") {
|
|
131
|
+
this.sendFeishuNotification({ ...logItem || {}, feishu });
|
|
132
|
+
this.storeLog(log.type === "error");
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* 发送飞书通知
|
|
137
|
+
* @param log 日志项
|
|
138
|
+
*/
|
|
139
|
+
sendFeishuNotification(log) {
|
|
140
|
+
var _a;
|
|
141
|
+
if (this.feishuConfig) {
|
|
142
|
+
const _metadata = ((_a = this.metadataFunction) == null ? void 0 : _a.call(this)) || {};
|
|
143
|
+
const content = [
|
|
144
|
+
{ key: "日志类型", value: log.type },
|
|
145
|
+
{ key: "日志时间", value: log.date || (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss") },
|
|
146
|
+
{ key: "日志来源", value: JSON.stringify({ ...this.metadata || {}, ..._metadata }) }
|
|
147
|
+
];
|
|
148
|
+
if (log.feishu) {
|
|
149
|
+
content.push({ key: "日志内容", value: JSON.stringify(log.feishu || {}) });
|
|
150
|
+
} else {
|
|
151
|
+
content.push({ key: "日志内容", value: JSON.stringify(log.metadata || {}) });
|
|
152
|
+
}
|
|
153
|
+
(0, import_feishu.sendWarningLog)({
|
|
154
|
+
title: log.title,
|
|
155
|
+
content,
|
|
156
|
+
webhook: this.feishuConfig.webhook
|
|
157
|
+
});
|
|
158
|
+
console.log("-------- 发送飞书通知", log);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* 创建日志文件名
|
|
163
|
+
* @returns 日志文件名
|
|
164
|
+
*/
|
|
165
|
+
createFileName(date) {
|
|
166
|
+
const _date = date || (0, import_dayjs.default)().format("YYYY-MM-DD-HH");
|
|
167
|
+
const fileName = `${this.prefix}_${_date}.log`;
|
|
168
|
+
return fileName;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* 创建AWS日志文件名
|
|
172
|
+
* @param isManual 紧急上传
|
|
173
|
+
* @returns 日志文件名
|
|
174
|
+
*/
|
|
175
|
+
async createAWSFileName(urgent) {
|
|
176
|
+
var _a, _b, _c, _d;
|
|
177
|
+
const _date = (0, import_dayjs.default)().format("YYYY-MM-DD");
|
|
178
|
+
let _hour = (0, import_dayjs.default)().format("HH:mm");
|
|
179
|
+
if (urgent) {
|
|
180
|
+
_hour = `${(0, import_dayjs.default)().format("HH:mm")} [ urgent ] ${(0, import_dayjs.default)().valueOf()}`;
|
|
181
|
+
}
|
|
182
|
+
if ((_b = (_a = this.app) == null ? void 0 : _a.getPlugin("aws")) == null ? void 0 : _b.createFileName) {
|
|
183
|
+
return (_d = (_c = this.app) == null ? void 0 : _c.getPlugin("aws")) == null ? void 0 : _d.createFileName({
|
|
184
|
+
date: _date,
|
|
185
|
+
hour: _hour,
|
|
186
|
+
isManual: false
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
let fileName = `logs/${"pisell"}/${_date}/${_hour}`;
|
|
190
|
+
return `${fileName}.json`;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* 创建日志文件
|
|
194
|
+
* @param _fileName 文件名
|
|
195
|
+
* @returns 日志文件对象
|
|
196
|
+
*/
|
|
197
|
+
createFile(_fileName) {
|
|
198
|
+
const _date = (0, import_dayjs.default)().format("YYYY-MM-DD-HH");
|
|
199
|
+
const fileName = _fileName || this.createFileName(_date);
|
|
200
|
+
return {
|
|
201
|
+
fileName,
|
|
202
|
+
date: _date,
|
|
203
|
+
fileContent: {
|
|
204
|
+
metadata: this.metadata,
|
|
205
|
+
logs: []
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 存储日志到持久化存储
|
|
211
|
+
*/
|
|
212
|
+
async storeLog(urgent) {
|
|
213
|
+
var _a;
|
|
214
|
+
if (this.logBuffer.length === 0 || !this.db) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
const fileName = await this.createAWSFileName(urgent);
|
|
219
|
+
console.log("-------- 存储日志到AWS 开始", fileName);
|
|
220
|
+
const buffer = (_a = this.logBuffer) == null ? void 0 : _a.map((item) => {
|
|
221
|
+
return {
|
|
222
|
+
...item || {},
|
|
223
|
+
metadata: JSON.parse(item.metadata || "{}")
|
|
224
|
+
};
|
|
225
|
+
});
|
|
226
|
+
const bufferIds = buffer.map((item) => item.logId);
|
|
227
|
+
const logs = JSON.stringify(buffer, null, 2);
|
|
228
|
+
await this.app.aws.upload({ Bucket: "", Key: fileName, Body: logs });
|
|
229
|
+
this.addLog({
|
|
230
|
+
type: "info",
|
|
231
|
+
title: "存储日志到AWS 成功",
|
|
232
|
+
metadata: {
|
|
233
|
+
fileName,
|
|
234
|
+
"本地上传的ids": bufferIds,
|
|
235
|
+
"实例下的ids": this.logBuffer.map((item) => item.logId)
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
console.log("-------- 存储日志到AWS 成功");
|
|
239
|
+
this.logBuffer = this.logBuffer.filter((item) => !bufferIds.includes(item.logId));
|
|
240
|
+
} catch (error) {
|
|
241
|
+
console.error("存储日志上传AWS失败:", error);
|
|
242
|
+
this.addLog({
|
|
243
|
+
type: "info",
|
|
244
|
+
title: "存储日志到AWS失败",
|
|
245
|
+
metadata: {
|
|
246
|
+
error: {
|
|
247
|
+
name: error == null ? void 0 : error.name,
|
|
248
|
+
message: error == null ? void 0 : error.message,
|
|
249
|
+
stack: error == null ? void 0 : error.stack
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
try {
|
|
254
|
+
await this.storeLogToIndexDB();
|
|
255
|
+
} catch (indexDBError) {
|
|
256
|
+
this.sendFeishuNotification({
|
|
257
|
+
type: "error",
|
|
258
|
+
title: "将日志存储到IndexDB失败",
|
|
259
|
+
metadata: {
|
|
260
|
+
indexDBError: {
|
|
261
|
+
name: indexDBError == null ? void 0 : indexDBError.name,
|
|
262
|
+
message: indexDBError == null ? void 0 : indexDBError.message,
|
|
263
|
+
stack: indexDBError == null ? void 0 : indexDBError.stack
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
console.error("存储日志到IndexDB也失败:", indexDBError);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
async uploadIndexDBLog() {
|
|
272
|
+
var _a, _b;
|
|
273
|
+
try {
|
|
274
|
+
this.addLog({
|
|
275
|
+
type: "info",
|
|
276
|
+
title: "准备将IndexDB中的日志上传到AWS"
|
|
277
|
+
});
|
|
278
|
+
if (!this.db) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
let logFile = await ((_a = this.db) == null ? void 0 : _a.getAll("logs"));
|
|
282
|
+
if (!logFile || (logFile == null ? void 0 : logFile.length) === 0) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
const awsFileName = await this.createAWSFileName(true);
|
|
286
|
+
const logs = JSON.stringify(logFile, null, 2);
|
|
287
|
+
await this.app.aws.upload({ Bucket: "", Key: awsFileName, Body: logs });
|
|
288
|
+
console.log("-------- 存储日志到AWS 成功");
|
|
289
|
+
await ((_b = this.db) == null ? void 0 : _b.clear("logs"));
|
|
290
|
+
console.log("-------- 清空IndexDB日志成功");
|
|
291
|
+
} catch (error) {
|
|
292
|
+
console.log("-------- 存储日志到IndexDB 失败", error);
|
|
293
|
+
this.addLog({
|
|
294
|
+
type: "info",
|
|
295
|
+
title: "存储IndexDB日志到AWS失败",
|
|
296
|
+
metadata: {
|
|
297
|
+
error: {
|
|
298
|
+
name: error == null ? void 0 : error.name,
|
|
299
|
+
message: error == null ? void 0 : error.message,
|
|
300
|
+
stack: error == null ? void 0 : error.stack
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
throw error;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
async storeLogToIndexDB() {
|
|
308
|
+
var _a, _b, _c;
|
|
309
|
+
try {
|
|
310
|
+
const fileName = this.createFileName();
|
|
311
|
+
console.log("storeLog", fileName);
|
|
312
|
+
const buffer = this.logBuffer || [];
|
|
313
|
+
let logFile = await ((_a = this.db) == null ? void 0 : _a.get("logs", fileName));
|
|
314
|
+
if (!logFile) {
|
|
315
|
+
logFile = this.createFile(fileName);
|
|
316
|
+
await ((_b = this.db) == null ? void 0 : _b.add("logs", logFile));
|
|
317
|
+
}
|
|
318
|
+
logFile.fileContent.logs = [...logFile.fileContent.logs, ...buffer];
|
|
319
|
+
await ((_c = this.db) == null ? void 0 : _c.update("logs", logFile));
|
|
320
|
+
console.log("-------- 存储日志到IndexDB", { fileName, logFile });
|
|
321
|
+
const bufferIds = buffer.map((item) => item.logId);
|
|
322
|
+
this.logBuffer = this.logBuffer.filter((item) => !bufferIds.includes(item.logId));
|
|
323
|
+
} catch (error) {
|
|
324
|
+
console.log("-------- 存储日志到IndexDB 失败", error);
|
|
325
|
+
throw error;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* 清理旧日志,只保留最近指定天数的日志
|
|
330
|
+
*/
|
|
331
|
+
async cleanupOldLogs() {
|
|
332
|
+
if (!this.db) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
try {
|
|
336
|
+
this.addLog({
|
|
337
|
+
type: "info",
|
|
338
|
+
title: "准备清理旧日志,开始获取所有日志文件"
|
|
339
|
+
});
|
|
340
|
+
const logFiles = await this.getLogFiles();
|
|
341
|
+
this.addLog({
|
|
342
|
+
type: "info",
|
|
343
|
+
title: "获取旧日志成功",
|
|
344
|
+
metadata: {
|
|
345
|
+
logFilesCount: logFiles == null ? void 0 : logFiles.length
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
const cutoffDate = (0, import_dayjs.default)().subtract(this.retentionDays, "day").format("YYYY-MM-DD");
|
|
349
|
+
const filesToDelete = (logFiles || []).filter((file) => file.date < cutoffDate);
|
|
350
|
+
console.log(`-------- 清理旧日志,保留 ${this.retentionDays} 天内的日志,截止日期: ${cutoffDate}`);
|
|
351
|
+
for (const file of filesToDelete) {
|
|
352
|
+
await this.db.delete("logs", file.fileName);
|
|
353
|
+
console.log(`-------- 删除旧日志文件: ${file.fileName}, 日期: ${file.date}`);
|
|
354
|
+
}
|
|
355
|
+
if (filesToDelete.length > 0) {
|
|
356
|
+
console.log(`-------- 共清理 ${filesToDelete.length} 个旧日志文件`);
|
|
357
|
+
}
|
|
358
|
+
this.addLog({
|
|
359
|
+
type: "info",
|
|
360
|
+
title: "清理旧日志成功",
|
|
361
|
+
metadata: {
|
|
362
|
+
filesToDelete
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
this.uploadIndexDBLog();
|
|
366
|
+
} catch (error) {
|
|
367
|
+
this.addLog({
|
|
368
|
+
type: "error",
|
|
369
|
+
title: "清理旧日志失败!",
|
|
370
|
+
metadata: {
|
|
371
|
+
error: {
|
|
372
|
+
name: error == null ? void 0 : error.name,
|
|
373
|
+
message: error == null ? void 0 : error.message,
|
|
374
|
+
stack: error == null ? void 0 : error.stack
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
console.error("清理旧日志失败:", error);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* 获取日志文件列表
|
|
383
|
+
* @returns 日志文件列表
|
|
384
|
+
*/
|
|
385
|
+
async getLogFiles() {
|
|
386
|
+
if (!this.db) {
|
|
387
|
+
return [];
|
|
388
|
+
}
|
|
389
|
+
try {
|
|
390
|
+
return await this.db.getAll("logs");
|
|
391
|
+
} catch (error) {
|
|
392
|
+
this.addLog({
|
|
393
|
+
type: "error",
|
|
394
|
+
title: "获取本地日志文件列表失败"
|
|
395
|
+
});
|
|
396
|
+
console.error("获取日志文件列表失败:", error);
|
|
397
|
+
return [];
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* 获取指定日志文件的内容
|
|
402
|
+
* @param fileName 日志文件名
|
|
403
|
+
* @returns 日志文件内容
|
|
404
|
+
*/
|
|
405
|
+
async getLogFile(fileName) {
|
|
406
|
+
if (!this.db) {
|
|
407
|
+
return null;
|
|
408
|
+
}
|
|
409
|
+
try {
|
|
410
|
+
return await this.db.get("logs", fileName);
|
|
411
|
+
} catch (error) {
|
|
412
|
+
console.error("获取日志文件内容失败:", error);
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* 清空指定日志文件
|
|
418
|
+
* @param fileName 日志文件名,不指定则清空所有日志
|
|
419
|
+
* @returns 是否成功
|
|
420
|
+
*/
|
|
421
|
+
async clearLogs(fileName) {
|
|
422
|
+
if (!this.db) {
|
|
423
|
+
return false;
|
|
424
|
+
}
|
|
425
|
+
try {
|
|
426
|
+
if (fileName) {
|
|
427
|
+
await this.db.delete("logs", fileName);
|
|
428
|
+
} else {
|
|
429
|
+
await this.db.clear("logs");
|
|
430
|
+
}
|
|
431
|
+
return true;
|
|
432
|
+
} catch (error) {
|
|
433
|
+
console.error("清空日志失败:", error);
|
|
434
|
+
return false;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* 设置日志保留天数
|
|
439
|
+
* @param days 保留天数
|
|
440
|
+
*/
|
|
441
|
+
setRetentionDays(days) {
|
|
442
|
+
if (days > 0) {
|
|
443
|
+
this.retentionDays = days;
|
|
444
|
+
console.log(`-------- 设置日志保留天数为 ${days} 天`);
|
|
445
|
+
} else {
|
|
446
|
+
console.error("日志保留天数必须大于0");
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* 手动触发清理旧日志
|
|
451
|
+
*/
|
|
452
|
+
async manualCleanup() {
|
|
453
|
+
this.addLog({
|
|
454
|
+
type: "info",
|
|
455
|
+
title: "manualCleanup 手动触发清理旧日志"
|
|
456
|
+
});
|
|
457
|
+
await this.cleanupOldLogs();
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* 销毁实例
|
|
461
|
+
*/
|
|
462
|
+
destroy() {
|
|
463
|
+
if (this.timer) {
|
|
464
|
+
clearInterval(this.timer);
|
|
465
|
+
this.timer = null;
|
|
466
|
+
}
|
|
467
|
+
if (this.logBuffer.length > 0) {
|
|
468
|
+
this.storeLog();
|
|
469
|
+
}
|
|
470
|
+
if (this.db) {
|
|
471
|
+
this.db.close();
|
|
472
|
+
this.db = null;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
var logger_default = LoggerManager;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { MenuItem } from "./index";
|
|
3
|
+
export declare const isHttp: (url: string) => boolean;
|
|
4
|
+
export interface MenuContextType {
|
|
5
|
+
selectedKeys: string[];
|
|
6
|
+
openKeys: string[];
|
|
7
|
+
setOpenKeys: (keys: string[]) => void;
|
|
8
|
+
handleClick: (key: string) => void;
|
|
9
|
+
menuItems: MenuItem[];
|
|
10
|
+
getShowChildren: (children: MenuItem[]) => MenuItem[];
|
|
11
|
+
setMenuItems: (items: MenuItem[]) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const MenuProvider: React.FC<{
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
menus: MenuItem[];
|
|
16
|
+
}>;
|
|
17
|
+
export declare const useMenu: () => MenuContextType;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/menuManager/hooks.tsx
|
|
30
|
+
var hooks_exports = {};
|
|
31
|
+
__export(hooks_exports, {
|
|
32
|
+
MenuProvider: () => MenuProvider,
|
|
33
|
+
isHttp: () => isHttp,
|
|
34
|
+
useMenu: () => useMenu
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_app = require("../app");
|
|
39
|
+
var isHttp = (url) => {
|
|
40
|
+
return /^http(s)?:\/\//.test(url);
|
|
41
|
+
};
|
|
42
|
+
function handleRouteParams(targetPath, currentPath) {
|
|
43
|
+
if (!targetPath.includes(":")) {
|
|
44
|
+
return targetPath;
|
|
45
|
+
}
|
|
46
|
+
const currentParams = {};
|
|
47
|
+
const pathSegments = currentPath.split("/");
|
|
48
|
+
const targetSegments = targetPath.split("/");
|
|
49
|
+
targetSegments.forEach((segment, index) => {
|
|
50
|
+
if (segment.startsWith(":")) {
|
|
51
|
+
const paramName = segment.slice(1);
|
|
52
|
+
currentParams[paramName] = pathSegments[index] || "";
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return targetPath.replace(/:(\w+)/g, (match, key) => {
|
|
56
|
+
var _a;
|
|
57
|
+
return ((_a = currentParams[key]) == null ? void 0 : _a.toString()) || match;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var MenuContext = (0, import_react.createContext)(void 0);
|
|
61
|
+
var MenuProvider = ({ children, menus }) => {
|
|
62
|
+
const { app } = (0, import_app.useApp)();
|
|
63
|
+
const menuManager = app.menuManager;
|
|
64
|
+
const location = app.history.useLocation();
|
|
65
|
+
const [selectedKeys, setSelectedKeys] = (0, import_react.useState)([]);
|
|
66
|
+
const [openKeys, setOpenKeys] = (0, import_react.useState)([]);
|
|
67
|
+
const [menuItems, setMenuItems] = (0, import_react.useState)(menus);
|
|
68
|
+
(0, import_react.useEffect)(() => {
|
|
69
|
+
app.menuManager.set(menuItems);
|
|
70
|
+
}, [menuItems]);
|
|
71
|
+
(0, import_react.useEffect)(() => {
|
|
72
|
+
const pathname = location.pathname;
|
|
73
|
+
if (!pathname) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const currentMenuItem = menuManager.findMenuItemByPath(menuItems, pathname);
|
|
77
|
+
if (currentMenuItem) {
|
|
78
|
+
setSelectedKeys([currentMenuItem.key]);
|
|
79
|
+
const parent = menuManager.findParent(menuItems, currentMenuItem.key);
|
|
80
|
+
if (parent) {
|
|
81
|
+
const _children = menuManager.getShowChildren(parent.children || []);
|
|
82
|
+
if (_children == null ? void 0 : _children.length) {
|
|
83
|
+
setOpenKeys((prevKeys) => [.../* @__PURE__ */ new Set([...prevKeys, parent.key])]);
|
|
84
|
+
} else {
|
|
85
|
+
setSelectedKeys([parent.key]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, [location, menuItems]);
|
|
90
|
+
const handleClick = (key) => {
|
|
91
|
+
try {
|
|
92
|
+
if (!key) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (isHttp(key)) {
|
|
96
|
+
window.open(key, "_blank");
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const newPath = handleRouteParams(key, location.pathname);
|
|
100
|
+
if (newPath !== location.pathname) {
|
|
101
|
+
app.history.push(newPath);
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.error("Menu navigation error:", error);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
108
|
+
MenuContext.Provider,
|
|
109
|
+
{
|
|
110
|
+
value: {
|
|
111
|
+
selectedKeys,
|
|
112
|
+
openKeys,
|
|
113
|
+
setOpenKeys,
|
|
114
|
+
handleClick,
|
|
115
|
+
menuItems,
|
|
116
|
+
getShowChildren: menuManager.getShowChildren,
|
|
117
|
+
setMenuItems
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
children
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
var useMenu = () => {
|
|
124
|
+
const context = (0, import_react.useContext)(MenuContext);
|
|
125
|
+
if (context === void 0) {
|
|
126
|
+
throw new Error("useMenu must be used within a MenuProvider");
|
|
127
|
+
}
|
|
128
|
+
return context;
|
|
129
|
+
};
|
|
130
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
131
|
+
0 && (module.exports = {
|
|
132
|
+
MenuProvider,
|
|
133
|
+
isHttp,
|
|
134
|
+
useMenu
|
|
135
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import App from '../app';
|
|
3
|
+
export interface MenuItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
path: string;
|
|
7
|
+
children?: MenuItem[];
|
|
8
|
+
icon?: string | React.ReactNode;
|
|
9
|
+
hide?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class MenuManager {
|
|
12
|
+
private menuItems;
|
|
13
|
+
private menuMaps;
|
|
14
|
+
private app;
|
|
15
|
+
useMenu: () => import("./hooks").MenuContextType;
|
|
16
|
+
MenuProvider: React.FC<{
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
menus: MenuItem[];
|
|
19
|
+
}>;
|
|
20
|
+
constructor(items: MenuItem[], app: App);
|
|
21
|
+
set(items: MenuItem[]): void;
|
|
22
|
+
getMenus(): MenuItem[];
|
|
23
|
+
getMenuMaps(): void;
|
|
24
|
+
findMenuItemByPath(items: MenuItem[], path: string): MenuItem | null;
|
|
25
|
+
findParent(items: MenuItem[], key: string, parent?: MenuItem | null): MenuItem | null;
|
|
26
|
+
getShowChildren(items: MenuItem[]): MenuItem[];
|
|
27
|
+
findMenuItemByKey(items: MenuItem[], key: string): MenuItem | null;
|
|
28
|
+
}
|