Show webui version from server
This commit is contained in:
parent
a01a07464c
commit
25ca003b44
6 changed files with 39 additions and 19 deletions
|
|
@ -46,7 +46,7 @@ const makeRequest = async (method: string, path: string, data?: any): Promise<an
|
|||
return result;
|
||||
}
|
||||
|
||||
export const API: RqbitAPI = {
|
||||
export const API: RqbitAPI & { getVersion: () => Promise<string> } = {
|
||||
listTorrents: (): Promise<ListTorrentsResponse> => makeRequest('GET', '/torrents'),
|
||||
getTorrentDetails: (index: number): Promise<TorrentDetails> => {
|
||||
return makeRequest('GET', `/torrents/${index}`);
|
||||
|
|
@ -95,5 +95,9 @@ export const API: RqbitAPI = {
|
|||
|
||||
delete: (index: number): Promise<void> => {
|
||||
return makeRequest('POST', `/torrents/${index}/delete`);
|
||||
},
|
||||
getVersion: async (): Promise<string> => {
|
||||
const r = await makeRequest('GET', '/');
|
||||
return r.version;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue