UI: use gateway token for login gate auth

This commit is contained in:
Val Alexander
2026-02-22 05:39:09 -06:00
parent 3a65e4b523
commit 13944f773f
5 changed files with 7 additions and 6 deletions

View File

@@ -140,7 +140,7 @@ export const en: TranslationMap = {
},
login: {
subtitle: "Gateway Dashboard",
passwordPlaceholder: "optional",
tokenPlaceholder: "paste gateway token",
},
chat: {
disconnected: "Disconnected from gateway.",

View File

@@ -142,7 +142,7 @@ export const pt_BR: TranslationMap = {
},
login: {
subtitle: "Painel do Gateway",
passwordPlaceholder: "opcional",
tokenPlaceholder: "cole o token do gateway",
},
chat: {
disconnected: "Desconectado do gateway.",

View File

@@ -139,7 +139,7 @@ export const zh_CN: TranslationMap = {
},
login: {
subtitle: "网关仪表盘",
passwordPlaceholder: "可选",
tokenPlaceholder: "粘贴网关令牌",
},
chat: {
disconnected: "已断开与网关的连接。",

View File

@@ -139,7 +139,7 @@ export const zh_TW: TranslationMap = {
},
login: {
subtitle: "閘道儀表板",
passwordPlaceholder: "可選",
tokenPlaceholder: "貼上閘道令牌",
},
chat: {
disconnected: "已斷開與網關的連接。",

View File

@@ -30,15 +30,16 @@ export function renderLoginGate(state: AppViewState) {
/>
</label>
<label class="field">
<span>${t("overview.access.password")}</span>
<span>${t("overview.access.token")}</span>
<input
type="password"
.value=${state.password}
@input=${(e: Event) => {
const v = (e.target as HTMLInputElement).value;
state.password = v;
state.applySettings({ ...state.settings, token: v });
}}
placeholder="${t("login.passwordPlaceholder")}"
placeholder="${t("login.tokenPlaceholder")}"
@keydown=${(e: KeyboardEvent) => {
if (e.key === "Enter") {
state.connect();