chore: 初始提交 - 移除所有硬编码凭据,统一从环境变量读取
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
.wrap { display: grid; gap: 8px; padding: 12px }
|
||||
.actions { display: flex; gap: 8px }
|
||||
.btn { padding: 8px 12px; border: none; background: #222; color: #fff; border-radius: 6px; cursor: pointer }
|
||||
.logbox { height: 420px; border: 1px dashed #aaa; padding: 8px; overflow: auto; background: #fafafa; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; white-space: pre-wrap }
|
||||
@@ -0,0 +1,30 @@
|
||||
const out = document.getElementById('debug-output')
|
||||
const btnCopy = document.getElementById('btn-copy')
|
||||
const btnRefresh = document.getElementById('btn-refresh')
|
||||
const btnClear = document.getElementById('btn-clear')
|
||||
|
||||
const render = lines => {
|
||||
out.textContent = lines.join('\n')
|
||||
out.scrollTop = out.scrollHeight
|
||||
}
|
||||
|
||||
const load = async () => {
|
||||
const res = await fetch('/api/debug/logs?limit=5000')
|
||||
const data = await res.json()
|
||||
if (data.ok) render(data.lines)
|
||||
}
|
||||
|
||||
btnCopy.addEventListener('click', async () => {
|
||||
const text = out.textContent || ''
|
||||
try { await navigator.clipboard.writeText(text) } catch {}
|
||||
})
|
||||
|
||||
btnRefresh.addEventListener('click', load)
|
||||
|
||||
btnClear.addEventListener('click', async () => {
|
||||
await fetch('/api/debug/clear', { method: 'POST' })
|
||||
await load()
|
||||
})
|
||||
|
||||
setInterval(load, 5000)
|
||||
load()
|
||||
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Yang's Toolbox · 调试信息</title>
|
||||
<link rel="stylesheet" href="/common/common.css" />
|
||||
<link rel="stylesheet" href="/tools/debug/debug.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="wrap">
|
||||
<div class="actions">
|
||||
<button id="btn-copy" class="btn">复制调试信息</button>
|
||||
<button id="btn-refresh" class="btn">刷新</button>
|
||||
<button id="btn-clear" class="btn">清空</button>
|
||||
</div>
|
||||
<div id="debug-output" class="logbox"></div>
|
||||
</div>
|
||||
</main>
|
||||
<script src="/tools/debug/debug.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user