From 45091a973ba1c7d5d8d79e0f421968c5f472361a Mon Sep 17 00:00:00 2001 From: Montia37 Date: Fri, 15 Aug 2025 20:57:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=20Link=20to=20instanc?= =?UTF-8?q?e=20=E7=82=B9=E5=87=BB=E8=8C=83=E5=9B=B4=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20sitename=20=E5=92=8C=20price=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- komari-theme.json | 2 +- src/components/sections/NodeCard.tsx | 24 ++++++++--------- src/components/sections/NodeListItem.tsx | 34 ++++++++++++------------ src/config/ConfigProvider.tsx | 5 ++-- src/hooks/useNodeCommons.ts | 4 +-- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/komari-theme.json b/komari-theme.json index 89ef98a..e463e1c 100644 --- a/komari-theme.json +++ b/komari-theme.json @@ -2,7 +2,7 @@ "name": "Komari Theme PurCart", "short": "PurCarte", "description": "A frosted glass theme for Komari", - "version": "1.0.0", + "version": "1.0.1", "author": "Montia & Gemini", "url": "https://github.com/Montia37/Komari-theme-purcarte", "preview": "preview.png", diff --git a/src/components/sections/NodeCard.tsx b/src/components/sections/NodeCard.tsx index 0bf3a7b..daaf2b2 100644 --- a/src/components/sections/NodeCard.tsx +++ b/src/components/sections/NodeCard.tsx @@ -39,18 +39,18 @@ export const NodeCard = ({ node }: NodeCardProps) => { : "striped-bg-red-translucent-diagonal ring-2 ring-red-500/50" }`}> -
- - {node.os} - - {node.name} - -
+ +
+ + {node.os} + {node.name} +
+
diff --git a/src/components/sections/NodeListItem.tsx b/src/components/sections/NodeListItem.tsx index 8924fab..f0fbac3 100644 --- a/src/components/sections/NodeListItem.tsx +++ b/src/components/sections/NodeListItem.tsx @@ -32,25 +32,25 @@ export const NodeListItem = ({ node }: NodeListItemProps) => { } text-secondary-foreground transition-colors duration-200`}>
-
-
- {node.name} -
- -
-
- 到期: -
{expired_at}
-
-
-
- 在线: - - {isOnline && stats ? formatUptime(stats.uptime) : "离线"} - + +
+
{node.name}
+ +
+
+ 到期: +
{expired_at}
+
+
+
+ 在线: + + {isOnline && stats ? formatUptime(stats.uptime) : "离线"} + +
-
+
diff --git a/src/config/ConfigProvider.tsx b/src/config/ConfigProvider.tsx index 8c921eb..c56f8ec 100644 --- a/src/config/ConfigProvider.tsx +++ b/src/config/ConfigProvider.tsx @@ -44,7 +44,8 @@ export function ConfigProvider({ enableLogo: theme.enableLogo ?? DEFAULT_CONFIG.enableLogo, logoUrl: theme.logoUrl || DEFAULT_CONFIG.logoUrl, enableTitle: theme.enableTitle ?? DEFAULT_CONFIG.enableTitle, - titleText: theme.titleText || DEFAULT_CONFIG.titleText, + titleText: + theme.titleText || publicSettings?.sitename || DEFAULT_CONFIG.titleText, enableSearchButton: theme.enableSearchButton ?? DEFAULT_CONFIG.enableSearchButton, selectedDefaultView: @@ -64,7 +65,7 @@ export function ConfigProvider({ theme.pingChartMaxPoints || DEFAULT_CONFIG.pingChartMaxPoints, backgroundImage, }), - [theme, backgroundImage] + [theme, backgroundImage, publicSettings?.sitename] ); return ( diff --git a/src/hooks/useNodeCommons.ts b/src/hooks/useNodeCommons.ts index 4a6a04c..cc1a4d1 100644 --- a/src/hooks/useNodeCommons.ts +++ b/src/hooks/useNodeCommons.ts @@ -55,10 +55,10 @@ export const useNodeCommons = (node: NodeWithStatus) => { ? "长期" : node.expired_at ? new Date(node.expired_at).toLocaleDateString() - : "N/A"; + : "未设置"; const tagList = [ - price, + ...(price ? [price] : []), ...(daysLeftTag ? [daysLeftTag] : []), ...(typeof node.tags === "string" ? node.tags