feat(webui): templates + static assets; SSE broadcast; link cards; link summary endpoint; raw soju client store; UI polish
- Switch UI to Go html/templates and embedded /static (Pico.css-compatible) - Add Server.Broadcast and normalize SSE channel keys to lowercase - Implement /api/linkcard (OG/Twitter) and /api/linksummary (24h cache) - Wire Store into raw soju client for CHATHISTORY LATEST fallback
This commit is contained in:
parent
cbd798dfd5
commit
8a6111aeb5
8 changed files with 537 additions and 293 deletions
12
internal/httpapi/templates/dashboard.tmpl
Normal file
12
internal/httpapi/templates/dashboard.tmpl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{{ define "content" }}
|
||||
<main class="container">
|
||||
<aside class="sidebar">
|
||||
<nav id="chanlist"></nav>
|
||||
</aside>
|
||||
<section class="chat">
|
||||
<div id="tail"></div>
|
||||
</section>
|
||||
</main>
|
||||
{{ end }}
|
||||
{{ template "layout.tmpl" . }}
|
||||
|
||||
27
internal/httpapi/templates/layout.tmpl
Normal file
27
internal/httpapi/templates/layout.tmpl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{{ define "layout.tmpl" }}
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>{{ .Title }} · sojuboy</title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/@picocss/pico@2/css/pico.min.css">
|
||||
<link rel="stylesheet" href="/static/app.css">
|
||||
<script defer src="/static/app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="nav">
|
||||
<div><a class="brand" href="/">sojuboy</a></div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/summarizer">Summarizer</a></li>
|
||||
<li><a href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
{{ block "content" . }}{{ end }}
|
||||
<footer><small>{{ .Version }} ({{ .Commit }})</small></footer>
|
||||
</body>
|
||||
</html>
|
||||
{{ end }}
|
||||
|
||||
14
internal/httpapi/templates/summarizer.tmpl
Normal file
14
internal/httpapi/templates/summarizer.tmpl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{{ define "content" }}
|
||||
<main class="container">
|
||||
<article>
|
||||
<h3>On-demand summarization</h3>
|
||||
<label>Channel<select id="channel"></select></label>
|
||||
<label>Window<input id="window" value="6h"></label>
|
||||
<label><input type="checkbox" id="push"> Send via Pushover</label>
|
||||
<button id="btn" onclick="summarize()">Summarize</button>
|
||||
<pre id="out"></pre>
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
{{ template "layout.tmpl" . }}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue