thread-master/backend/dev-console/dist/index.html

225 lines
7.2 KiB
HTML
Raw Normal View History

<!doctype html>
<html lang="zh-Hant">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>巡樓 Dev Console</title>
<style>
:root {
--bg: #f4f6f8;
--card: #fff;
--ink: #1a2332;
--muted: #5a6578;
--line: #d8dee8;
--brand: #2a9d8f;
--danger: #c0392b;
--ok: #1e7a4c;
--mono: ui-monospace, 'SF Mono', Menlo, monospace;
--sans: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
margin: 0;
font-family: var(--sans);
background: var(--bg);
color: var(--ink);
line-height: 1.5;
}
header {
padding: 1rem 1.25rem;
background: var(--card);
border-bottom: 1px solid var(--line);
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
}
header h1 { margin: 0; font-size: 1.1rem; }
header p { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.85rem; }
main {
max-width: 960px;
margin: 0 auto;
padding: 1rem 1.25rem 3rem;
display: grid;
gap: 1rem;
}
section {
background: var(--card);
border: 1px solid var(--line);
border-radius: 12px;
padding: 1rem 1.1rem;
}
section h2 {
margin: 0 0 0.75rem;
font-size: 0.95rem;
letter-spacing: 0.02em;
}
.row {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
margin-bottom: 0.5rem;
}
label { font-size: 0.82rem; color: var(--muted); min-width: 5.5rem; }
input, select, textarea {
font: inherit;
padding: 0.45rem 0.6rem;
border: 1px solid var(--line);
border-radius: 8px;
background: #fff;
min-width: 0;
}
input { flex: 1; }
button {
font: inherit;
padding: 0.45rem 0.85rem;
border: 1px solid var(--line);
border-radius: 999px;
background: #fff;
cursor: pointer;
}
button:hover { border-color: var(--brand); color: var(--brand); }
button.primary {
background: var(--brand);
border-color: var(--brand);
color: #fff;
}
button.primary:hover { filter: brightness(1.05); color: #fff; }
button.danger { color: var(--danger); }
.status { font-size: 0.82rem; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.list {
margin: 0.5rem 0 0;
padding: 0;
list-style: none;
border: 1px solid var(--line);
border-radius: 8px;
overflow: hidden;
}
.list li {
padding: 0.55rem 0.75rem;
border-bottom: 1px solid var(--line);
cursor: pointer;
display: flex;
justify-content: space-between;
gap: 0.75rem;
font-size: 0.9rem;
}
.list li:last-child { border-bottom: none; }
.list li:hover { background: #f0faf8; }
.list li.active { background: #e6f5f2; font-weight: 600; }
.list li .meta { color: var(--muted); font-size: 0.78rem; }
pre, .log {
margin: 0.5rem 0 0;
padding: 0.75rem;
background: #0f1419;
color: #d6e2f0;
border-radius: 8px;
font-family: var(--mono);
font-size: 0.78rem;
overflow: auto;
max-height: 280px;
white-space: pre-wrap;
word-break: break-word;
}
.steps { margin: 0.5rem 0 0; font-size: 0.85rem; }
.steps div { padding: 0.2rem 0; }
.badge {
display: inline-block;
padding: 0.1rem 0.45rem;
border-radius: 999px;
font-size: 0.72rem;
background: #eef2f7;
}
.badge.running { background: #fff3cd; }
.badge.succeeded, .badge.completed { background: #d4edda; }
.badge.failed { background: #f8d7da; }
.badge.queued, .badge.pending { background: #e8eef5; }
textarea { width: 100%; min-height: 120px; font-family: var(--mono); font-size: 0.78rem; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.35rem; }
</style>
<script type="module" crossorigin src="/assets/index-56hNfpGK.js"></script>
</head>
<body>
<header>
<div>
<h1>巡樓 Dev Console</h1>
<p>暫用開發面板 · 人設 + 8D 公開爬蟲 · 重做前端前夠用就好</p>
</div>
<div class="status" id="connStatus">尚未連線</div>
</header>
<main>
<section>
<h2>1. 登入</h2>
<div class="row">
<label for="tenantId">Tenant</label>
<input id="tenantId" value="default" />
</div>
<div class="row">
<label for="email">Email</label>
<input id="email" type="email" placeholder="you@example.com" />
</div>
<div class="row">
<label for="password">密碼</label>
<input id="password" type="password" placeholder="至少 8 碼" />
</div>
<div class="row">
<button class="primary" id="btnLogin">登入</button>
<button id="btnRegister">註冊</button>
<button id="btnLogout" class="danger">登出</button>
<span class="status" id="authStatus"></span>
</div>
</section>
<section>
<h2>2. 人設</h2>
<div class="row">
<label for="displayName">名稱</label>
<input id="displayName" placeholder="新人設" />
<button class="primary" id="btnCreatePersona">建立</button>
<button id="btnRefreshPersonas">重新載入</button>
</div>
<ul class="list" id="personaList"></ul>
<p class="hint">點選一筆人設後,下方可跑 8D 分析。</p>
</section>
<section>
<h2>3. 8D 風格分析(公開爬蟲,不需 session</h2>
<div class="row">
<label for="benchmark">對標帳號</label>
<input id="benchmark" placeholder="@username" />
<button class="primary" id="btnStart8d" disabled>開始 8D</button>
</div>
<p class="hint">需先啟動 Go API:8890與 Node workerstyle-8d。設定頁要有研究用 AI API key。</p>
<div class="status" id="jobHint"></div>
<div class="row" style="margin-top: 0.5rem">
<label for="jobId">Job ID</label>
<input id="jobId" placeholder="自動填入或手動貼上" />
<button id="btnPollJob">查詢一次</button>
<button id="btnAutoPoll">自動輪詢</button>
</div>
<div class="steps" id="jobSteps"></div>
<pre id="jobDetail">(尚無任務)</pre>
</section>
<section>
<h2>4. 人設詳情</h2>
<div class="row">
<button id="btnReloadPersona" disabled>重新載入選中人設</button>
<span class="status" id="personaMeta"></span>
</div>
<textarea id="personaDetail" readonly placeholder="選中人設後顯示 style_profile 等欄位"></textarea>
</section>
<section>
<h2>Log</h2>
<pre class="log" id="log"></pre>
</section>
</main>
</body>
</html>