From 4131b8fecc012c3c0c510162a56ccb86ab56b56e Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 18 Oct 2022 09:21:43 -0500 Subject: add clearCompleted --- src/web/src/lib/transfers.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/web') diff --git a/src/web/src/lib/transfers.js b/src/web/src/lib/transfers.js index f9815d4d..c95f8f76 100644 --- a/src/web/src/lib/transfers.js +++ b/src/web/src/lib/transfers.js @@ -20,6 +20,10 @@ export const cancel = ({ direction, username, id, remove = false }) => { `/transfers/${direction}s/${encodeURIComponent(username)}/${encodeURIComponent(id)}?remove=${remove}`); }; +export const clearCompleted = ({ direction }) => { + return api.delete(`/transfers/${direction}s/all/completed`); +}; + // 'Requested' // 'Queued, Remotely' // 'Queued, Locally' -- cgit v1.2.3 From 566efcee1ace6a962805c6da83547cff16b4760a Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 18 Oct 2022 09:21:56 -0500 Subject: add tab for data --- src/web/src/components/System/System.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/web') diff --git a/src/web/src/components/System/System.js b/src/web/src/components/System/System.js index 2be10f81..52fc1188 100644 --- a/src/web/src/components/System/System.js +++ b/src/web/src/components/System/System.js @@ -10,6 +10,7 @@ import Logs from './Logs'; import Options from './Options'; import Shares from './Shares'; import { Switch } from '../Shared'; +import Data from './Data'; const System = ({ state = {}, options = {} }) => { const { params: { tab }, ...route } = useRouteMatch(); @@ -50,6 +51,15 @@ const System = ({ state = {}, options = {} }) => { ), render: () => , }, + { + route: 'data', + menuItem: { + key: 'data', + icon: 'database', + content: 'Data', + }, + render: () => , + }, { route: 'logs', menuItem: { -- cgit v1.2.3 From 5951ce9feee7cb22cebcca79e829fc32fb29d6c9 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 18 Oct 2022 09:22:05 -0500 Subject: add data page --- src/web/src/components/System/Data/index.js | 45 +++++++++++++++++++++++++++++ src/web/src/components/System/System.css | 4 +++ 2 files changed, 49 insertions(+) create mode 100644 src/web/src/components/System/Data/index.js (limited to 'src/web') diff --git a/src/web/src/components/System/Data/index.js b/src/web/src/components/System/Data/index.js new file mode 100644 index 00000000..a0642c59 --- /dev/null +++ b/src/web/src/components/System/Data/index.js @@ -0,0 +1,45 @@ +import React, { useState } from 'react'; +import { Button, Divider, Header, Icon } from 'semantic-ui-react'; +import { toast } from 'react-toastify'; + +import { clearCompleted } from '../../../lib/transfers'; + +const Data = () => { + const [up, setUp] = useState(false); + const [down, setDown] = useState(false); + + const clear = async ({ direction, setState }) => { + setState(true); + await clearCompleted({ direction }); + setState(false); + toast.success(`Completed ${direction}s cleared!`); + }; + + return ( +
+
Transfer Data
+ +

+ The Uploads and Downloads pages can become unresponsive if too many transfers are displayed. If you're having trouble with either page, try using the buttons below to remove completed transfers. +

+ + +
+ ); +}; + +export default Data; \ No newline at end of file diff --git a/src/web/src/components/System/System.css b/src/web/src/components/System/System.css index a463ab08..dc32d583 100644 --- a/src/web/src/components/System/System.css +++ b/src/web/src/components/System/System.css @@ -67,4 +67,8 @@ .share-scan-detail { margin-top: 10px; font-size: 14px; +} + +.transfer-header { + margin-bottom: -15px !important; } \ No newline at end of file -- cgit v1.2.3 From 84477c329d35add265cab047cc37bda44f61ab0f Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 18 Oct 2022 09:31:41 -0500 Subject: line too long --- src/web/src/components/System/Data/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/web') diff --git a/src/web/src/components/System/Data/index.js b/src/web/src/components/System/Data/index.js index a0642c59..742aa309 100644 --- a/src/web/src/components/System/Data/index.js +++ b/src/web/src/components/System/Data/index.js @@ -19,9 +19,10 @@ const Data = () => {
Transfer Data
-

- The Uploads and Downloads pages can become unresponsive if too many transfers are displayed. If you're having trouble with either page, try using the buttons below to remove completed transfers. -

+

+ The Uploads and Downloads pages can become unresponsive if too many transfers are displayed. If you're having + trouble with either page, try using the buttons below to remove completed transfers. +