The portal in English and Turkish: a catalogue per language, a switcher at the foot of every page, landing.language, Turkish numbers and dates
Every template and handler message in internal/web goes through a JSON
catalogue under internal/web/locales/<code>/, with English as the fallback.
The language is the person's choice (a cookie set by /_lang/{code}), else
Accept-Language, else landing.language. Tests refuse a key some language
lacks, a translation with other arguments than English, and template text
left in English.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
30f7f3474a
commit
11231d8c2b
113 files changed
+8091
-1981
No files matched your search
@@ -1,46 +1,47 @@
|
||||
{{define "admin_guard"}}<!doctype html>
|
||||
<html lang="en"><head>
|
||||
<html lang="{{lang}}"><head>
|
||||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>Guardrails · llmgw</title><link rel="stylesheet" href="{{stylesheet}}">
|
||||
<title>{{t "guard.title"}} · llmgw</title><link rel="stylesheet" href="{{stylesheet}}">
|
||||
</head><body><div class="wrap">
|
||||
<header>
|
||||
<h1>Guardrails</h1>
|
||||
<p class="sub">What the policies did, where, and by which rule — names and counts, never what was written.</p>
|
||||
<h1>{{t "guard.title"}}</h1>
|
||||
<p class="sub">{{t "guard.sub"}}</p>
|
||||
{{template "nav" .Nav}}
|
||||
</header>
|
||||
{{if .Error}}<p class="error" role="alert">{{.Error}}</p>{{end}}
|
||||
|
||||
<h2>Policies</h2>
|
||||
<h2>{{t "guard.policies"}}</h2>
|
||||
{{if .Policies}}
|
||||
<p>Defined in <code>server.yaml</code>: {{range $i, $p := .Policies}}{{if $i}}, {{end}}<code>{{$p}}</code>{{end}}.
|
||||
Applied to every request: {{if .Default}}{{range $i, $p := .Default}}{{if $i}}, {{end}}<code>{{$p}}</code>{{end}}{{else}}none{{end}}.</p>
|
||||
<p>{{th "guard.defined_in"}} {{range $i, $p := .Policies}}{{if $i}}, {{end}}<code>{{$p}}</code>{{end}}.
|
||||
{{t "guard.applied"}} {{if .Default}}{{range $i, $p := .Default}}{{if $i}}, {{end}}<code>{{$p}}</code>{{end}}{{else}}{{t "common.none"}}{{end}}.</p>
|
||||
{{if .Attachments}}
|
||||
<table class="rows">
|
||||
<tr><th>Scope</th><th>Who</th><th>Policy</th></tr>
|
||||
<tr><th>{{t "guard.col.scope"}}</th><th>{{t "guard.col.who"}}</th><th>{{t "guard.col.policy"}}</th></tr>
|
||||
{{range .Attachments}}<tr><td>{{.Scope}}</td><td>{{.Who}}</td><td><code>{{.Policy}}</code></td></tr>{{end}}
|
||||
</table>
|
||||
{{else}}<p class="sub">Attached nowhere else. <code>llmgw ctl guard attach project:ORG/TEAM/PROJECT POLICY</code> attaches one.</p>{{end}}
|
||||
{{else}}<p class="sub">{{th "guard.attached_nowhere"}}</p>{{end}}
|
||||
{{else}}
|
||||
<p>No policies: add a <code>guard:</code> section to <code>server.yaml</code> (docs/guardrails.md).</p>
|
||||
<p>{{th "guard.no_policies"}}</p>
|
||||
{{end}}
|
||||
|
||||
<h2>What they did</h2>
|
||||
<p class="sub">Over the last
|
||||
<h2>{{t "guard.what_they_did"}}</h2>
|
||||
<p class="sub">{{t "guard.over_last"}}
|
||||
{{range .Windows}}{{if eq . $.Window}}<strong>{{.}}</strong>{{else}}<a href="?window={{.}}">{{.}}</a>{{end}} {{end}}</p>
|
||||
{{if .Counts}}
|
||||
<table class="rows">
|
||||
<tr><th>Where</th><th>Action</th><th>Policy</th><th>Category</th><th class="num">Requests</th></tr>
|
||||
{{range .Counts}}<tr><td>{{.Where}}</td><td>{{.Action}}</td><td><code>{{.Policy}}</code></td><td>{{.Category}}</td><td class="num">{{.Count}}</td></tr>{{end}}
|
||||
<tr><th>{{t "guard.col.where"}}</th><th>{{t "guard.col.action"}}</th><th>{{t "guard.col.policy"}}</th><th>{{t "guard.col.category"}}</th><th class="num">{{t "guard.col.requests"}}</th></tr>
|
||||
{{range .Counts}}<tr><td>{{.Where}}</td><td>{{.Action}}</td><td><code>{{.Policy}}</code></td><td>{{.Category}}</td><td class="num">{{count .Count}}</td></tr>{{end}}
|
||||
</table>
|
||||
{{else}}<p class="sub">Nothing flagged, redacted or blocked.</p>{{end}}
|
||||
{{else}}<p class="sub">{{t "guard.nothing"}}</p>{{end}}
|
||||
|
||||
{{if .Events}}
|
||||
<h2>Recent</h2>
|
||||
<h2>{{t "guard.recent"}}</h2>
|
||||
<table class="rows">
|
||||
<tr><th>When (UTC)</th><th>Request</th><th>Where</th><th>Model</th><th>Action</th><th>Policy</th><th>Category</th><th class="num">Status</th><th class="num">ms</th></tr>
|
||||
<tr><th>{{t "guard.col.when"}}</th><th>{{t "guard.col.request"}}</th><th>{{t "guard.col.where"}}</th><th>{{t "guard.col.model"}}</th><th>{{t "guard.col.action"}}</th><th>{{t "guard.col.policy"}}</th><th>{{t "guard.col.category"}}</th><th class="num">{{t "guard.col.status"}}</th><th class="num">ms</th></tr>
|
||||
{{range .Events}}<tr><td>{{.At}}</td><td><code>{{.RequestID}}</code></td><td>{{.Where}}</td><td>{{.Model}}</td>
|
||||
<td>{{.Action}}</td><td><code>{{.Policy}}</code></td><td>{{.Category}}</td><td class="num">{{.Status}}</td><td class="num">{{.Ms}}</td></tr>{{end}}
|
||||
<td>{{.Action}}</td><td><code>{{.Policy}}</code></td><td>{{.Category}}</td><td class="num">{{.Status}}</td><td class="num">{{count .Ms}}</td></tr>{{end}}
|
||||
</table>
|
||||
<p class="sub"><code>llmgw ctl request ID</code> says what else a request went through.</p>
|
||||
<p class="sub">{{th "guard.request_hint"}}</p>
|
||||
{{end}}
|
||||
<footer><span>llmgw {{.Version}}</span>{{template "langs"}}</footer>
|
||||
</div></body></html>{{end}}
|
||||
Reference in new issue
Block a user