Files
cortiq-gateway/web/js/views/login.js
T
infosave2007 25f93d1a27
Docker / publish (push) Canceled after 0s
Release / crates-io (push) Canceled after 0s
Release / release (macos-14, aarch64-apple-darwin) (push) Canceled after 0s
Release / release (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Canceled after 0s
Release / release (windows-latest, x86_64-pc-windows-msvc) (push) Canceled after 0s
chore: ship the full working frontend + backend
The crates.io/release build shipped a STALE frontend (committed web/js was behind
the working tree), so the admin console hung on load. Commit the current working
web/js (app, api, dashboard, login, import view, i18n de/es/fr/tr/zh, css) and the
backend WIP (import.rs, admin/assets.rs) so the released console matches the dev
build. Verified: clean `cargo build --release`, empty-pool start, working
dashboard served.
2026-07-08 17:58:31 +03:00

47 lines
1.4 KiB
JavaScript
Vendored

// Login screen — admin token entry. Shown when there is no token or on 401.
import { h } from "../ui.js";
import { t } from "../i18n.js";
import { setToken } from "../api.js";
import { SITE_URL } from "../app.js";
export function renderLogin(onOk) {
const input = h("input", {
type: "password",
placeholder: t("login.tokenPlaceholder"),
autofocus: true,
});
const submit = () => {
const val = input.value.trim();
if (!val) return;
setToken(val);
onOk();
};
input.addEventListener("keydown", (e) => {
if (e.key === "Enter") submit();
});
return h(
"div",
{ class: "login-wrap" },
h(
"div",
{ class: "login-card" },
h(
"div",
{ class: "brand" },
h("b", { style: "font-size:20px" }, "allaigate"),
h("span", { class: "sub" }, t("brand.sub"))
),
h("h2", {}, t("login.title")),
h("p", { class: "sub" }, t("login.subtitle")),
h("label", { class: "field" }, h("span", {}, t("login.token")), input),
h("button", { class: "btn primary", style: "width:100%", onClick: submit }, t("login.submit")),
h("p", { class: "hint", style: "margin-top:16px" }, t("login.hint")),
h(
"p",
{ class: "hint", style: "margin-top:8px" },
h("a", { href: SITE_URL, target: "_blank", rel: "noopener" }, t("nav.billing") + " · api.allaigate.com ↗")
)
)
);
}