traffic information has been reworked

This commit is contained in:
coolcoala
2025-07-30 06:28:56 +03:00
parent ae08d48641
commit 6b8b95e4ca

View File

@@ -56,6 +56,7 @@ import {
Loader2, Loader2,
Info, Info,
DownloadCloud, DownloadCloud,
Download,
Trash2, Trash2,
Edit3, Edit3,
FileText as FileTextIcon, FileText as FileTextIcon,
@@ -66,7 +67,7 @@ import {
ListTree, ListTree,
CheckCircle, CheckCircle,
Infinity, Infinity,
RefreshCw, RefreshCw, Network,
} from "lucide-react"; } from "lucide-react";
import { t } from "i18next"; import { t } from "i18next";
@@ -343,8 +344,8 @@ export const ProfileItem = (props: Props) => {
</div> </div>
<div className="flex items-center flex-shrink-0"> <div className="flex items-center flex-shrink-0">
<Badge <Badge
variant={type === "local" ? "secondary" : "outline"} variant="outline"
className="text-xs" className="text-xs shadow-sm"
> >
{type} {type}
</Badge> </Badge>
@@ -384,20 +385,21 @@ export const ProfileItem = (props: Props) => {
)} )}
</div> </div>
</div> </div>
</div> <div className="flex items-center justify-between">
</div> <div className="flex items-center">
<Download className="h-3 w-3 inline mr-1.5" />
<span className="pr-5">
{parseTraffic(download)}
</span>
<Network className="h-3 w-3 inline mr-1.5" />
{total > 0 ? (
<span>{parseTraffic(total)}</span>
) : <Infinity className="h-3 w-3 inline mr-1.5" />}
{hasExtra && total > 0 && ( </div>
<div className="relative h-5">
<Progress value={progress} className="h-full rounded-none" />
<div className="absolute inset-0 flex items-center justify-between px-2 text-xs text-white/90 font-medium">
<span>
{parseTraffic(download)} / {parseTraffic(upload)}
</span>
<span>{parseTraffic(total)}</span>
</div> </div>
</div> </div>
)} </div>
</Card> </Card>
</ContextMenuTrigger> </ContextMenuTrigger>
@@ -405,7 +407,6 @@ export const ProfileItem = (props: Props) => {
className="w-56" className="w-56"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
{/* Объединяем все части меню */}
{[...homeMenuItem, ...mainMenuItems].map((item) => ( {[...homeMenuItem, ...mainMenuItems].map((item) => (
<ContextMenuItem <ContextMenuItem
key={item.label} key={item.label}
@@ -420,7 +421,7 @@ export const ProfileItem = (props: Props) => {
<ContextMenuSub> <ContextMenuSub>
<ContextMenuSubTrigger disabled={!hasUrl || isLoading}> <ContextMenuSubTrigger disabled={!hasUrl || isLoading}>
<DownloadCloud className="mr-2 h-4 w-4" /> <DownloadCloud className="mr-2 h-4 w-4" />
<span>{t("Update")}</span> <span className="px-2">{t("Update")}</span>
</ContextMenuSubTrigger> </ContextMenuSubTrigger>
<ContextMenuPortal> <ContextMenuPortal>
<ContextMenuSubContent> <ContextMenuSubContent>