feat(web): pre-fill "system" user ID on login form with hint note

Default User ID to "system" and add i18n hint text explaining it
grants full system access, reducing friction for admin login.
This commit is contained in:
viettranx committed 2026-03-28 12:57:52 +07:00
1 parent 06ee648392
commit 0cfe5800ca
4 files changed
+9 -3

No files matched your search

+1
View File
@@ -13,6 +13,7 @@
"token": {
"userId": "User ID",
"userIdPlaceholder": "your-user-id",
"userIdHint": "Use \"system\" for full system access",
"gatewayToken": "Gateway Token",
"tokenPlaceholder": "Bearer token",
"connect": "Connect",
+2 -1
View File
@@ -33,7 +33,8 @@
"gatewayToken": "Gateway Token",
"tokenPlaceholder": "Bearer token",
"userId": "User ID",
"userIdPlaceholder": "your-user-id"
"userIdPlaceholder": "your-user-id",
"userIdHint": "Dùng \"system\" để có toàn quyền hệ thống"
},
"noAccessHint": "Yêu cầu quản trị viên thêm bạn vào tenant, hoặc đăng nhập bằng tài khoản khác.",
"logout": "Đăng xuất"
+2 -1
View File
@@ -33,7 +33,8 @@
"gatewayToken": "Gateway Token",
"tokenPlaceholder": "Bearer token",
"userId": "用户 ID",
"userIdPlaceholder": "您的用户 ID"
"userIdPlaceholder": "您的用户 ID",
"userIdHint": "使用 \"system\" 获取完整系统权限"
},
"noAccessHint": "请联系管理员将您添加到租户,或使用其他账号登录。",
"logout": "退出登录"
+4 -1
View File
@@ -8,7 +8,7 @@ interface TokenFormProps {
export function TokenForm({ onSubmit }: TokenFormProps) {
const { t } = useTranslation("login");
const [userId, setUserId] = useState("");
const [userId, setUserId] = useState("system");
const [token, setToken] = useState("");
const [connecting, setConnecting] = useState(false);
const [error, setError] = useState<string | null>(null);
@@ -63,6 +63,9 @@ export function TokenForm({ onSubmit }: TokenFormProps) {
autoFocus
disabled={connecting}
/>
<p className="text-xs text-muted-foreground">
{t("token.userIdHint")}
</p>
</div>
<div className="space-y-2">