代码提交

This commit is contained in:
2025-07-17 23:00:52 +08:00
parent 7400f85c88
commit 3d3fe0cd96
17 changed files with 149 additions and 564 deletions

View File

@@ -40,6 +40,12 @@ class LogMonitorAdaptive {
enableFontSize: true, // 是否提供“字体大小 +/-”按钮
enableWordWrap: true, // 是否提供“换行/不换行”切换按钮
/* --- 暂停/继续 的回调函数 --- */
onTogglePause: () => {},
/* --- 创建完成 的回调函数 --- */
onCreated: () => {},
...opts
};
@@ -59,6 +65,11 @@ class LogMonitorAdaptive {
this.initDOM();
this.bindResize();
this.bindGlobalEvents();
//执行回调函数
if(this.cfg.onCreated && typeof this.cfg.onCreated === 'function'){
this.cfg.onCreated();
}
}
/* ------------------------ 初始化 ------------------------ */
@@ -332,6 +343,10 @@ class LogMonitorAdaptive {
this.pauseBtn.style.backgroundColor = this.isPaused
? (this.cfg.theme === 'dark' ? '#d32f2f' : '#ff5252')
: (this.cfg.theme === 'dark' ? '#444' : '#e7e7e7');
//执行回调函数
if(this.cfg.onTogglePause && typeof this.cfg.onTogglePause === 'function'){
this.cfg.onTogglePause(this.isPaused);
}
}
toggleTheme() {