Add global stats to UI (not desktop yet)
This commit is contained in:
parent
ae606fac4a
commit
61b7a643aa
6 changed files with 89 additions and 11 deletions
26
crates/librqbit/webui/src/stores/statsStore.ts
Normal file
26
crates/librqbit/webui/src/stores/statsStore.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { create } from "zustand";
|
||||
|
||||
import { SessionStats } from "../api-types";
|
||||
|
||||
export interface StatsStore {
|
||||
stats: SessionStats;
|
||||
setStats: (stats: SessionStats) => void;
|
||||
}
|
||||
|
||||
export const useStatsStore = create<StatsStore>((set) => ({
|
||||
stats: {
|
||||
download_speed: { human_readable: "N/A", mbps: 0 },
|
||||
upload_speed: { human_readable: "N/A", mbps: 0 },
|
||||
peers: {
|
||||
connecting: 0,
|
||||
dead: 0,
|
||||
live: 0,
|
||||
not_needed: 0,
|
||||
queued: 0,
|
||||
seen: 0,
|
||||
},
|
||||
},
|
||||
setStats: (stats) => {
|
||||
set({ stats });
|
||||
},
|
||||
}));
|
||||
Loading…
Add table
Add a link
Reference in a new issue