diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index 351bc43..ebe3cba 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -172,7 +172,7 @@ body { #fs-body .msg-bubble { box-shadow: none; font-size: 15.5px; } #fs-body .tool-card { max-width: 100%; } #fs-body .tool-card pre { max-height: 65vh; } -#fs-viewer { position: fixed; inset: 0; z-index: 130; background: rgba(8,10,20,0.88); padding: 40px 14px 24px; overflow-y: auto; } +#fs-viewer { position: fixed; inset: 0; z-index: 130; background: rgba(8,10,20,0.88); padding: 40px 14px 24px; overflow: auto; /* 缩放后支持横纵滚动 */ } #fs-viewer.hidden { display: none; } .fs-panel { max-width: 860px; margin: 0 auto; background: #fff; border-radius: 14px; padding: 18px 20px; font-size: 15.5px; } .fs-close { @@ -196,6 +196,8 @@ body { white-space: pre-wrap; overflow-x: auto; max-height: 300px; overflow-y: auto; font-size: 12px; color: #55492a; } +/* 时间行在折叠体内,展开才可见;作卡片尾注 */ +.tool-card .tool-time { color: #b3a97f; margin-top: 6px; } .tool-card.error { background: #fdecea; border-color: #f2c4bd; color: #a3352a; } .tool-card .spin { display: inline-block; width: 1em; text-align: center; } .tool-card .tool-args-full { color: #6b5b2a; } diff --git a/app/server/public/index.html b/app/server/public/index.html index fc2d680..6051912 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -301,10 +301,10 @@ - - - - - + + + + + diff --git a/app/server/public/js/tasks.js b/app/server/public/js/tasks.js index 73ffc50..d431fe7 100644 --- a/app/server/public/js/tasks.js +++ b/app/server/public/js/tasks.js @@ -318,8 +318,9 @@ function renderToolCard(id, name, argsStr, createdAt) { '' + esc(name) + '' + '' + esc(toolArgsSummary(name, argsStr)) + '' + '
' + esc(toolArgsFull(argsStr)) + '
' + - '
执行中…
' + - '
' + fmtTime(createdAt || Date.now()) + '
'; + '
执行中…
' + + // 时间行/复制按钮在折叠体内:展开卡片才可见 + '
' + fmtTime(createdAt || Date.now()) + '
'; return div; } @@ -633,10 +634,13 @@ const ui = { openFullscreen(el) { const body = $('fs-body'); body.innerHTML = ''; + body.style.zoom = ''; // 深拷贝并去掉 id:保留原类名使气泡/工具卡样式在查看器内照常生效,且避免 id 重复 const clone = el.cloneNode(true); clone.removeAttribute('id'); clone.querySelectorAll('[id]').forEach(function (n) { n.removeAttribute('id'); }); + // 全屏查看直接展开参数/结果,方便观看 + clone.querySelectorAll('details').forEach(function (d) { d.open = true; }); body.appendChild(clone); $('fs-viewer').classList.remove('hidden'); }, @@ -862,6 +866,28 @@ document.getElementById('messages').addEventListener('dblclick', function (e) { if (el) ui.openFullscreen(el); }); +// 全屏查看器双指缩放:页面 viewport 是 user-scalable=no(原生捏合被禁), +// 在查看器内接管双指手势,用 CSS zoom 缩放内容(1~4 倍,关闭时重置)。 +(function () { + const viewer = document.getElementById('fs-viewer'); + if (!viewer) return; + let startDist = 0, startZoom = 1, pinching = false; + const tdist = t => Math.hypot(t[0].clientX - t[1].clientX, t[0].clientY - t[1].clientY); + viewer.addEventListener('touchstart', function (e) { + if (e.touches.length !== 2) { pinching = false; return; } + pinching = true; + startDist = tdist(e.touches) || 1; + startZoom = Number($('fs-body').style.zoom) || 1; + }, { passive: true }); + viewer.addEventListener('touchmove', function (e) { + if (!pinching || e.touches.length < 2) return; + e.preventDefault(); // 双指期间阻止滚动,手势归缩放 + $('fs-body').style.zoom = Math.min(4, Math.max(1, startZoom * tdist(e.touches) / startDist)) || ''; + }, { passive: false }); + viewer.addEventListener('touchend', function (e) { if (e.touches.length < 2) pinching = false; }, { passive: true }); + viewer.addEventListener('touchcancel', function () { pinching = false; }, { passive: true }); +})(); + // ---------- Tab 注册 ---------- window.tabModules = window.tabModules || {}; tabModules.tasks = {