feat: rebuild warm operations workbench

This commit is contained in:
Codex
2026-07-30 14:49:33 +08:00
parent 25c853dea8
commit 570edf6bb2
88 changed files with 13413 additions and 2250 deletions
+57 -52
View File
@@ -1,4 +1,5 @@
import { type FormEvent, useEffect, useState } from 'react';
import { Button, Card, Title } from 'animal-island-ui';
import type { ConsoleAuthDataSource, ConsoleAuthStatus } from './console-auth.js';
import { createConsoleAuthApiDataSource } from './console-auth.js';
@@ -70,66 +71,70 @@ export function ConsoleAuthSettings({
<section className="settings-page" aria-labelledby="password-protection-title">
<header className="page-heading">
<p className="eyebrow">SYSTEM SETTINGS</p>
<h1 id="password-protection-title"></h1>
<h1 id="password-protection-title">
<Title color="app-green"></Title>
</h1>
<p></p>
<p> HTTP使 HTTPS</p>
<p> SimAdmin 访</p>
</header>
{error && !status ? <p role="alert">{error}</p> : null}
{status ? (
<form className="settings-card auth-settings" onSubmit={(event) => void save(event)}>
<label className="toggle-row">
<span>
<strong></strong>
<small>访</small>
</span>
<input
type="checkbox"
checked={enabled}
onChange={(event) => {
setEnabled(event.target.checked);
setNotice('');
}}
/>
</label>
{enabled && !status.configured ? (
<div className="auth-password-fields">
<label htmlFor="new-console-password">访</label>
<Card pattern="default" className="settings-card">
<form className="auth-settings" onSubmit={(event) => void save(event)}>
<label className="toggle-row">
<span>
<strong></strong>
<small>访</small>
</span>
<input
id="new-console-password"
type="password"
autoComplete="new-password"
value={password}
onChange={(event) => setPassword(event.target.value)}
type="checkbox"
checked={enabled}
onChange={(event) => {
setEnabled(event.target.checked);
setNotice('');
}}
/>
<label htmlFor="confirm-console-password">访</label>
<input
id="confirm-console-password"
type="password"
autoComplete="new-password"
value={confirmation}
onChange={(event) => setConfirmation(event.target.value)}
/>
<small> 8 </small>
</div>
) : null}
{status.configured ? <p>访 API </p> : null}
{error ? <p role="alert">{error}</p> : null}
{notice ? <p role="status">{notice}</p> : null}
<button type="submit" disabled={saving}>
{saving ? '正在保存…' : '保存密码保护设置'}
</button>
{status.protectionEnabled && status.authenticated ? (
<button
type="button"
onClick={() => {
void source.logout().then(() => window.location.reload());
}}
>
退
</button>
) : null}
</form>
</label>
{enabled && !status.configured ? (
<div className="auth-password-fields">
<label htmlFor="new-console-password">访</label>
<input
id="new-console-password"
type="password"
autoComplete="new-password"
value={password}
onChange={(event) => setPassword(event.target.value)}
/>
<label htmlFor="confirm-console-password">访</label>
<input
id="confirm-console-password"
type="password"
autoComplete="new-password"
value={confirmation}
onChange={(event) => setConfirmation(event.target.value)}
/>
<small> 8 </small>
</div>
) : null}
{status.configured ? <p>访 API </p> : null}
{error ? <p role="alert">{error}</p> : null}
{notice ? <p role="status">{notice}</p> : null}
<Button htmlType="submit" type="primary" disabled={saving} loading={saving}>
{saving ? '正在保存…' : '保存密码保护设置'}
</Button>
{status.protectionEnabled && status.authenticated ? (
<Button
htmlType="button"
onClick={() => {
void source.logout().then(() => window.location.reload());
}}
>
退
</Button>
) : null}
</form>
</Card>
) : !error ? (
<p role="status"></p>
) : null}