warpgate/templates/web/config.html
grabbit ba1cae7f75 Add daemon web UI, JSON API, and config hot-reload engine
- New: axum web server on port 8090 with htmx dashboard
- New: JSON API endpoints (/api/status, /api/config, /api/bwlimit)
- New: config diff engine with 4-tier change classification
- New: tiered config hot-reload (live/protocol/per-share/global)
- Refactor: supervisor loop uses mpsc command channel (recv_timeout)
- Refactor: supervisor updates shared DaemonStatus every poll cycle
- Dependencies: tokio, axum, askama, tower-http

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:18:20 +08:00

56 lines
2.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Warpgate — Config</title>
<style>
:root {
--bg: #0f1117; --surface: #1a1d27; --border: #2a2d3a;
--text: #e1e4ed; --text-muted: #8b8fa3; --accent: #6c8aff;
--green: #4ade80; --red: #f87171;
--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); padding: 24px; max-width: 960px; margin: 0 auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.breadcrumb { font-size: 0.85em; color: var(--text-muted); margin-bottom: 16px; }
h1 { font-size: 1.4em; margin-bottom: 16px; }
.message { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9em; }
.message-error { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid rgba(248,113,113,0.3); }
.message-ok { background: rgba(74,222,128,0.15); color: var(--green); border: 1px solid rgba(74,222,128,0.3); }
textarea {
width: 100%; min-height: 500px; background: var(--surface); color: var(--text);
border: 1px solid var(--border); border-radius: 8px; padding: 16px;
font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace; font-size: 0.85em;
line-height: 1.5; resize: vertical; tab-size: 4;
}
textarea:focus { outline: none; border-color: var(--accent); }
.form-actions { margin-top: 12px; display: flex; gap: 12px; }
.btn { display: inline-block; padding: 8px 20px; border-radius: 6px; font-size: 0.9em; font-weight: 500; cursor: pointer; border: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); text-decoration: none; text-align: center; }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
</style>
</head>
<body>
<div class="breadcrumb"><a href="/">Dashboard</a> / Config</div>
<h1>Configuration Editor</h1>
{% if let Some(msg) = message %}
<div class="message {% if is_error %}message-error{% else %}message-ok{% endif %}">{{ msg }}</div>
{% endif %}
<form method="post" action="/config">
<textarea name="toml" spellcheck="false">{{ toml_content }}</textarea>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Apply Config</button>
<a href="/" class="btn btn-secondary">Cancel</a>
</div>
</form>
</body>
</html>