From 4cdb22788f93207b297be40b8e27a8edbc547406 Mon Sep 17 00:00:00 2001 From: YoVinchen Date: Thu, 11 Sep 2025 00:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9D=A2=E6=9D=BF=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RelayStationManager.tsx | 137 +++++++++++-------------- 1 file changed, 62 insertions(+), 75 deletions(-) diff --git a/src/components/RelayStationManager.tsx b/src/components/RelayStationManager.tsx index 1c33de1..6808e31 100644 --- a/src/components/RelayStationManager.tsx +++ b/src/components/RelayStationManager.tsx @@ -385,21 +385,12 @@ const RelayStationManager: React.FC = ({ onBack }) => const isToggling = togglingEnable[station.id]; return ( -
- toggleEnableStatus(station.id, enabled)} - className="data-[state=checked]:bg-green-500" - /> - {isToggling ? ( - {t('common.updating')} - ) : enabled ? ( - {t('status.enabled')} - ) : ( - {t('status.disabled')} - )} -
+ toggleEnableStatus(station.id, enabled)} + className="data-[state=checked]:bg-green-500" + /> ); }; @@ -691,75 +682,95 @@ const RelayStationManager: React.FC = ({ onBack }) => ) : ( stations.map((station) => ( - -
-
- {station.name} - + +
+
+ {station.name} + {getAdapterDisplayName(station.adapter)}
- {getStatusBadge(station)} +
+ {getStatusBadge(station)} + + +
- -
-
- - {station.api_url} + +
+
+ + {station.api_url}
{station.description && ( -

+

{station.description}

)} {/* PackyCode 额度显示 */} {station.adapter === 'packycode' && ( -
+
{loadingQuota[station.id] ? ( -
-
- 加载额度中... +
+
+ 加载中...
) : quotaData[station.id] ? ( -
+
{/* 用户信息和计划 */}
-
+
{quotaData[station.id].username && ( {quotaData[station.id].username} )} - + {quotaData[station.id].plan_type.toUpperCase()} {quotaData[station.id].opus_enabled && ( - + Opus )}
- {quotaData[station.id].plan_expires_at && ( - - 到期: {new Date(quotaData[station.id].plan_expires_at!).toLocaleDateString()} - - )}
{/* 账户余额 */} -
- 账户余额: - +
+ 余额: + ${Number(quotaData[station.id].balance_usd).toFixed(2)}
{/* 日额度 */} -
-
+
+
日额度: -
+
{(() => { const daily_spent = Number(quotaData[station.id].daily_spent_usd); const daily_budget = Number(quotaData[station.id].daily_budget_usd); @@ -768,8 +779,7 @@ const RelayStationManager: React.FC = ({ onBack }) => daily_budget * 0.8 ? 'text-orange-600' : 'text-green-600'}> ${daily_spent.toFixed(2)} - / - ${daily_budget.toFixed(2)} + / ${daily_budget.toFixed(2)} ); })()} @@ -839,7 +849,7 @@ const RelayStationManager: React.FC = ({ onBack }) =>
) : ( -
+
@@ -866,30 +877,6 @@ const RelayStationManager: React.FC = ({ onBack }) =>
)} -
- - -