mirror of
https://github.com/fankes/komari-theme-purcarte.git
synced 2025-10-18 19:39:22 +08:00
fix: 修复系统图标圆角遮挡问题和 StatsBar 组件时间
This commit is contained in:
@@ -53,7 +53,7 @@ export const NodeCard = ({ node, enableSwap }: NodeCardProps) => {
|
||||
<img
|
||||
src={getOSImage(node.os)}
|
||||
alt={node.os}
|
||||
className="w-6 h-6 rounded-full"
|
||||
className="w-6 h-6 object-contain"
|
||||
loading="lazy"
|
||||
/>
|
||||
<CardTitle className="text-base font-bold">{node.name}</CardTitle>
|
||||
|
@@ -7,6 +7,7 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
import { Settings2 } from "lucide-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { formatBytes } from "@/utils";
|
||||
@@ -31,7 +32,6 @@ interface StatsBarProps {
|
||||
currentSpeedDown: number;
|
||||
};
|
||||
loading: boolean;
|
||||
currentTime: Date;
|
||||
}
|
||||
|
||||
export const StatsBar = ({
|
||||
@@ -39,9 +39,16 @@ export const StatsBar = ({
|
||||
setDisplayOptions,
|
||||
stats,
|
||||
loading,
|
||||
currentTime,
|
||||
}: StatsBarProps) => {
|
||||
const isMobile = useIsMobile();
|
||||
const [time, setTime] = useState(new Date());
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setInterval(() => {
|
||||
setTime(new Date());
|
||||
}, 1000);
|
||||
return () => clearInterval(timer);
|
||||
}, []);
|
||||
|
||||
// 获取已启用的统计项列表
|
||||
const enabledStats = Object.keys(displayOptions).filter(
|
||||
@@ -60,7 +67,7 @@ export const StatsBar = ({
|
||||
当前时间
|
||||
</label>
|
||||
<label className="font-medium -mt-2 text-md">
|
||||
{currentTime.toLocaleTimeString()}
|
||||
{time.toLocaleTimeString()}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -27,7 +27,6 @@ const HomePage: React.FC<HomePageProps> = ({ viewMode, searchTerm }) => {
|
||||
traffic: true,
|
||||
speed: true,
|
||||
});
|
||||
const [currentTime] = useState(new Date());
|
||||
|
||||
const combinedNodes = useMemo<NodeWithStatus[]>(() => {
|
||||
if (!staticNodes) return [];
|
||||
@@ -88,7 +87,6 @@ const HomePage: React.FC<HomePageProps> = ({ viewMode, searchTerm }) => {
|
||||
setDisplayOptions={setDisplayOptions}
|
||||
stats={stats}
|
||||
loading={loading}
|
||||
currentTime={currentTime}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
Reference in New Issue
Block a user