mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-17 10:41:10 +01:00
♻️ Refactor torrent network traffic widget #616
This commit is contained in:
11
src/hooks/widgets/download-speed/useGetNetworkSpeed.tsx
Normal file
11
src/hooks/widgets/download-speed/useGetNetworkSpeed.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { NormalizedDownloadQueueResponse } from '../../../types/api/downloads/queue/NormalizedDownloadQueueResponse';
|
||||
|
||||
export const useGetDownloadClientsQueue = () => useQuery({
|
||||
queryKey: ['network-speed'],
|
||||
queryFn: async (): Promise<NormalizedDownloadQueueResponse> => {
|
||||
const response = await fetch('/api/modules/downloads');
|
||||
return response.json();
|
||||
},
|
||||
refetchInterval: 3000,
|
||||
});
|
||||
Reference in New Issue
Block a user