fix: 日志面板默认常驻显示,移除关闭/清空/切换按钮

- 日志面板默认打开(移除 display:none)
- 移除关闭按钮、清空按钮、头部切换按钮
- 移除对应的事件处理和 CSS
This commit is contained in:
Metona Dev
2026-04-06 20:27:37 +08:00
parent c516755a5c
commit e999c420d1
3 changed files with 1 additions and 60 deletions
+1 -21
View File
@@ -12,21 +12,9 @@
<div id="app">
<!-- ═══════════════ 日志面板(左侧)═══════════════ -->
<aside class="log-panel" id="logPanel" style="display:none;">
<aside class="log-panel" id="logPanel">
<div class="log-panel-header">
<span class="log-panel-title">📋 执行日志</span>
<div class="log-panel-actions">
<button class="icon-btn log-btn" id="btnClearLog" title="清空日志">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
</svg>
</button>
<button class="icon-btn log-btn" id="btnCloseLog" title="关闭日志">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>
</svg>
</button>
</div>
</div>
<div class="log-panel-body" id="logPanelBody"></div>
</aside>
@@ -37,14 +25,6 @@
<!-- ═══════════════ 顶部导航 ═══════════════ -->
<header class="app-header">
<div class="header-left">
<button class="icon-btn" id="btnToggleLog" title="执行日志">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
</svg>
</button>
<span class="logo">🦙</span>
<span class="app-title">Metona Ollama</span>
<span class="app-version">v3.0.0</span>
-23
View File
@@ -43,29 +43,6 @@ export function initLogPanel(): void {
logBodyEl = document.querySelector('#logPanelBody')!;
logPanelEl = document.querySelector('#logPanel')!;
document.querySelector('#btnToggleLog')!.addEventListener('click', () => {
try {
const visible = logPanelEl!.style.display !== 'none';
logPanelEl!.style.display = visible ? 'none' : '';
document.querySelector('#mainWrap')!.classList.toggle('log-open', !visible);
} catch { /* ignore */ }
});
document.querySelector('#btnCloseLog')!.addEventListener('click', () => {
try {
logPanelEl!.style.display = 'none';
document.querySelector('#mainWrap')!.classList.remove('log-open');
} catch { /* ignore */ }
});
document.querySelector('#btnClearLog')!.addEventListener('click', () => {
try {
logs = [];
pendingEntries.length = 0;
if (logBodyEl) logBodyEl.innerHTML = '';
} catch { /* ignore */ }
});
logBodyEl.addEventListener('scroll', () => {
try {
const el = logBodyEl!;
-16
View File
@@ -110,22 +110,6 @@ html, body {
color: var(--text-primary);
}
.log-panel-actions {
display: flex;
gap: 4px;
}
.log-btn {
width: 28px;
height: 28px;
padding: 0;
}
.log-btn svg {
width: 14px;
height: 14px;
}
.log-panel-body {
flex: 1;
overflow-y: auto;