refactor(admin-web): polish Chinese UI and bits-ui controls

Map roles to Chinese labels, remove ADR/spec wording from the surface, and replace native selects/checkboxes/modals with bits-ui Select, Checkbox, Switch, Dialog, Label, and Collapsible.
This commit is contained in:
2026-07-11 12:46:54 +08:00
parent 552c1c353e
commit 0968545b5a
17 changed files with 586 additions and 235 deletions
+23
View File
@@ -1,3 +1,10 @@
import {
ORG_ROLE_LABELS,
PERMISSION_ROLE_LABELS,
type OrgRole,
type PermissionRole
} from './constants';
export function fmtDate(iso: string): string {
if (!iso) return '—';
const d = new Date(iso);
@@ -26,3 +33,19 @@ export function fmtCost(usd: number | null): string {
export function fmtNum(n: number): string {
return n.toLocaleString();
}
export function orgRoleLabel(role: string): string {
const key = role.toUpperCase() as OrgRole;
return ORG_ROLE_LABELS[key] ?? role;
}
export function permissionRoleLabel(role: string): string {
const key = role.toUpperCase() as PermissionRole;
return PERMISSION_ROLE_LABELS[key] ?? role;
}
export function providerModeLabel(mode: string): string {
if (mode === 'BYOK') return '自带密钥';
if (mode === 'PLATFORM_MANAGED') return '平台托管';
return mode;
}