Fix Control Plane login under /ui; store founding token in OpenBao
Rewrite templates that lost href/action during root_path rewrite; use native form controls for reliable login. Deploy image 0.1.2. Founding admin token canonical location: platform/operators/founding-admin/revenue.
This commit is contained in:
parent
4eab03346b
commit
856dc354d8
13 changed files with 199 additions and 186 deletions
|
|
@ -3,8 +3,8 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{% block title %}Target Revenue Control Plane{% endblock %}</title>
|
||||
<link rel="stylesheet" >
|
||||
<link rel="stylesheet" >
|
||||
<link rel="stylesheet" href="{{ root_path }}/static/whynot-design/styles/colors_and_type.css">
|
||||
<link rel="stylesheet" href="{{ root_path }}/static/whynot-design/styles/components.css">
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
|
|
@ -14,8 +14,17 @@
|
|||
</script>
|
||||
<script type="module" src="{{ root_path }}/static/whynot-design/index.js"></script>
|
||||
<style>
|
||||
body { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
|
||||
body { max-width: 960px; margin: 0 auto; padding: 1.5rem; font-family: system-ui, sans-serif; }
|
||||
form.wn-form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 480px; }
|
||||
form.wn-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
|
||||
form.wn-form input, form.wn-form select, form.wn-form textarea {
|
||||
padding: 0.5rem 0.6rem; font-size: 1rem; border: 1px solid #ccc; border-radius: 4px;
|
||||
}
|
||||
form.wn-form button[type=submit] {
|
||||
padding: 0.55rem 1rem; font-size: 1rem; cursor: pointer;
|
||||
background: #1a1a1a; color: #fff; border: none; border-radius: 4px; width: fit-content;
|
||||
}
|
||||
form.wn-form button[type=submit].secondary { background: #555; }
|
||||
.wn-flash { margin: 1rem 0; }
|
||||
table.wn-plain { width: 100%; border-collapse: collapse; }
|
||||
table.wn-plain th, table.wn-plain td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid #ddd; }
|
||||
|
|
@ -30,12 +39,12 @@
|
|||
<p>
|
||||
Signed in as <strong>{{ session_credential_label }}</strong>
|
||||
({{ session_rights }}) for <strong>{{ session_licensor_id }}</strong>
|
||||
· <a >Dashboard</a>
|
||||
· <a >Extensions</a>
|
||||
{% if session_rights in ("operator", "admin") %}· <a >Proposals</a>{% endif %}
|
||||
{% if session_rights == "admin" %}· <a >Credentials</a>{% endif %}
|
||||
· <a >Audit log</a>
|
||||
· <form method="post" style="display:inline"><button type="submit">Sign out</button></form>
|
||||
· <a href="{{ root_path }}/">Dashboard</a>
|
||||
· <a href="{{ root_path }}/extensions">Extensions</a>
|
||||
{% if session_rights in ("operator", "admin") %}· <a href="{{ root_path }}/proposals">Proposals</a>{% endif %}
|
||||
{% if session_rights == "admin" %}· <a href="{{ root_path }}/admin/credentials">Credentials</a>{% endif %}
|
||||
· <a href="{{ root_path }}/audit">Audit log</a>
|
||||
· <form method="post" action="{{ root_path }}/logout" style="display:inline"><button type="submit">Sign out</button></form>
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
|
|
@ -48,25 +57,18 @@
|
|||
<p style="margin-top:3rem;color:#888;font-size:0.85rem;">
|
||||
Pilot Control Plane (alpha/beta). First declared Phase:
|
||||
<code>trsl:phase:info-tech-canon-service-surface</code>
|
||||
(WP-0008-T05, 2026-08-05). Further Phases require an explicit declaration act.
|
||||
Visual language vendored from <code>whynot-design</code> — see
|
||||
<code>static/whynot-design/VENDORED.md</code>.
|
||||
(WP-0008-T05, 2026-08-05). Live at
|
||||
<a href="https://revenue.coulomb.social/ui/">revenue.coulomb.social/ui/</a>.
|
||||
</p>
|
||||
|
||||
<script>
|
||||
// whynot-design's wn-input/wn-select/wn-textarea/wn-button are plain Lit
|
||||
// components, not form-associated custom elements — their real <input>/
|
||||
// <select>/<button> live inside shadow DOM, invisible to an ancestor
|
||||
// <form>. Without this, clicking a wn-button[type=submit] does nothing,
|
||||
// and even if it did, none of the field values would be part of the POST.
|
||||
// This bridges both gaps generically, for every .wn-form on every page,
|
||||
// without touching the vendored library itself.
|
||||
// Mirror wn-* named fields into real form fields when Lit components are present.
|
||||
// Native <input>/<button> work without this; this keeps dual support.
|
||||
(function () {
|
||||
function readValue(el) {
|
||||
var native = el.shadowRoot && el.shadowRoot.querySelector("input, select, textarea");
|
||||
return native ? native.value : (el.value != null ? el.value : "");
|
||||
}
|
||||
|
||||
document.querySelectorAll("form").forEach(function (form) {
|
||||
form.addEventListener("submit", function () {
|
||||
form.querySelectorAll("[name]").forEach(function (el) {
|
||||
|
|
@ -84,7 +86,6 @@
|
|||
hidden.value = readValue(el);
|
||||
});
|
||||
});
|
||||
|
||||
form.querySelectorAll("wn-button[type=submit]").forEach(function (btn) {
|
||||
btn.addEventListener("click", function () {
|
||||
if (typeof form.requestSubmit === "function") form.requestSubmit();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue