feat(torrents): torrent tablosunda upload hızını göster

This commit is contained in:
2026-01-04 11:44:59 +03:00
parent 76418d0bb1
commit 2e46bacb36
3 changed files with 5 additions and 1 deletions

View File

@@ -37,6 +37,8 @@ const formatSpeed = (bytesPerSec: number) => {
return `${kb.toFixed(1)} KB/s`;
};
const isUploadState = (state: string) => /upload|stalledup|forcedup|up$/i.test(state);
export const TorrentTable = () => {
const torrents = useAppStore((s) => s.torrents);
const selected = useAppStore((s) => s.selectedHash);
@@ -176,7 +178,7 @@ export const TorrentTable = () => {
/>
</div>
<span className="w-8 text-left tabular-nums">{Math.round(torrent.progress * 100)}%</span>
<span className="w-16 text-left tabular-nums">{formatSpeed(torrent.dlspeed)}</span>
<span className="w-16 text-left tabular-nums">{formatSpeed(isUploadState(torrent.state) ? (torrent.upspeed ?? 0) : torrent.dlspeed)}</span>
<span className="flex items-center gap-2 text-slate-500 group-[.is-selected]:text-white whitespace-nowrap">
{renderState(torrent.state)}
{getProfileName(torrent.hash) && (

View File

@@ -6,6 +6,7 @@ export interface TorrentInfo {
size: number;
progress: number;
dlspeed: number;
upspeed?: number;
state: string;
magnet_uri?: string;
tracker?: string;