mirror of
https://github.com/fankes/komari-theme-purcarte.git
synced 2025-10-19 03:49:22 +08:00
fix: 调整 Link to instance 点击范围,修复 sitename 和 price tag
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "Komari Theme PurCart",
|
"name": "Komari Theme PurCart",
|
||||||
"short": "PurCarte",
|
"short": "PurCarte",
|
||||||
"description": "A frosted glass theme for Komari",
|
"description": "A frosted glass theme for Komari",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"author": "Montia & Gemini",
|
"author": "Montia & Gemini",
|
||||||
"url": "https://github.com/Montia37/Komari-theme-purcarte",
|
"url": "https://github.com/Montia37/Komari-theme-purcarte",
|
||||||
"preview": "preview.png",
|
"preview": "preview.png",
|
||||||
|
@@ -39,18 +39,18 @@ export const NodeCard = ({ node }: NodeCardProps) => {
|
|||||||
: "striped-bg-red-translucent-diagonal ring-2 ring-red-500/50"
|
: "striped-bg-red-translucent-diagonal ring-2 ring-red-500/50"
|
||||||
}`}>
|
}`}>
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||||
<div className="flex items-center gap-2">
|
<Link to={`/instance/${node.uuid}`}>
|
||||||
<Flag flag={node.region}></Flag>
|
<div className="flex items-center gap-2">
|
||||||
<img
|
<Flag flag={node.region}></Flag>
|
||||||
src={getOSImage(node.os)}
|
<img
|
||||||
alt={node.os}
|
src={getOSImage(node.os)}
|
||||||
className="w-6 h-6 rounded-full"
|
alt={node.os}
|
||||||
loading="lazy"
|
className="w-6 h-6 rounded-full"
|
||||||
/>
|
loading="lazy"
|
||||||
<CardTitle className="text-base font-bold">
|
/>
|
||||||
<Link to={`/instance/${node.uuid}`}>{node.name}</Link>
|
<CardTitle className="text-base font-bold">{node.name}</CardTitle>
|
||||||
</CardTitle>
|
</div>
|
||||||
</div>
|
</Link>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="flex-grow space-y-3 text-sm">
|
<CardContent className="flex-grow space-y-3 text-sm">
|
||||||
<div className="flex flex-wrap gap-1">
|
<div className="flex flex-wrap gap-1">
|
||||||
|
@@ -32,25 +32,25 @@ export const NodeListItem = ({ node }: NodeListItemProps) => {
|
|||||||
} text-secondary-foreground transition-colors duration-200`}>
|
} text-secondary-foreground transition-colors duration-200`}>
|
||||||
<div className="col-span-3 flex items-center text-left">
|
<div className="col-span-3 flex items-center text-left">
|
||||||
<Flag flag={node.region} />
|
<Flag flag={node.region} />
|
||||||
<div className="ml-2 w-full">
|
<Link to={`/instance/${node.uuid}`}>
|
||||||
<div className="text-base font-bold">
|
<div className="ml-2 w-full">
|
||||||
<Link to={`/instance/${node.uuid}`}>{node.name}</Link>
|
<div className="text-base font-bold">{node.name}</div>
|
||||||
</div>
|
<Tag className="text-xs" tags={tagList} />
|
||||||
<Tag className="text-xs" tags={tagList} />
|
<div className="flex text-xs">
|
||||||
<div className="flex text-xs">
|
<div className="flex">
|
||||||
<div className="flex">
|
<span className="text-secondary-foreground">到期:</span>
|
||||||
<span className="text-secondary-foreground">到期:</span>
|
<div className="flex items-center gap-1">{expired_at}</div>
|
||||||
<div className="flex items-center gap-1">{expired_at}</div>
|
</div>
|
||||||
</div>
|
<div className="border-l border-border/60 mx-2"></div>
|
||||||
<div className="border-l border-border/60 mx-2"></div>
|
<div className="flex">
|
||||||
<div className="flex">
|
<span className="text-secondary-foreground">在线:</span>
|
||||||
<span className="text-secondary-foreground">在线:</span>
|
<span>
|
||||||
<span>
|
{isOnline && stats ? formatUptime(stats.uptime) : "离线"}
|
||||||
{isOnline && stats ? formatUptime(stats.uptime) : "离线"}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-span-1">
|
<div className="col-span-1">
|
||||||
<div className="gap-1 flex items-center justify-center whitespace-nowrap">
|
<div className="gap-1 flex items-center justify-center whitespace-nowrap">
|
||||||
|
@@ -44,7 +44,8 @@ export function ConfigProvider({
|
|||||||
enableLogo: theme.enableLogo ?? DEFAULT_CONFIG.enableLogo,
|
enableLogo: theme.enableLogo ?? DEFAULT_CONFIG.enableLogo,
|
||||||
logoUrl: theme.logoUrl || DEFAULT_CONFIG.logoUrl,
|
logoUrl: theme.logoUrl || DEFAULT_CONFIG.logoUrl,
|
||||||
enableTitle: theme.enableTitle ?? DEFAULT_CONFIG.enableTitle,
|
enableTitle: theme.enableTitle ?? DEFAULT_CONFIG.enableTitle,
|
||||||
titleText: theme.titleText || DEFAULT_CONFIG.titleText,
|
titleText:
|
||||||
|
theme.titleText || publicSettings?.sitename || DEFAULT_CONFIG.titleText,
|
||||||
enableSearchButton:
|
enableSearchButton:
|
||||||
theme.enableSearchButton ?? DEFAULT_CONFIG.enableSearchButton,
|
theme.enableSearchButton ?? DEFAULT_CONFIG.enableSearchButton,
|
||||||
selectedDefaultView:
|
selectedDefaultView:
|
||||||
@@ -64,7 +65,7 @@ export function ConfigProvider({
|
|||||||
theme.pingChartMaxPoints || DEFAULT_CONFIG.pingChartMaxPoints,
|
theme.pingChartMaxPoints || DEFAULT_CONFIG.pingChartMaxPoints,
|
||||||
backgroundImage,
|
backgroundImage,
|
||||||
}),
|
}),
|
||||||
[theme, backgroundImage]
|
[theme, backgroundImage, publicSettings?.sitename]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@@ -55,10 +55,10 @@ export const useNodeCommons = (node: NodeWithStatus) => {
|
|||||||
? "长期"
|
? "长期"
|
||||||
: node.expired_at
|
: node.expired_at
|
||||||
? new Date(node.expired_at).toLocaleDateString()
|
? new Date(node.expired_at).toLocaleDateString()
|
||||||
: "N/A";
|
: "未设置";
|
||||||
|
|
||||||
const tagList = [
|
const tagList = [
|
||||||
price,
|
...(price ? [price] : []),
|
||||||
...(daysLeftTag ? [daysLeftTag] : []),
|
...(daysLeftTag ? [daysLeftTag] : []),
|
||||||
...(typeof node.tags === "string"
|
...(typeof node.tags === "string"
|
||||||
? node.tags
|
? node.tags
|
||||||
|
Reference in New Issue
Block a user