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
|
|
@ -3,6 +3,7 @@ import {
|
|||
ErrorDetails,
|
||||
ListTorrentsResponse,
|
||||
RqbitAPI,
|
||||
SessionStats,
|
||||
TorrentDetails,
|
||||
TorrentStats,
|
||||
} from "./api-types";
|
||||
|
|
@ -82,6 +83,9 @@ export const API: RqbitAPI & { getVersion: () => Promise<string> } = {
|
|||
getTorrentStats: (index: number): Promise<TorrentStats> => {
|
||||
return makeRequest("GET", `/torrents/${index}/stats/v1`);
|
||||
},
|
||||
stats: (): Promise<SessionStats> => {
|
||||
return makeRequest("GET", "/stats");
|
||||
},
|
||||
|
||||
uploadTorrent: (data, opts): Promise<AddTorrentResponse> => {
|
||||
let url = "/torrents?&overwrite=true";
|
||||
|
|
@ -152,6 +156,6 @@ export const API: RqbitAPI & { getVersion: () => Promise<string> } = {
|
|||
return url;
|
||||
},
|
||||
getPlaylistUrl: (index: number) => {
|
||||
return (apiUrl || window.origin) + `/torrents/${index}/playlist`;
|
||||
return (apiUrl || window.origin) + `/torrents/${index}/playlist`;
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue