@composy/log-viewer-core 0.0.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/README.md +37 -0
- package/dist/index.js +961 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/es/core/EventEmitter.d.ts +11 -0
- package/es/core/EventEmitter.d.ts.map +1 -0
- package/es/core/EventEmitter.js +40 -0
- package/es/core/EventEmitter.js.map +1 -0
- package/es/core/LogViewer.d.ts +46 -0
- package/es/core/LogViewer.d.ts.map +1 -0
- package/es/core/LogViewer.js +186 -0
- package/es/core/LogViewer.js.map +1 -0
- package/es/filters/FilterEngine.d.ts +26 -0
- package/es/filters/FilterEngine.d.ts.map +1 -0
- package/es/filters/FilterEngine.js +79 -0
- package/es/filters/FilterEngine.js.map +1 -0
- package/es/index.d.ts +26 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +26 -0
- package/es/index.js.map +1 -0
- package/es/renderers/DiffRenderer.d.ts +18 -0
- package/es/renderers/DiffRenderer.d.ts.map +1 -0
- package/es/renderers/DiffRenderer.js +60 -0
- package/es/renderers/DiffRenderer.js.map +1 -0
- package/es/renderers/TimelineRenderer.d.ts +22 -0
- package/es/renderers/TimelineRenderer.d.ts.map +1 -0
- package/es/renderers/TimelineRenderer.js +135 -0
- package/es/renderers/TimelineRenderer.js.map +1 -0
- package/es/styles/index.d.ts +9 -0
- package/es/styles/index.d.ts.map +1 -0
- package/es/styles/index.js +414 -0
- package/es/styles/index.js.map +1 -0
- package/es/types/index.d.ts +113 -0
- package/es/types/index.d.ts.map +1 -0
- package/es/types/index.js +40 -0
- package/es/types/index.js.map +1 -0
- package/es/utils/index.d.ts +18 -0
- package/es/utils/index.d.ts.map +1 -0
- package/es/utils/index.js +73 -0
- package/es/utils/index.js.map +1 -0
- package/esm/core/EventEmitter.d.ts +11 -0
- package/esm/core/EventEmitter.d.ts.map +1 -0
- package/esm/core/EventEmitter.js +40 -0
- package/esm/core/EventEmitter.js.map +1 -0
- package/esm/core/LogViewer.d.ts +46 -0
- package/esm/core/LogViewer.d.ts.map +1 -0
- package/esm/core/LogViewer.js +186 -0
- package/esm/core/LogViewer.js.map +1 -0
- package/esm/filters/FilterEngine.d.ts +26 -0
- package/esm/filters/FilterEngine.d.ts.map +1 -0
- package/esm/filters/FilterEngine.js +79 -0
- package/esm/filters/FilterEngine.js.map +1 -0
- package/esm/index.d.ts +26 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +26 -0
- package/esm/index.js.map +1 -0
- package/esm/renderers/DiffRenderer.d.ts +18 -0
- package/esm/renderers/DiffRenderer.d.ts.map +1 -0
- package/esm/renderers/DiffRenderer.js +60 -0
- package/esm/renderers/DiffRenderer.js.map +1 -0
- package/esm/renderers/TimelineRenderer.d.ts +22 -0
- package/esm/renderers/TimelineRenderer.d.ts.map +1 -0
- package/esm/renderers/TimelineRenderer.js +135 -0
- package/esm/renderers/TimelineRenderer.js.map +1 -0
- package/esm/styles/index.d.ts +9 -0
- package/esm/styles/index.d.ts.map +1 -0
- package/esm/styles/index.js +414 -0
- package/esm/styles/index.js.map +1 -0
- package/esm/types/index.d.ts +113 -0
- package/esm/types/index.d.ts.map +1 -0
- package/esm/types/index.js +40 -0
- package/esm/types/index.js.map +1 -0
- package/esm/utils/index.d.ts +18 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/index.js +73 -0
- package/esm/utils/index.js.map +1 -0
- package/lib/core/EventEmitter.cjs +41 -0
- package/lib/core/EventEmitter.cjs.map +1 -0
- package/lib/core/EventEmitter.d.ts +11 -0
- package/lib/core/LogViewer.cjs +187 -0
- package/lib/core/LogViewer.cjs.map +1 -0
- package/lib/core/LogViewer.d.ts +46 -0
- package/lib/filters/FilterEngine.cjs +80 -0
- package/lib/filters/FilterEngine.cjs.map +1 -0
- package/lib/filters/FilterEngine.d.ts +26 -0
- package/lib/index.cjs +43 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.ts +26 -0
- package/lib/package.json +3 -0
- package/lib/renderers/DiffRenderer.cjs +61 -0
- package/lib/renderers/DiffRenderer.cjs.map +1 -0
- package/lib/renderers/DiffRenderer.d.ts +18 -0
- package/lib/renderers/TimelineRenderer.cjs +136 -0
- package/lib/renderers/TimelineRenderer.cjs.map +1 -0
- package/lib/renderers/TimelineRenderer.d.ts +22 -0
- package/lib/styles/index.cjs +415 -0
- package/lib/styles/index.cjs.map +1 -0
- package/lib/styles/index.d.ts +9 -0
- package/lib/types/index.cjs +42 -0
- package/lib/types/index.cjs.map +1 -0
- package/lib/types/index.d.ts +113 -0
- package/lib/utils/index.cjs +80 -0
- package/lib/utils/index.cjs.map +1 -0
- package/lib/utils/index.d.ts +18 -0
- package/package.json +119 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ***********************************
|
|
3
|
+
* @composy/log-viewer-core v0.0.1 *
|
|
4
|
+
* Built with rollup *
|
|
5
|
+
* Build time: 2024-08-17 11:33:32 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
//#region src/filters/FilterEngine.ts
|
|
12
|
+
var FilterEngine = class {
|
|
13
|
+
/**
|
|
14
|
+
* 对日志条目进行多维筛选
|
|
15
|
+
*/
|
|
16
|
+
filter(entries, config) {
|
|
17
|
+
let result = entries;
|
|
18
|
+
if (config.user) {
|
|
19
|
+
const keyword = config.user.toLowerCase();
|
|
20
|
+
result = result.filter((e) => e.user.toLowerCase().includes(keyword) || e.userId && e.userId.toLowerCase().includes(keyword));
|
|
21
|
+
}
|
|
22
|
+
if (config.action) {
|
|
23
|
+
const actions = Array.isArray(config.action) ? config.action : [config.action];
|
|
24
|
+
result = result.filter((e) => actions.includes(e.action));
|
|
25
|
+
}
|
|
26
|
+
if (config.module) {
|
|
27
|
+
const mod = config.module.toLowerCase();
|
|
28
|
+
result = result.filter((e) => e.module.toLowerCase().includes(mod));
|
|
29
|
+
}
|
|
30
|
+
if (config.ip) {
|
|
31
|
+
const ip = config.ip.toLowerCase();
|
|
32
|
+
result = result.filter((e) => e.ip && e.ip.toLowerCase().includes(ip));
|
|
33
|
+
}
|
|
34
|
+
if (config.timeRange) {
|
|
35
|
+
const [start, end] = config.timeRange;
|
|
36
|
+
const startTime = new Date(start).getTime();
|
|
37
|
+
const endTime = new Date(end).getTime();
|
|
38
|
+
result = result.filter((e) => {
|
|
39
|
+
const t = new Date(e.timestamp).getTime();
|
|
40
|
+
return t >= startTime && t <= endTime;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (config.keyword) {
|
|
44
|
+
const kw = config.keyword.toLowerCase();
|
|
45
|
+
result = result.filter((e) => {
|
|
46
|
+
return [
|
|
47
|
+
e.user,
|
|
48
|
+
e.action,
|
|
49
|
+
e.module,
|
|
50
|
+
e.detail || "",
|
|
51
|
+
e.ip || "",
|
|
52
|
+
e.id
|
|
53
|
+
].some((t) => t.toLowerCase().includes(kw));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 获取所有唯一操作人
|
|
60
|
+
*/
|
|
61
|
+
getUniqueUsers(entries) {
|
|
62
|
+
return [...new Set(entries.map((e) => e.user))].sort();
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 获取所有唯一模块
|
|
66
|
+
*/
|
|
67
|
+
getUniqueModules(entries) {
|
|
68
|
+
return [...new Set(entries.map((e) => e.module))].sort();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 获取所有唯一操作类型
|
|
72
|
+
*/
|
|
73
|
+
getUniqueActions(entries) {
|
|
74
|
+
return [...new Set(entries.map((e) => e.action))].sort();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
exports.FilterEngine = FilterEngine;
|
|
79
|
+
/*! End of @composy/log-viewer-core | Powered by @composy/builder */
|
|
80
|
+
//# sourceMappingURL=FilterEngine.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterEngine.cjs","names":[],"sources":["../../src/filters/FilterEngine.ts"],"sourcesContent":["/**\n * 筛选引擎 - 支持按操作人/操作类型/时间范围/模块/IP/关键词筛选\n */\n\nimport type { LogEntry, FilterConfig } from '../types'\n\n/**\n * FilterEngine - Filter Engine class\n */\nexport class FilterEngine {\n /**\n * 对日志条目进行多维筛选\n */\n filter(entries: LogEntry[], config: FilterConfig): LogEntry[] {\n let result = entries\n\n // 按操作人筛选\n if (config.user) {\n const keyword = config.user.toLowerCase()\n result = result.filter(\n (e) =>\n e.user.toLowerCase().includes(keyword) ||\n (e.userId && e.userId.toLowerCase().includes(keyword)),\n )\n }\n\n // 按操作类型筛选\n if (config.action) {\n const actions = Array.isArray(config.action) ? config.action : [config.action]\n result = result.filter((e) => actions.includes(e.action))\n }\n\n // 按模块筛选\n if (config.module) {\n const mod = config.module.toLowerCase()\n result = result.filter((e) => e.module.toLowerCase().includes(mod))\n }\n\n // 按 IP 筛选\n if (config.ip) {\n const ip = config.ip.toLowerCase()\n result = result.filter((e) => e.ip && e.ip.toLowerCase().includes(ip))\n }\n\n // 按时间范围筛选\n if (config.timeRange) {\n const [start, end] = config.timeRange\n const startTime = new Date(start).getTime()\n const endTime = new Date(end).getTime()\n result = result.filter((e) => {\n const t = new Date(e.timestamp).getTime()\n return t >= startTime && t <= endTime\n })\n }\n\n // 按关键词全文搜索\n if (config.keyword) {\n const kw = config.keyword.toLowerCase()\n result = result.filter((e) => {\n const texts = [\n e.user,\n e.action,\n e.module,\n e.detail || '',\n e.ip || '',\n e.id,\n ]\n return texts.some((t) => t.toLowerCase().includes(kw))\n })\n }\n\n return result\n }\n\n /**\n * 获取所有唯一操作人\n */\n getUniqueUsers(entries: LogEntry[]): string[] {\n return [...new Set(entries.map((e) => e.user))].sort()\n }\n\n /**\n * 获取所有唯一模块\n */\n getUniqueModules(entries: LogEntry[]): string[] {\n return [...new Set(entries.map((e) => e.module))].sort()\n }\n\n /**\n * 获取所有唯一操作类型\n */\n getUniqueActions(entries: LogEntry[]): string[] {\n return [...new Set(entries.map((e) => e.action))].sort()\n }\n}\n"],"mappings":";;;;;;;;;;;AASO,IAAM,eAAN,MAAmB;;;;CAIxB,OAAO,SAAqB,QAAkC;EAC5D,IAAI,SAAS;EAGb,IAAI,OAAO,MAAM;GACf,MAAM,UAAU,OAAO,KAAK,YAAY;GACxC,SAAS,OAAO,QACb,MACC,EAAE,KAAK,YAAY,CAAA,CAAE,SAAS,OAAO,KACpC,EAAE,UAAU,EAAE,OAAO,YAAY,CAAA,CAAE,SAAS,OAAO,CACxD;EACF;EAGA,IAAI,OAAO,QAAQ;GACjB,MAAM,UAAU,MAAM,QAAQ,OAAO,MAAM,IAAI,OAAO,SAAS,CAAC,OAAO,MAAM;GAC7E,SAAS,OAAO,QAAQ,MAAM,QAAQ,SAAS,EAAE,MAAM,CAAC;EAC1D;EAGA,IAAI,OAAO,QAAQ;GACjB,MAAM,MAAM,OAAO,OAAO,YAAY;GACtC,SAAS,OAAO,QAAQ,MAAM,EAAE,OAAO,YAAY,CAAA,CAAE,SAAS,GAAG,CAAC;EACpE;EAGA,IAAI,OAAO,IAAI;GACb,MAAM,KAAK,OAAO,GAAG,YAAY;GACjC,SAAS,OAAO,QAAQ,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAA,CAAE,SAAS,EAAE,CAAC;EACvE;EAGA,IAAI,OAAO,WAAW;GACpB,MAAM,CAAC,OAAO,OAAO,OAAO;GAC5B,MAAM,YAAY,IAAI,KAAK,KAAK,CAAA,CAAE,QAAQ;GAC1C,MAAM,UAAU,IAAI,KAAK,GAAG,CAAA,CAAE,QAAQ;GACtC,SAAS,OAAO,QAAQ,MAAM;IAC5B,MAAM,IAAI,IAAI,KAAK,EAAE,SAAS,CAAA,CAAE,QAAQ;IACxC,OAAO,KAAK,aAAa,KAAK;GAChC,CAAC;EACH;EAGA,IAAI,OAAO,SAAS;GAClB,MAAM,KAAK,OAAO,QAAQ,YAAY;GACtC,SAAS,OAAO,QAAQ,MAAM;IAS5B,OAAO;KAPL,EAAE;KACF,EAAE;KACF,EAAE;KACF,EAAE,UAAU;KACZ,EAAE,MAAM;KACR,EAAE;IAEG,CAAA,CAAM,MAAM,MAAM,EAAE,YAAY,CAAA,CAAE,SAAS,EAAE,CAAC;GACvD,CAAC;EACH;EAEA,OAAO;CACT;;;;CAKA,eAAe,SAA+B;EAC5C,OAAO,CAAC,GAAG,IAAI,IAAI,QAAQ,KAAK,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA,CAAE,KAAK;CACvD;;;;CAKA,iBAAiB,SAA+B;EAC9C,OAAO,CAAC,GAAG,IAAI,IAAI,QAAQ,KAAK,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA,CAAE,KAAK;CACzD;;;;CAKA,iBAAiB,SAA+B;EAC9C,OAAO,CAAC,GAAG,IAAI,IAAI,QAAQ,KAAK,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA,CAAE,KAAK;CACzD;AACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 筛选引擎 - 支持按操作人/操作类型/时间范围/模块/IP/关键词筛选
|
|
3
|
+
*/
|
|
4
|
+
import type { LogEntry, FilterConfig } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* FilterEngine - Filter Engine class
|
|
7
|
+
*/
|
|
8
|
+
export declare class FilterEngine {
|
|
9
|
+
/**
|
|
10
|
+
* 对日志条目进行多维筛选
|
|
11
|
+
*/
|
|
12
|
+
filter(entries: LogEntry[], config: FilterConfig): LogEntry[];
|
|
13
|
+
/**
|
|
14
|
+
* 获取所有唯一操作人
|
|
15
|
+
*/
|
|
16
|
+
getUniqueUsers(entries: LogEntry[]): string[];
|
|
17
|
+
/**
|
|
18
|
+
* 获取所有唯一模块
|
|
19
|
+
*/
|
|
20
|
+
getUniqueModules(entries: LogEntry[]): string[];
|
|
21
|
+
/**
|
|
22
|
+
* 获取所有唯一操作类型
|
|
23
|
+
*/
|
|
24
|
+
getUniqueActions(entries: LogEntry[]): string[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=FilterEngine.d.ts.map
|
package/lib/index.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ***********************************
|
|
3
|
+
* @composy/log-viewer-core v0.0.1 *
|
|
4
|
+
* Built with rollup *
|
|
5
|
+
* Build time: 2024-08-17 11:33:32 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
const require_EventEmitter = require("./core/EventEmitter.cjs");
|
|
12
|
+
const require_FilterEngine = require("./filters/FilterEngine.cjs");
|
|
13
|
+
const require_index = require("./types/index.cjs");
|
|
14
|
+
const require_index$1 = require("./utils/index.cjs");
|
|
15
|
+
const require_TimelineRenderer = require("./renderers/TimelineRenderer.cjs");
|
|
16
|
+
const require_DiffRenderer = require("./renderers/DiffRenderer.cjs");
|
|
17
|
+
const require_index$2 = require("./styles/index.cjs");
|
|
18
|
+
const require_LogViewer = require("./core/LogViewer.cjs");
|
|
19
|
+
//#region src/index.ts
|
|
20
|
+
const VERSION = "0.1.0";
|
|
21
|
+
function createLogViewer(config) {
|
|
22
|
+
return new require_LogViewer.LogViewer(config);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.ACTION_COLORS = require_index.ACTION_COLORS;
|
|
26
|
+
exports.ACTION_LABELS = require_index.ACTION_LABELS;
|
|
27
|
+
exports.DiffRenderer = require_DiffRenderer.DiffRenderer;
|
|
28
|
+
exports.EventEmitter = require_EventEmitter.EventEmitter;
|
|
29
|
+
exports.FilterEngine = require_FilterEngine.FilterEngine;
|
|
30
|
+
exports.LogViewer = require_LogViewer.LogViewer;
|
|
31
|
+
exports.TimelineRenderer = require_TimelineRenderer.TimelineRenderer;
|
|
32
|
+
exports.VERSION = VERSION;
|
|
33
|
+
exports.createLogViewer = createLogViewer;
|
|
34
|
+
exports.debounce = require_index$1.debounce;
|
|
35
|
+
exports.deepClone = require_index$1.deepClone;
|
|
36
|
+
exports.escapeHtml = require_index$1.escapeHtml;
|
|
37
|
+
exports.formatDate = require_index$1.formatDate;
|
|
38
|
+
exports.formatRelativeTime = require_index$1.formatRelativeTime;
|
|
39
|
+
exports.formatValue = require_index$1.formatValue;
|
|
40
|
+
exports.injectStyles = require_index$2.injectStyles;
|
|
41
|
+
exports.uid = require_index$1.uid;
|
|
42
|
+
/*! End of @composy/log-viewer-core | Powered by @composy/builder */
|
|
43
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["LogViewer"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * @composy/log-viewer-core\n * 审计日志查看器 - 操作日志可视化与追溯\n */\n\nexport const VERSION = '0.1.0'\n\n// 类型\nexport type {\n ActionType,\n ThemeMode,\n AnomalyType,\n DiffEntry,\n LogEntry,\n FilterConfig,\n PaginationConfig,\n LogViewerConfig,\n LogViewerInstance,\n LogViewerEvents,\n} from './types'\nexport { ACTION_LABELS, ACTION_COLORS } from './types'\n\n// 核心\nexport { LogViewer } from './core/LogViewer'\nexport { EventEmitter } from './core/EventEmitter'\n\n// 筛选\nexport { FilterEngine } from './filters/FilterEngine'\n\n// 渲染器\nexport { TimelineRenderer } from './renderers/TimelineRenderer'\nexport { DiffRenderer } from './renderers/DiffRenderer'\n\n// 工具\nexport { formatDate, formatRelativeTime, escapeHtml, debounce, uid, formatValue, deepClone } from './utils'\n\n// 样式\nexport { injectStyles } from './styles'\n\n/**\n * 创建 LogViewer 实例 - 工厂函数\n */\nimport type { LogViewerConfig } from './types'\nimport { LogViewer } from './core/LogViewer'\n\n/**\n * createLogViewer - create Log Viewer function\n * @param config - 参数说明\n * @returns 返回值说明\n */\nexport function createLogViewer(config: LogViewerConfig): LogViewer {\n return new LogViewer(config)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAKO,MAAM,UAAU;AA6ChB,SAAS,gBAAgB,QAAoC;CAClE,OAAO,IAAIA,kBAAAA,UAAU,MAAM;AAC7B"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @composy/log-viewer-core
|
|
3
|
+
* 审计日志查看器 - 操作日志可视化与追溯
|
|
4
|
+
*/
|
|
5
|
+
export declare const VERSION = "0.1.0";
|
|
6
|
+
export type { ActionType, ThemeMode, AnomalyType, DiffEntry, LogEntry, FilterConfig, PaginationConfig, LogViewerConfig, LogViewerInstance, LogViewerEvents, } from './types';
|
|
7
|
+
export { ACTION_LABELS, ACTION_COLORS } from './types';
|
|
8
|
+
export { LogViewer } from './core/LogViewer';
|
|
9
|
+
export { EventEmitter } from './core/EventEmitter';
|
|
10
|
+
export { FilterEngine } from './filters/FilterEngine';
|
|
11
|
+
export { TimelineRenderer } from './renderers/TimelineRenderer';
|
|
12
|
+
export { DiffRenderer } from './renderers/DiffRenderer';
|
|
13
|
+
export { formatDate, formatRelativeTime, escapeHtml, debounce, uid, formatValue, deepClone } from './utils';
|
|
14
|
+
export { injectStyles } from './styles';
|
|
15
|
+
/**
|
|
16
|
+
* 创建 LogViewer 实例 - 工厂函数
|
|
17
|
+
*/
|
|
18
|
+
import type { LogViewerConfig } from './types';
|
|
19
|
+
import { LogViewer } from './core/LogViewer';
|
|
20
|
+
/**
|
|
21
|
+
* createLogViewer - create Log Viewer function
|
|
22
|
+
* @param config - 参数说明
|
|
23
|
+
* @returns 返回值说明
|
|
24
|
+
*/
|
|
25
|
+
export declare function createLogViewer(config: LogViewerConfig): LogViewer;
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
package/lib/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ***********************************
|
|
3
|
+
* @composy/log-viewer-core v0.0.1 *
|
|
4
|
+
* Built with rollup *
|
|
5
|
+
* Build time: 2024-08-17 11:33:32 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
const require_index = require("../utils/index.cjs");
|
|
12
|
+
//#region src/renderers/DiffRenderer.ts
|
|
13
|
+
var DiffRenderer = class {
|
|
14
|
+
/**
|
|
15
|
+
* 渲染详情面板(包含 diff 表格和 metadata)
|
|
16
|
+
*/
|
|
17
|
+
renderDetail(entry) {
|
|
18
|
+
const container = document.createElement("div");
|
|
19
|
+
container.className = "lv-detail";
|
|
20
|
+
if (entry.changes && entry.changes.length > 0) container.appendChild(this.renderDiffTable(entry.changes));
|
|
21
|
+
if (entry.metadata && Object.keys(entry.metadata).length > 0) {
|
|
22
|
+
const meta = document.createElement("div");
|
|
23
|
+
meta.className = "lv-metadata";
|
|
24
|
+
meta.textContent = JSON.stringify(entry.metadata, null, 2);
|
|
25
|
+
container.appendChild(meta);
|
|
26
|
+
}
|
|
27
|
+
return container;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 渲染 Diff 表格
|
|
31
|
+
*/
|
|
32
|
+
renderDiffTable(changes) {
|
|
33
|
+
const table = document.createElement("table");
|
|
34
|
+
table.className = "lv-diff-table";
|
|
35
|
+
const thead = document.createElement("thead");
|
|
36
|
+
thead.innerHTML = `<tr><th>\u5B57\u6BB5</th><th>\u53D8\u66F4\u524D</th><th>\u53D8\u66F4\u540E</th></tr>`;
|
|
37
|
+
table.appendChild(thead);
|
|
38
|
+
const tbody = document.createElement("tbody");
|
|
39
|
+
for (const change of changes) {
|
|
40
|
+
const tr = document.createElement("tr");
|
|
41
|
+
const tdField = document.createElement("td");
|
|
42
|
+
tdField.textContent = change.label || change.field;
|
|
43
|
+
tr.appendChild(tdField);
|
|
44
|
+
const tdOld = document.createElement("td");
|
|
45
|
+
tdOld.className = "lv-diff-old";
|
|
46
|
+
tdOld.textContent = require_index.formatValue(change.oldValue);
|
|
47
|
+
tr.appendChild(tdOld);
|
|
48
|
+
const tdNew = document.createElement("td");
|
|
49
|
+
tdNew.className = "lv-diff-new";
|
|
50
|
+
tdNew.textContent = require_index.formatValue(change.newValue);
|
|
51
|
+
tr.appendChild(tdNew);
|
|
52
|
+
tbody.appendChild(tr);
|
|
53
|
+
}
|
|
54
|
+
table.appendChild(tbody);
|
|
55
|
+
return table;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
exports.DiffRenderer = DiffRenderer;
|
|
60
|
+
/*! End of @composy/log-viewer-core | Powered by @composy/builder */
|
|
61
|
+
//# sourceMappingURL=DiffRenderer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffRenderer.cjs","names":[],"sources":["../../src/renderers/DiffRenderer.ts"],"sourcesContent":["/**\n * 变更对比渲染器 - 渲染字段变更前后的 Diff 表格\n */\n\nimport type { DiffEntry, LogEntry } from '../types'\nimport { escapeHtml, formatValue } from '../utils'\n\n/**\n * DiffRenderer - Diff Renderer class\n */\nexport class DiffRenderer {\n /**\n * 渲染详情面板(包含 diff 表格和 metadata)\n */\n renderDetail(entry: LogEntry): HTMLElement {\n const container = document.createElement('div')\n container.className = 'lv-detail'\n\n if (entry.changes && entry.changes.length > 0) {\n container.appendChild(this.renderDiffTable(entry.changes))\n }\n\n if (entry.metadata && Object.keys(entry.metadata).length > 0) {\n const meta = document.createElement('div')\n meta.className = 'lv-metadata'\n meta.textContent = JSON.stringify(entry.metadata, null, 2)\n container.appendChild(meta)\n }\n\n return container\n }\n\n /**\n * 渲染 Diff 表格\n */\n renderDiffTable(changes: DiffEntry[]): HTMLElement {\n const table = document.createElement('table')\n table.className = 'lv-diff-table'\n\n // Header\n const thead = document.createElement('thead')\n thead.innerHTML = `<tr><th>字段</th><th>变更前</th><th>变更后</th></tr>`\n table.appendChild(thead)\n\n // Body\n const tbody = document.createElement('tbody')\n for (const change of changes) {\n const tr = document.createElement('tr')\n\n const tdField = document.createElement('td')\n tdField.textContent = change.label || change.field\n tr.appendChild(tdField)\n\n const tdOld = document.createElement('td')\n tdOld.className = 'lv-diff-old'\n tdOld.textContent = formatValue(change.oldValue)\n tr.appendChild(tdOld)\n\n const tdNew = document.createElement('td')\n tdNew.className = 'lv-diff-new'\n tdNew.textContent = formatValue(change.newValue)\n tr.appendChild(tdNew)\n\n tbody.appendChild(tr)\n }\n table.appendChild(tbody)\n\n return table\n }\n}\n"],"mappings":";;;;;;;;;;;;AAUO,IAAM,eAAN,MAAmB;;;;CAIxB,aAAa,OAA8B;EACzC,MAAM,YAAY,SAAS,cAAc,KAAK;EAC9C,UAAU,YAAY;EAEtB,IAAI,MAAM,WAAW,MAAM,QAAQ,SAAS,GAC1C,UAAU,YAAY,KAAK,gBAAgB,MAAM,OAAO,CAAC;EAG3D,IAAI,MAAM,YAAY,OAAO,KAAK,MAAM,QAAQ,CAAA,CAAE,SAAS,GAAG;GAC5D,MAAM,OAAO,SAAS,cAAc,KAAK;GACzC,KAAK,YAAY;GACjB,KAAK,cAAc,KAAK,UAAU,MAAM,UAAU,MAAM,CAAC;GACzD,UAAU,YAAY,IAAI;EAC5B;EAEA,OAAO;CACT;;;;CAKA,gBAAgB,SAAmC;EACjD,MAAM,QAAQ,SAAS,cAAc,OAAO;EAC5C,MAAM,YAAY;EAGlB,MAAM,QAAQ,SAAS,cAAc,OAAO;EAC5C,MAAM,YAAY;EAClB,MAAM,YAAY,KAAK;EAGvB,MAAM,QAAQ,SAAS,cAAc,OAAO;EAC5C,KAAA,MAAW,UAAU,SAAS;GAC5B,MAAM,KAAK,SAAS,cAAc,IAAI;GAEtC,MAAM,UAAU,SAAS,cAAc,IAAI;GAC3C,QAAQ,cAAc,OAAO,SAAS,OAAO;GAC7C,GAAG,YAAY,OAAO;GAEtB,MAAM,QAAQ,SAAS,cAAc,IAAI;GACzC,MAAM,YAAY;GAClB,MAAM,cAAc,cAAA,YAAY,OAAO,QAAQ;GAC/C,GAAG,YAAY,KAAK;GAEpB,MAAM,QAAQ,SAAS,cAAc,IAAI;GACzC,MAAM,YAAY;GAClB,MAAM,cAAc,cAAA,YAAY,OAAO,QAAQ;GAC/C,GAAG,YAAY,KAAK;GAEpB,MAAM,YAAY,EAAE;EACtB;EACA,MAAM,YAAY,KAAK;EAEvB,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 变更对比渲染器 - 渲染字段变更前后的 Diff 表格
|
|
3
|
+
*/
|
|
4
|
+
import type { DiffEntry, LogEntry } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* DiffRenderer - Diff Renderer class
|
|
7
|
+
*/
|
|
8
|
+
export declare class DiffRenderer {
|
|
9
|
+
/**
|
|
10
|
+
* 渲染详情面板(包含 diff 表格和 metadata)
|
|
11
|
+
*/
|
|
12
|
+
renderDetail(entry: LogEntry): HTMLElement;
|
|
13
|
+
/**
|
|
14
|
+
* 渲染 Diff 表格
|
|
15
|
+
*/
|
|
16
|
+
renderDiffTable(changes: DiffEntry[]): HTMLElement;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DiffRenderer.d.ts.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* ***********************************
|
|
3
|
+
* @composy/log-viewer-core v0.0.1 *
|
|
4
|
+
* Built with rollup *
|
|
5
|
+
* Build time: 2024-08-17 11:33:32 *
|
|
6
|
+
* Build mode: production *
|
|
7
|
+
* Minified: No *
|
|
8
|
+
* ***********************************
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
const require_index = require("../types/index.cjs");
|
|
12
|
+
const require_index$1 = require("../utils/index.cjs");
|
|
13
|
+
//#region src/renderers/TimelineRenderer.ts
|
|
14
|
+
const ANOMALY_LABELS = {
|
|
15
|
+
"off-hours": "非工作时间",
|
|
16
|
+
sensitive: "敏感操作",
|
|
17
|
+
"high-frequency": "高频操作",
|
|
18
|
+
none: ""
|
|
19
|
+
};
|
|
20
|
+
var TimelineRenderer = class {
|
|
21
|
+
/**
|
|
22
|
+
* 渲染时间线
|
|
23
|
+
*/
|
|
24
|
+
render(entries, expandedIds) {
|
|
25
|
+
const container = document.createElement("div");
|
|
26
|
+
container.className = "lv-timeline";
|
|
27
|
+
if (entries.length === 0) {
|
|
28
|
+
container.innerHTML = `<div class="lv-empty"><div class="lv-empty-icon">--</div><div>\u6682\u65E0\u65E5\u5FD7\u8BB0\u5F55</div></div>`;
|
|
29
|
+
container.className = "";
|
|
30
|
+
return container;
|
|
31
|
+
}
|
|
32
|
+
for (const entry of entries) container.appendChild(this.renderItem(entry, expandedIds.has(entry.id)));
|
|
33
|
+
return container;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 渲染单条时间线条目
|
|
37
|
+
*/
|
|
38
|
+
renderItem(entry, expanded) {
|
|
39
|
+
const item = document.createElement("div");
|
|
40
|
+
item.className = "lv-timeline-item";
|
|
41
|
+
item.setAttribute("data-id", entry.id);
|
|
42
|
+
const isAnomaly = entry.anomaly && entry.anomaly !== "none";
|
|
43
|
+
const dot = document.createElement("div");
|
|
44
|
+
dot.className = `lv-timeline-dot${isAnomaly ? " lv-timeline-dot--anomaly" : ""}`;
|
|
45
|
+
item.appendChild(dot);
|
|
46
|
+
const card = document.createElement("div");
|
|
47
|
+
card.className = `lv-timeline-card${isAnomaly ? " lv-timeline-card--anomaly" : ""}`;
|
|
48
|
+
const header = document.createElement("div");
|
|
49
|
+
header.className = "lv-timeline-header";
|
|
50
|
+
const time = document.createElement("span");
|
|
51
|
+
time.className = "lv-timeline-time";
|
|
52
|
+
time.textContent = require_index$1.formatDate(entry.timestamp);
|
|
53
|
+
header.appendChild(time);
|
|
54
|
+
const user = document.createElement("span");
|
|
55
|
+
user.className = "lv-timeline-user";
|
|
56
|
+
user.textContent = entry.user;
|
|
57
|
+
header.appendChild(user);
|
|
58
|
+
const actionTag = document.createElement("span");
|
|
59
|
+
actionTag.className = "lv-action-tag";
|
|
60
|
+
actionTag.textContent = require_index.ACTION_LABELS[entry.action] || entry.action;
|
|
61
|
+
actionTag.style.backgroundColor = require_index.ACTION_COLORS[entry.action] || "#8c8c8c";
|
|
62
|
+
header.appendChild(actionTag);
|
|
63
|
+
const moduleBadge = document.createElement("span");
|
|
64
|
+
moduleBadge.className = "lv-timeline-module";
|
|
65
|
+
moduleBadge.textContent = entry.module;
|
|
66
|
+
header.appendChild(moduleBadge);
|
|
67
|
+
if (entry.ip) {
|
|
68
|
+
const ip = document.createElement("span");
|
|
69
|
+
ip.className = "lv-timeline-ip";
|
|
70
|
+
ip.textContent = entry.ip;
|
|
71
|
+
header.appendChild(ip);
|
|
72
|
+
}
|
|
73
|
+
if (isAnomaly) {
|
|
74
|
+
const badge = document.createElement("span");
|
|
75
|
+
badge.className = "lv-anomaly-badge";
|
|
76
|
+
badge.textContent = ANOMALY_LABELS[entry.anomaly];
|
|
77
|
+
header.appendChild(badge);
|
|
78
|
+
}
|
|
79
|
+
card.appendChild(header);
|
|
80
|
+
if (entry.detail) {
|
|
81
|
+
const detail = document.createElement("div");
|
|
82
|
+
detail.className = "lv-timeline-detail";
|
|
83
|
+
detail.textContent = entry.detail;
|
|
84
|
+
card.appendChild(detail);
|
|
85
|
+
}
|
|
86
|
+
if (entry.changes && entry.changes.length > 0) {
|
|
87
|
+
const hint = document.createElement("div");
|
|
88
|
+
hint.className = "lv-timeline-expand-hint";
|
|
89
|
+
hint.textContent = expanded ? "[ 收起变更详情 ]" : `[ \u67E5\u770B\u53D8\u66F4\u8BE6\u60C5 (${entry.changes.length} \u4E2A\u5B57\u6BB5) ]`;
|
|
90
|
+
card.appendChild(hint);
|
|
91
|
+
}
|
|
92
|
+
item.appendChild(card);
|
|
93
|
+
return item;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* 渲染分页
|
|
97
|
+
*/
|
|
98
|
+
renderPagination(page, pageSize, total) {
|
|
99
|
+
const container = document.createElement("div");
|
|
100
|
+
container.className = "lv-pagination";
|
|
101
|
+
const totalPages = Math.ceil(total / pageSize);
|
|
102
|
+
if (totalPages <= 1) return container;
|
|
103
|
+
const prev = document.createElement("button");
|
|
104
|
+
prev.className = "lv-pagination-btn";
|
|
105
|
+
prev.textContent = "<";
|
|
106
|
+
prev.disabled = page <= 1;
|
|
107
|
+
prev.setAttribute("data-page", String(page - 1));
|
|
108
|
+
container.appendChild(prev);
|
|
109
|
+
const maxVisible = 7;
|
|
110
|
+
let startPage = Math.max(1, page - Math.floor(maxVisible / 2));
|
|
111
|
+
const endPage = Math.min(totalPages, startPage + maxVisible - 1);
|
|
112
|
+
if (endPage - startPage < maxVisible - 1) startPage = Math.max(1, endPage - maxVisible + 1);
|
|
113
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
114
|
+
const btn = document.createElement("button");
|
|
115
|
+
btn.className = `lv-pagination-btn${i === page ? " lv-pagination-btn--active" : ""}`;
|
|
116
|
+
btn.textContent = String(i);
|
|
117
|
+
btn.setAttribute("data-page", String(i));
|
|
118
|
+
container.appendChild(btn);
|
|
119
|
+
}
|
|
120
|
+
const next = document.createElement("button");
|
|
121
|
+
next.className = "lv-pagination-btn";
|
|
122
|
+
next.textContent = ">";
|
|
123
|
+
next.disabled = page >= totalPages;
|
|
124
|
+
next.setAttribute("data-page", String(page + 1));
|
|
125
|
+
container.appendChild(next);
|
|
126
|
+
const info = document.createElement("span");
|
|
127
|
+
info.className = "lv-pagination-info";
|
|
128
|
+
info.textContent = `\u5171 ${total} \u6761`;
|
|
129
|
+
container.appendChild(info);
|
|
130
|
+
return container;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
exports.TimelineRenderer = TimelineRenderer;
|
|
135
|
+
/*! End of @composy/log-viewer-core | Powered by @composy/builder */
|
|
136
|
+
//# sourceMappingURL=TimelineRenderer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineRenderer.cjs","names":[],"sources":["../../src/renderers/TimelineRenderer.ts"],"sourcesContent":["/**\n * 时间线渲染器 - 将日志条目渲染为时间线 DOM\n */\n\nimport type { LogEntry, AnomalyType } from '../types'\nimport { ACTION_LABELS, ACTION_COLORS } from '../types'\nimport { formatDate, escapeHtml } from '../utils'\n\nconst ANOMALY_LABELS: Record<AnomalyType, string> = {\n 'off-hours': '非工作时间',\n sensitive: '敏感操作',\n 'high-frequency': '高频操作',\n none: '',\n}\n\n/**\n * TimelineRenderer - Timeline Renderer class\n */\nexport class TimelineRenderer {\n /**\n * 渲染时间线\n */\n render(entries: LogEntry[], expandedIds: Set<string>): HTMLElement {\n const container = document.createElement('div')\n container.className = 'lv-timeline'\n\n if (entries.length === 0) {\n container.innerHTML = `<div class=\"lv-empty\"><div class=\"lv-empty-icon\">--</div><div>暂无日志记录</div></div>`\n container.className = ''\n return container\n }\n\n for (const entry of entries) {\n container.appendChild(this.renderItem(entry, expandedIds.has(entry.id)))\n }\n\n return container\n }\n\n /**\n * 渲染单条时间线条目\n */\n renderItem(entry: LogEntry, expanded: boolean): HTMLElement {\n const item = document.createElement('div')\n item.className = 'lv-timeline-item'\n item.setAttribute('data-id', entry.id)\n\n const isAnomaly = entry.anomaly && entry.anomaly !== 'none'\n\n // Dot\n const dot = document.createElement('div')\n dot.className = `lv-timeline-dot${isAnomaly ? ' lv-timeline-dot--anomaly' : ''}`\n item.appendChild(dot)\n\n // Card\n const card = document.createElement('div')\n card.className = `lv-timeline-card${isAnomaly ? ' lv-timeline-card--anomaly' : ''}`\n\n // Header\n const header = document.createElement('div')\n header.className = 'lv-timeline-header'\n\n const time = document.createElement('span')\n time.className = 'lv-timeline-time'\n time.textContent = formatDate(entry.timestamp)\n header.appendChild(time)\n\n const user = document.createElement('span')\n user.className = 'lv-timeline-user'\n user.textContent = entry.user\n header.appendChild(user)\n\n const actionTag = document.createElement('span')\n actionTag.className = 'lv-action-tag'\n actionTag.textContent = ACTION_LABELS[entry.action] || entry.action\n actionTag.style.backgroundColor = ACTION_COLORS[entry.action] || '#8c8c8c'\n header.appendChild(actionTag)\n\n const moduleBadge = document.createElement('span')\n moduleBadge.className = 'lv-timeline-module'\n moduleBadge.textContent = entry.module\n header.appendChild(moduleBadge)\n\n if (entry.ip) {\n const ip = document.createElement('span')\n ip.className = 'lv-timeline-ip'\n ip.textContent = entry.ip\n header.appendChild(ip)\n }\n\n if (isAnomaly) {\n const badge = document.createElement('span')\n badge.className = 'lv-anomaly-badge'\n badge.textContent = ANOMALY_LABELS[entry.anomaly!]\n header.appendChild(badge)\n }\n\n card.appendChild(header)\n\n // Detail text\n if (entry.detail) {\n const detail = document.createElement('div')\n detail.className = 'lv-timeline-detail'\n detail.textContent = entry.detail\n card.appendChild(detail)\n }\n\n // Expand hint\n if (entry.changes && entry.changes.length > 0) {\n const hint = document.createElement('div')\n hint.className = 'lv-timeline-expand-hint'\n hint.textContent = expanded ? '[ 收起变更详情 ]' : `[ 查看变更详情 (${entry.changes.length} 个字段) ]`\n card.appendChild(hint)\n }\n\n item.appendChild(card)\n\n return item\n }\n\n /**\n * 渲染分页\n */\n renderPagination(page: number, pageSize: number, total: number): HTMLElement {\n const container = document.createElement('div')\n container.className = 'lv-pagination'\n\n const totalPages = Math.ceil(total / pageSize)\n if (totalPages <= 1) return container\n\n // Prev\n const prev = document.createElement('button')\n prev.className = 'lv-pagination-btn'\n prev.textContent = '<'\n prev.disabled = page <= 1\n prev.setAttribute('data-page', String(page - 1))\n container.appendChild(prev)\n\n // Page buttons\n const maxVisible = 7\n let startPage = Math.max(1, page - Math.floor(maxVisible / 2))\n const endPage = Math.min(totalPages, startPage + maxVisible - 1)\n if (endPage - startPage < maxVisible - 1) {\n startPage = Math.max(1, endPage - maxVisible + 1)\n }\n\n for (let i = startPage; i <= endPage; i++) {\n const btn = document.createElement('button')\n btn.className = `lv-pagination-btn${i === page ? ' lv-pagination-btn--active' : ''}`\n btn.textContent = String(i)\n btn.setAttribute('data-page', String(i))\n container.appendChild(btn)\n }\n\n // Next\n const next = document.createElement('button')\n next.className = 'lv-pagination-btn'\n next.textContent = '>'\n next.disabled = page >= totalPages\n next.setAttribute('data-page', String(page + 1))\n container.appendChild(next)\n\n // Info\n const info = document.createElement('span')\n info.className = 'lv-pagination-info'\n info.textContent = `共 ${total} 条`\n container.appendChild(info)\n\n return container\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 时间线渲染器 - 将日志条目渲染为时间线 DOM
|
|
3
|
+
*/
|
|
4
|
+
import type { LogEntry } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* TimelineRenderer - Timeline Renderer class
|
|
7
|
+
*/
|
|
8
|
+
export declare class TimelineRenderer {
|
|
9
|
+
/**
|
|
10
|
+
* 渲染时间线
|
|
11
|
+
*/
|
|
12
|
+
render(entries: LogEntry[], expandedIds: Set<string>): HTMLElement;
|
|
13
|
+
/**
|
|
14
|
+
* 渲染单条时间线条目
|
|
15
|
+
*/
|
|
16
|
+
renderItem(entry: LogEntry, expanded: boolean): HTMLElement;
|
|
17
|
+
/**
|
|
18
|
+
* 渲染分页
|
|
19
|
+
*/
|
|
20
|
+
renderPagination(page: number, pageSize: number, total: number): HTMLElement;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=TimelineRenderer.d.ts.map
|