Phase 0: turn Supermarket into a Dockerized local web app
Replace the old Go TUI with a web app (port 8470) that runs in a container as a CoreDesktop sibling: - cmd/supermarket server with htmx web UI: dashboard, company profile, inventory (partners/competitors), AI and credential settings, and a Core & Hermes page - SQLite storage and a secrets store under ~/.local/share/supermarket - AI providers (Anthropic, OpenAI-compatible) behind one interface - MCP server and a Hermes bridge to the Federated Core MCP hub - Import of the old Coremarketing TUI's state - install.sh / update.sh / lib.sh, Dockerfile, compose.yaml, the bin/supermarket launcher and hermes/setup.sh Posting is not wired back up yet; that comes in Phase 1. See PLAN.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
{{define "content"}}{{with .Data}}{{$set := .Set}}
|
||||
<nav class="tabs">
|
||||
<a href="/settings/ai">AI provider</a>
|
||||
<a href="/settings/credentials" aria-current="page">Credentials</a>
|
||||
</nav>
|
||||
<h1>Credentials</h1>
|
||||
<p class="lede">Kept in <code>secrets.json</code> in Supermarket's data folder, readable only by you. Saved values are never shown: leave a field empty to keep what's saved.</p>
|
||||
|
||||
<form method="post" action="/settings/credentials">
|
||||
{{$group := ""}}
|
||||
{{range .Fields}}
|
||||
{{if ne .Group $group}}{{if $group}}</section>{{end}}{{$group = .Group}}<section class="card"><h2>{{.Group}}</h2>{{end}}
|
||||
<div class="secret">
|
||||
<label>{{.Label}}
|
||||
<input type="password" name="{{.Name}}" autocomplete="off" placeholder="{{if index $set .Name}}saved — type to replace{{else}}not set{{end}}">
|
||||
{{if .Help}}<span class="help">{{.Help}}</span>{{end}}
|
||||
</label>
|
||||
{{if index $set .Name}}<label class="check small"><input type="checkbox" name="remove:{{.Name}}"> remove</label>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if $group}}</section>{{end}}
|
||||
<div class="actions"><button type="submit">Save</button></div>
|
||||
</form>
|
||||
|
||||
<section class="card">
|
||||
<h2>Sign in to post</h2>
|
||||
<div class="connect">
|
||||
<div>
|
||||
<h3>X</h3>
|
||||
{{with index .Connections "x"}}{{if .Account}}<p>Connected as @{{.Account}}, {{ago .At}}.</p>{{end}}{{end}}
|
||||
{{if and (index $set .XToken) (not (index .Connections "x").Account)}}<p>A token is saved.</p>{{end}}
|
||||
<p class="help">In the X developer portal, add this callback URL to your app: <code>{{.XRedirect}}</code></p>
|
||||
<form method="post" action="/auth/x/start"><button type="submit" {{if not (index $set "x.client_id")}}disabled{{end}}>{{if index $set .XToken}}Reconnect{{else}}Connect{{end}} X</button></form>
|
||||
</div>
|
||||
<div>
|
||||
<h3>LinkedIn</h3>
|
||||
{{with index .Connections "linkedin"}}{{if .Account}}<p>Connected, {{ago .At}}.</p>{{end}}{{end}}
|
||||
{{if and (index $set .LIToken) (not (index .Connections "linkedin").Account)}}<p>A token is saved.</p>{{end}}
|
||||
<p class="help">In your LinkedIn app's Auth settings, add this redirect URL: <code>{{.LIRedirect}}</code></p>
|
||||
<form method="post" action="/auth/linkedin/start"><button type="submit" {{if not (and (index $set "linkedin.client_id") (index $set "linkedin.client_secret"))}}disabled{{end}}>{{if index $set .LIToken}}Reconnect{{else}}Connect{{end}} LinkedIn</button></form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}{{end}}
|
||||
Reference in New Issue
Block a user