diff --git a/frontend/components/animate-ui/radix/dialog.tsx b/frontend/components/animate-ui/radix/dialog.tsx index f2a5cdb4..6752ce6f 100644 --- a/frontend/components/animate-ui/radix/dialog.tsx +++ b/frontend/components/animate-ui/radix/dialog.tsx @@ -85,7 +85,7 @@ function DialogOverlay({className, ...props}: DialogOverlayProps) { -

验证成功

)} {status === 'error' && (
-

验证失败 |{error}

- - - 个人信息 + + + 个人信息 + + 管理账户信息、主题偏好和支付设置 + -
- {!isLoading && user && ( - <> - {/* 用户信息卡片 */} -
- {/* 用户基本信息和登出按钮 */} -
-
- - - CN - -
-
- {user.username} -
- {user.nickname && ( -
- {user.nickname} + +
+ {!isLoading && user && ( + <> +
+
+
+ + + + {user.username?.slice(0, 2).toUpperCase() || 'U'} + + +
+
+ {user.nickname || user.username} +
+
+ @{user.username} +
+
+ {user.trust_level !== undefined && getTrustLevelShort(user.trust_level) && ( + + {getTrustLevelShort(user.trust_level)} + + )} + + {user.trust_level !== undefined ? getTrustLevelText(user.trust_level) : '未知'} + + + ID {user.id} +
- )} -
- {user.trust_level !== undefined ? getTrustLevelText(user.trust_level) : '未知'} - - {user.id}
+
- -
-
+ - {/* 用户分数 */} - {user.score !== undefined && ( -
-

社区分数

-
- - +
+
社区分数
+
+
+ + 分数 + + + +
+
-
- )} - - )} + {mounted && ( +
+
系统设置
+
+ + +
+
+ )} + +
+ + )} - {/* 主题设置 */} - {mounted && ( -
-

主题设置

-
- +
+ + LINUX DO +
+ + +
+ + Credit +
+ + +
+ + Wiki +
+ + +
+ + GitHub +
+ + +
+ + Issues +
+ + +
+ + Telegram +
+
- )} - {/* 账户设置 */} -
-

账户设置

-
- -
-
+ - {/* 快速链接区域 */} -
-

快速链接

-
- -
- +
+
关于 LINUX DO CDK
+
+
Version 1.2.3, Build At 2026-04-22
+
+ LINUX DO CDK 是一个为 Linux Do 社区打造的内容分发工具平台,旨在提供快速、安全、便捷的 CDK 分享服务。平台支持多种分发方式,具备完善的用户权限管理和风险控制机制。
- Linux Do 社区 - - -
- -
- GitHub 仓库 - - -
- -
- 功能反馈 - - -
- -
- 群组交流 - +
-
-
-

关于 LINUX DO CDK

-
-
版本: 1.2.3
-
构建时间: 2026-04-21
-
LINUX DO CDK 是一个为 Linux Do 社区打造的内容分发工具平台,旨在提供快速、安全、便捷的 CDK 分享服务。平台支持多种分发方式,具备完善的用户权限管理和风险控制机制。
-
+ {!isLoading && !user && ( +
+ 未登录用户 +
+ )}
- - {!isLoading && !user && ( -
- 未登录用户 -
- )} -
+ diff --git a/frontend/components/common/payment/PaymentSettingsDialog.tsx b/frontend/components/common/payment/PaymentSettingsDialog.tsx index 855b897c..2f22516e 100644 --- a/frontend/components/common/payment/PaymentSettingsDialog.tsx +++ b/frontend/components/common/payment/PaymentSettingsDialog.tsx @@ -83,7 +83,7 @@ export function PaymentSettingsDialog({
diff --git a/frontend/components/common/project/CreateDialog.tsx b/frontend/components/common/project/CreateDialog.tsx index 3cfa7b66..8ef61008 100644 --- a/frontend/components/common/project/CreateDialog.tsx +++ b/frontend/components/common/project/CreateDialog.tsx @@ -258,7 +258,7 @@ export function CreateDialog({
diff --git a/frontend/components/common/project/EditDialog.tsx b/frontend/components/common/project/EditDialog.tsx index dbff0190..b897db61 100644 --- a/frontend/components/common/project/EditDialog.tsx +++ b/frontend/components/common/project/EditDialog.tsx @@ -216,7 +216,7 @@ export function EditDialog({
diff --git a/frontend/components/common/project/ProjectCard.tsx b/frontend/components/common/project/ProjectCard.tsx index b8da4d67..5f776839 100644 --- a/frontend/components/common/project/ProjectCard.tsx +++ b/frontend/components/common/project/ProjectCard.tsx @@ -3,11 +3,27 @@ import {Button} from '@/components/ui/button'; import {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from '@/components/ui/tooltip'; import {MotionEffect} from '@/components/animate-ui/effects/motion-effect'; -import {CURRENCY_LABEL, DISTRIBUTION_MODE_NAMES, TRUST_LEVEL_CONFIG} from '@/components/common/project'; +import {CURRENCY_LABEL, DISTRIBUTION_MODE_NAMES} from '@/components/common/project'; import {BadgeCheck, Boxes, Coins, Gauge, Pencil, ShieldCheck, Trash2, Waypoints} from 'lucide-react'; import {formatDateTimeWithSeconds} from '@/lib/utils'; import {ProjectListItem} from '@/lib/services/project/types'; +const TRUST_LEVEL_SHORT_LABELS: Partial> = { + 1: 'TL1', + 2: 'TL2', + 3: 'TL3', + 4: 'TL4', +}; + +const trimTrailingZeros = (value: string): string => value.replace(/\.0+$|(\.\d*?[1-9])0+$/, '$1'); + +const formatCompactPrice = (price: number): {display: string; full: string; compacted: boolean} => { + const full = `${price.toFixed(2)} ${CURRENCY_LABEL}`; + const formatter = new Intl.NumberFormat('en-US', {minimumFractionDigits: 0, maximumFractionDigits: 2}); + const numberOnly = trimTrailingZeros(formatter.format(price)); + return {display: numberOnly, full, compacted: true}; +}; + interface ProjectCardProps { project: ProjectListItem; onClick?: (project: ProjectListItem) => void; @@ -26,7 +42,7 @@ export function ProjectCard({ editButton, }: ProjectCardProps) { const priceNum = Number(project.price || '0'); - const normalizedPrice = priceNum.toFixed(2); + const priceDisplay = formatCompactPrice(priceNum); const now = new Date(); const startTime = new Date(project.start_time); @@ -43,15 +59,15 @@ export function ProjectCard({ const visibleTags = (project.tags || []).slice(0, 3); const hiddenTagCount = Math.max(0, (project.tags?.length || 0) - visibleTags.length); - const valueText = `${normalizedPrice} ${CURRENCY_LABEL}`; const itemText = `${project.total_items}`; const modeText = DISTRIBUTION_MODE_NAMES[project.distribution_type]; const description = project.description?.trim(); - const trustText = TRUST_LEVEL_CONFIG[project.minimum_trust_level]?.name || `T${project.minimum_trust_level}`; + const trustText = TRUST_LEVEL_SHORT_LABELS[project.minimum_trust_level]; const riskText = `${String(project.risk_level).padStart(2, '0')}`; const showRisk = project.risk_level > 0; const showPrice = priceNum > 0; const showIpLimit = !project.allow_same_ip; + const showTrustLevel = Boolean(trustText); return ( @@ -118,9 +134,9 @@ export function ProjectCard({ {description || '暂无描述'}

-
-
-
+
+
+
{visibleTags.map((tag) => ( )} -
- -
- {modeText} -
-
- -
-
{itemText} @@ -154,15 +161,26 @@ export function ProjectCard({ )} {showPrice && ( + + + + + {priceDisplay.display} + + + {priceDisplay.compacted && ( + +

{priceDisplay.full}

+
+ )} +
+ )} + {showTrustLevel && ( - - {valueText} + + {trustText} )} - - - {trustText} - {showIpLimit && ( @@ -170,10 +188,16 @@ export function ProjectCard({ )}
+
+ +
+
+ {modeText} +
-
+
{statusLabel}
diff --git a/frontend/components/ui/dialog.tsx b/frontend/components/ui/dialog.tsx index 5eb311d0..76cf481c 100644 --- a/frontend/components/ui/dialog.tsx +++ b/frontend/components/ui/dialog.tsx @@ -38,7 +38,7 @@ function DialogOverlay({