From fb54d6da61386848bf36bc66ce47f5640f1099b5 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 28 Jun 2026 11:31:20 +0800 Subject: [PATCH] style(frontend): remove hardcoded indigo colors in settings components Replace all manual bg-indigo and text-indigo overrides with standard CSS variables such as bg-primary/10 and text-primary across common settings modules to support theme integration. --- .../app/(main)/admin/settings/page-client.tsx | 2 +- .../common/settings/access-token.tsx | 14 +++++++------- .../common/settings/operation-tab.tsx | 10 +++++----- .../components/common/settings/other-tab.tsx | 10 +++++----- .../components/common/settings/profile.tsx | 18 +++++++++--------- .../common/settings/security-tab.tsx | 18 +++++++++--------- .../components/common/settings/system-tab.tsx | 4 ++-- .../components/common/settings/templates.tsx | 10 +++++----- 8 files changed, 43 insertions(+), 43 deletions(-) diff --git a/frontend/app/(main)/admin/settings/page-client.tsx b/frontend/app/(main)/admin/settings/page-client.tsx index a740408d..47e2fa43 100644 --- a/frontend/app/(main)/admin/settings/page-client.tsx +++ b/frontend/app/(main)/admin/settings/page-client.tsx @@ -85,7 +85,7 @@ export function AdminSettingsPageClient() { if (loading || !user || !user.is_admin) { return (
- +
) } diff --git a/frontend/components/common/settings/access-token.tsx b/frontend/components/common/settings/access-token.tsx index d599017b..9a98f0a4 100644 --- a/frontend/components/common/settings/access-token.tsx +++ b/frontend/components/common/settings/access-token.tsx @@ -194,7 +194,7 @@ export function AccessTokenMain() { {accessTokensQuery.isPending ? (
- +
) : (accessTokensQuery.data ?? []).length > 0 ? (
@@ -231,7 +231,7 @@ export function AccessTokenMain() { type="button" variant="outline" size="sm" - className="text-xs border-dashed text-muted-foreground hover:text-indigo-500 hover:bg-indigo-500/5 rounded-lg h-8 px-2.5" + className="text-xs border-dashed text-muted-foreground hover:text-primary hover:bg-primary/5 rounded-lg h-8 px-2.5" onClick={() => handleCopyText(token.masked_token, token.id)} > {copiedId === token.id ? ( @@ -245,7 +245,7 @@ export function AccessTokenMain() { type="button" variant="outline" size="sm" - className="text-xs border-dashed text-muted-foreground hover:text-indigo-500 hover:bg-indigo-500/5 rounded-lg h-8 px-2.5" + className="text-xs border-dashed text-muted-foreground hover:text-primary hover:bg-primary/5 rounded-lg h-8 px-2.5" onClick={() => handleRotateToken(token.id, token.name)} disabled={rotateTokenMutation.isPending} > @@ -305,7 +305,7 @@ export function AccessTokenMain() { value={tokenName} onChange={(e) => setTokenName(e.target.value)} disabled={createTokenMutation.isPending} - className="rounded-xl border border-dashed focus:border-indigo-500 focus:ring-0 focus-visible:ring-0" + className="rounded-xl border border-dashed focus:border-primary focus:ring-0 focus-visible:ring-0" />
{user?.is_admin && ( @@ -375,15 +375,15 @@ export function AccessTokenMain() { {newCreatedToken && (
{/* 明文 Token 文本框 */} -
- +
+ {newCreatedToken.token} diff --git a/frontend/components/common/settings/other-tab.tsx b/frontend/components/common/settings/other-tab.tsx index 3bb91de1..57d516c1 100644 --- a/frontend/components/common/settings/other-tab.tsx +++ b/frontend/components/common/settings/other-tab.tsx @@ -112,7 +112,7 @@ export function OtherTab({ configs }: OtherTabProps) {
-
+
@@ -141,11 +141,11 @@ export function OtherTab({ configs }: OtherTabProps) { return (
- {Icon && } + {Icon && } {item.label} {isReadOnly && ( @@ -171,8 +171,8 @@ export function OtherTab({ configs }: OtherTabProps) {
))} -
- +
+
安全提示: 为了防止管理员在关闭“系统设置”后导致无法重新访问此配置页,系统限制了“系统设置”的关闭权限。其它所有菜单均可自由开关,隐藏后对应的分组标题在为空时也会自动隐藏。 diff --git a/frontend/components/common/settings/profile.tsx b/frontend/components/common/settings/profile.tsx index 492e0ecd..06e3b48b 100644 --- a/frontend/components/common/settings/profile.tsx +++ b/frontend/components/common/settings/profile.tsx @@ -275,7 +275,7 @@ export function ProfileMain() { > - + {(user.nickname || user.username).slice(0, 2).toUpperCase()} @@ -342,7 +342,7 @@ export function ProfileMain() { href={user.website.startsWith("http") ? user.website : `http://${user.website}`} target="_blank" rel="noopener noreferrer" - className="text-indigo-600 hover:underline" + className="text-primary hover:underline" > {user.website} @@ -473,7 +473,7 @@ export function ProfileMain() {
-
+
@@ -487,7 +487,7 @@ export function ProfileMain() {

已绑定账号

{externalAccountBindingsQuery.isPending ? (
- +
) : (externalAccountBindingsQuery.data ?? []).length > 0 ? (
@@ -534,7 +534,7 @@ export function ProfileMain() {

绑定新账号

{publicAuthSourcesQuery.isPending ? (
- +
) : (publicAuthSourcesQuery.data ?? []).length > 0 ? (
@@ -543,16 +543,16 @@ export function ProfileMain() { key={source.id} type="button" variant="outline" - className="flex items-center justify-between w-full border border-dashed rounded-xl px-3 py-2 text-left font-normal text-xs hover:bg-indigo-500/5 hover:text-indigo-500 hover:border-indigo-500/30 transition-all duration-300 group h-8" + className="flex items-center justify-between w-full border border-dashed rounded-xl px-3 py-2 text-left font-normal text-xs hover:bg-primary/5 hover:text-primary hover:border-primary/30 transition-all duration-300 group h-8" onClick={() => { void bindSourceMutation.mutateAsync(source.name) }} >
- + 绑定 {source.display_name || source.name}
- + ))}
@@ -583,7 +583,7 @@ export function ProfileMain() { > - + {(nickname || "U").slice(0, 2).toUpperCase()} diff --git a/frontend/components/common/settings/security-tab.tsx b/frontend/components/common/settings/security-tab.tsx index e5fe031a..6cbed048 100644 --- a/frontend/components/common/settings/security-tab.tsx +++ b/frontend/components/common/settings/security-tab.tsx @@ -245,7 +245,7 @@ export function SecurityTab({ configs, systemConfigsQuery }: SecurityTabProps) {
-
+
@@ -263,11 +263,11 @@ export function SecurityTab({ configs, systemConfigsQuery }: SecurityTabProps) { return (
- {Icon && } + {Icon && } {item.title}

{item.description}

@@ -283,11 +283,11 @@ export function SecurityTab({ configs, systemConfigsQuery }: SecurityTabProps) { {/* 登录状态保持时间 (选择后立即更改) */}
- + 登录状态保持时间

@@ -340,7 +340,7 @@ export function SecurityTab({ configs, systemConfigsQuery }: SecurityTabProps) {

-
+
@@ -390,7 +390,7 @@ export function SecurityTab({ configs, systemConfigsQuery }: SecurityTabProps) {