feat: new ui (#1455)

This commit is contained in:
Levi authored and GitHub committed 2026-09-05 19:53:41 +08:00
1 parent 3be8db664c
commit 177c225f16
742 files changed
+59951 -5934

No files matched your search

+22 -6
View File
@@ -1,19 +1,35 @@
package bt
import "github.com/GopeedLab/gopeed/pkg/base"
type ReqExtra struct {
Trackers []string `json:"trackers"`
}
// Stats for torrent
type Stats struct {
// health indicators of torrents, from large to small, ConnectedSeeders are also the key to the health of seed resources
TotalPeers int `json:"totalPeers"`
ActivePeers int `json:"activePeers"`
ConnectedSeeders int `json:"connectedSeeders"`
// StatsSnapshot contains cumulative BitTorrent data that remains meaningful
// after the torrent is stopped or the application restarts.
type StatsSnapshot struct {
// Total seed bytes
SeedBytes int64 `json:"seedBytes"`
// Seed ratio
SeedRatio float64 `json:"seedRatio"`
// Total seed time
SeedTime int64 `json:"seedTime"`
// PieceMap contains verified local piece completion in compact bitset-v1
// format. It is nil while metadata or storage completion is unavailable.
PieceMap *base.PieceMap `json:"pieceMap"`
}
// StatsRuntime contains live swarm telemetry. It is never persisted because
// peer connections and live swarm counters cease to be valid once the fetcher
// stops.
type StatsRuntime struct {
// Health indicators of torrents, from large to small. ConnectedSeeders are
// also the key to the health of seed resources.
TotalPeers int `json:"totalPeers"`
ActivePeers int `json:"activePeers"`
ConnectedSeeders int `json:"connectedSeeders"`
ConnectedLeechers int `json:"connectedLeechers"`
// Peers contains currently connected BitTorrent peers.
Peers []*base.PeerStats `json:"peers"`
}