mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
FileBrowser files can be tagged. A Tag icon is displayed on each file row in the browser.
This commit is contained in:
parent
655e944960
commit
ae2b6daa33
29 changed files with 356 additions and 219 deletions
|
|
@ -531,37 +531,6 @@ export const useDownloads = () => {
|
|||
return {onceDownloads, recurringDownloads, fetchDownloads}
|
||||
}
|
||||
|
||||
export const useDownloaders = () => {
|
||||
const [on, setOn] = useState(null);
|
||||
const [downloaders, setDownloaders] = useState(null);
|
||||
|
||||
const fetchDownloaders = async () => {
|
||||
try {
|
||||
let data = await getDownloaders();
|
||||
setDownloaders(data['downloaders']);
|
||||
setOn(!data['manager_disabled']);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
fetchDownloaders();
|
||||
}, []);
|
||||
|
||||
const localSetDownloads = async (on) => {
|
||||
setOn(null);
|
||||
if (on) {
|
||||
await startDownloads();
|
||||
} else {
|
||||
await killDownloads();
|
||||
}
|
||||
await fetchDownloaders();
|
||||
}
|
||||
|
||||
return {on, setOn, downloaders, setDownloads: localSetDownloads};
|
||||
}
|
||||
|
||||
export const useThrottle = () => {
|
||||
const [on, setOn] = useState(null);
|
||||
|
||||
|
|
@ -669,12 +638,6 @@ export const useStatus = () => {
|
|||
setStatus(s);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
toast({
|
||||
type: 'error',
|
||||
title: 'Unexpected server response',
|
||||
description: 'Could not get server status',
|
||||
time: 5000,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue