setOpened(false)}
padding="xl"
position="right"
diff --git a/src/modules/Docker/DockerTable.tsx b/src/modules/Docker/DockerTable.tsx
index 2925e3990..70f597d23 100644
--- a/src/modules/Docker/DockerTable.tsx
+++ b/src/modules/Docker/DockerTable.tsx
@@ -7,6 +7,7 @@ import {
ScrollArea,
TextInput,
useMantineTheme,
+ Text,
} from '@mantine/core';
import { useElementSize } from '@mantine/hooks';
import { IconSearch } from '@tabler/icons';
@@ -78,8 +79,16 @@ export default function DockerTable({
transitionDuration={0}
/>
- | {element.Names[0].replace('/', '')} |
- {width > MIN_WIDTH_MOBILE && {element.Image} | }
+
+
+ {element.Names[0].replace('/', '')}
+
+ |
+ {width > MIN_WIDTH_MOBILE && (
+
+ {element.Image}
+ |
+ )}
{width > MIN_WIDTH_MOBILE && (
@@ -111,12 +120,13 @@ export default function DockerTable({
});
return (
-
+
}
value={search}
+ autoFocus
onChange={handleSearchChange}
/>
diff --git a/src/modules/common/MediaDisplay.tsx b/src/modules/common/MediaDisplay.tsx
index 7c3631b18..7fea14508 100644
--- a/src/modules/common/MediaDisplay.tsx
+++ b/src/modules/common/MediaDisplay.tsx
@@ -180,7 +180,7 @@ export function MediaDisplay({ media }: { media: IMedia }) {
const { t } = useTranslation('modules/common-media-cards');
return (
-
+
@@ -223,7 +223,7 @@ export function MediaDisplay({ media }: { media: IMedia }) {
{media.overview}
-
+
{media.plexUrl && (
- {!data.allSuccess && (
+ {data.apps.some((x) => !x.success) && (
{t('card.footer.error')}
diff --git a/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx b/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx
deleted file mode 100644
index 3b494d130..000000000
--- a/src/widgets/torrentNetworkTraffic/TorrentNetworkTrafficTile.tsx
+++ /dev/null
@@ -1,198 +0,0 @@
-import { NormalizedTorrent } from '@ctrl/shared-torrent';
-import { Text, Title, Group, useMantineTheme, Box, Card, ColorSwatch, Stack } from '@mantine/core';
-import { useListState } from '@mantine/hooks';
-import { showNotification } from '@mantine/notifications';
-import { linearGradientDef } from '@nivo/core';
-import { Datum, ResponsiveLine } from '@nivo/line';
-import { IconArrowsUpDown } from '@tabler/icons';
-import axios from 'axios';
-import { useTranslation } from 'next-i18next';
-import { useEffect, useState } from 'react';
-import { useConfigContext } from '../../config/provider';
-import { useSetSafeInterval } from '../../hooks/useSetSafeInterval';
-import { humanFileSize } from '../../tools/humanFileSize';
-import { NormalizedTorrentListResponse } from '../../types/api/NormalizedTorrentListResponse';
-import { defineWidget } from '../helper';
-import { IWidget } from '../widgets';
-
-const definition = defineWidget({
- id: 'dlspeed',
- icon: IconArrowsUpDown,
- options: {},
-
- gridstack: {
- minWidth: 2,
- minHeight: 2,
- maxWidth: 12,
- maxHeight: 6,
- },
- component: TorrentNetworkTrafficTile,
-});
-
-export type ITorrentNetworkTraffic = IWidget;
-
-interface TorrentNetworkTrafficTileProps {
- widget: ITorrentNetworkTraffic;
-}
-
-function TorrentNetworkTrafficTile({ widget }: TorrentNetworkTrafficTileProps) {
- const { t } = useTranslation(`modules/${definition.id}`);
- const { colors } = useMantineTheme();
- const setSafeInterval = useSetSafeInterval();
- const { configVersion, config } = useConfigContext();
-
- const [torrentHistory, torrentHistoryHandlers] = useListState([]);
- const [torrents, setTorrents] = useState([]);
-
- const downloadServices =
- config?.apps.filter(
- (app) =>
- app.integration.type === 'qBittorrent' ||
- app.integration.type === 'transmission' ||
- app.integration.type === 'deluge'
- ) ?? [];
- const totalDownloadSpeed = torrents.reduce((acc, torrent) => acc + torrent.downloadSpeed, 0);
- const totalUploadSpeed = torrents.reduce((acc, torrent) => acc + torrent.uploadSpeed, 0);
-
- useEffect(() => {
- if (downloadServices.length === 0) return;
- const interval = setSafeInterval(() => {
- // Send one request with each download service inside
- axios
- .post('/api/modules/torrents')
- .then((response) => {
- const responseData: NormalizedTorrentListResponse = response.data;
- setTorrents(responseData.torrents.flatMap((x) => x.torrents));
- })
- .catch((error) => {
- if (error.status === 401) return;
- setTorrents([]);
- // eslint-disable-next-line no-console
- console.error('Error while fetching torrents', error.response.data);
- showNotification({
- title: 'Torrent speed module failed to fetch torrents',
- autoClose: 1000,
- disallowClose: true,
- id: 'fail-torrent-speed-module',
- color: 'red',
- message:
- 'Error fetching torrents, please check your config for any potential errors, check the console for more info',
- });
- clearInterval(interval);
- });
- }, 1000);
- }, [configVersion]);
-
- useEffect(() => {
- torrentHistoryHandlers.append({
- x: Date.now(),
- down: totalDownloadSpeed,
- up: totalUploadSpeed,
- });
- }, [totalDownloadSpeed, totalUploadSpeed]);
-
- const history = torrentHistory.slice(-10);
- const chartDataUp = history.map((load, i) => ({
- x: load.x,
- y: load.up,
- })) as Datum[];
- const chartDataDown = history.map((load, i) => ({
- x: load.x,
- y: load.down,
- })) as Datum[];
-
- return (
-
- {t('card.lineChart.title')}
-
-
-
-
- {t('card.lineChart.totalDownload', { download: humanFileSize(totalDownloadSpeed) })}
-
-
-
-
-
- {t('card.lineChart.totalUpload', { upload: humanFileSize(totalUploadSpeed) })}
-
-
-
-
- {
- const Download = slice.points[0].data.y as number;
- const Upload = slice.points[1].data.y as number;
- // Get the number of seconds since the last update.
- const seconds = (Date.now() - (slice.points[0].data.x as number)) / 1000;
- // Round to the nearest second.
- const roundedSeconds = Math.round(seconds);
- return (
-
- {t('card.lineChart.timeSpan', { seconds: roundedSeconds })}
-
-
-
-
-
- {t('card.lineChart.download', { download: humanFileSize(Download) })}
-
-
-
-
-
- {t('card.lineChart.upload', { upload: humanFileSize(Upload) })}
-
-
-
-
-
- );
- }}
- data={[
- {
- id: 'downloads',
- data: chartDataUp,
- },
- {
- id: 'uploads',
- data: chartDataDown,
- },
- ]}
- curve="monotoneX"
- yFormat=" >-.2f"
- axisTop={null}
- axisRight={null}
- enablePoints={false}
- animate={false}
- enableGridX={false}
- enableGridY={false}
- enableArea
- defs={[
- linearGradientDef('gradientA', [
- { offset: 0, color: 'inherit' },
- { offset: 100, color: 'inherit', opacity: 0 },
- ]),
- ]}
- fill={[{ match: '*', id: 'gradientA' }]}
- colors={[colors.blue[5], colors.green[5]]}
- />
-
-
- );
-}
-
-export default definition;
-
-interface TorrentHistory {
- x: number;
- up: number;
- down: number;
-}
diff --git a/src/widgets/useNet/UsenetHistoryList.tsx b/src/widgets/useNet/UsenetHistoryList.tsx
index 28ee10ccf..2578fdec6 100644
--- a/src/widgets/useNet/UsenetHistoryList.tsx
+++ b/src/widgets/useNet/UsenetHistoryList.tsx
@@ -20,7 +20,7 @@ import { useTranslation } from 'next-i18next';
import { FunctionComponent, useState } from 'react';
import { useGetUsenetHistory } from '../../hooks/widgets/dashDot/api';
import { humanFileSize } from '../../tools/humanFileSize';
-import { parseDuration } from '../../tools/parseDuration';
+import { parseDuration } from '../../tools/client/parseDuration';
dayjs.extend(duration);
diff --git a/yarn.lock b/yarn.lock
index 398c6e544..399583df6 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1971,6 +1971,15 @@ __metadata:
languageName: node
linkType: hard
+"@tanstack/match-sorter-utils@npm:^8.7.0":
+ version: 8.7.6
+ resolution: "@tanstack/match-sorter-utils@npm:8.7.6"
+ dependencies:
+ remove-accents: 0.4.2
+ checksum: 3f3dda277e6e55ca1224a28b38a2deb3ac912c2f2f5263a32fa0d9126c6b6d05feb475539729fd248f1eb88b612109db90b847ec8fdfc05d0f4073c900a2d3f6
+ languageName: node
+ linkType: hard
+
"@tanstack/query-core@npm:4.19.1":
version: 4.19.1
resolution: "@tanstack/query-core@npm:4.19.1"
@@ -1978,6 +1987,21 @@ __metadata:
languageName: node
linkType: hard
+"@tanstack/react-query-devtools@npm:^4.24.4":
+ version: 4.24.4
+ resolution: "@tanstack/react-query-devtools@npm:4.24.4"
+ dependencies:
+ "@tanstack/match-sorter-utils": ^8.7.0
+ superjson: ^1.10.0
+ use-sync-external-store: ^1.2.0
+ peerDependencies:
+ "@tanstack/react-query": 4.24.4
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ checksum: 8b8f1ae8e55f016f25b383baae0000f0b608ec0327ee4eccb0a7b3b1c596b12f68c848e429be84c8a6039bd0a7d5bd36a7232fd7818868f1a3ae3d0462898e26
+ languageName: node
+ linkType: hard
+
"@tanstack/react-query@npm:^4.2.1":
version: 4.19.1
resolution: "@tanstack/react-query@npm:4.19.1"
@@ -3271,6 +3295,15 @@ __metadata:
languageName: node
linkType: hard
+"copy-anything@npm:^3.0.2":
+ version: 3.0.3
+ resolution: "copy-anything@npm:3.0.3"
+ dependencies:
+ is-what: ^4.1.8
+ checksum: d456dc5ec98dee7c7cf87d809eac30dc2ac942acd4cf970fab394e280ceb6dd7a8a7a5a44fcbcc50e0206658de3cc20b92863562f5797930bb2619f164f4c182
+ languageName: node
+ linkType: hard
+
"core-js-pure@npm:^3.25.1":
version: 3.26.1
resolution: "core-js-pure@npm:3.26.1"
@@ -4947,6 +4980,7 @@ __metadata:
"@nivo/line": ^0.79.1
"@tabler/icons": ^1.106.0
"@tanstack/react-query": ^4.2.1
+ "@tanstack/react-query-devtools": ^4.24.4
"@types/dockerode": ^3.3.9
"@types/node": 17.0.1
"@types/ping": ^0.4.1
@@ -5478,6 +5512,13 @@ __metadata:
languageName: node
linkType: hard
+"is-what@npm:^4.1.8":
+ version: 4.1.8
+ resolution: "is-what@npm:4.1.8"
+ checksum: b9bec3acff102d14ad467f4c74c9886af310fa160e07a63292c8c181e6768c7c4c1054644e13d67185b963644e4a513bce8c6b8ce3d3ca6f9488a69fccad5f97
+ languageName: node
+ linkType: hard
+
"isarray@npm:0.0.1":
version: 0.0.1
resolution: "isarray@npm:0.0.1"
@@ -7440,6 +7481,13 @@ __metadata:
languageName: node
linkType: hard
+"remove-accents@npm:0.4.2":
+ version: 0.4.2
+ resolution: "remove-accents@npm:0.4.2"
+ checksum: 84a6988555dea24115e2d1954db99509588d43fe55a1590f0b5894802776f7b488b3151c37ceb9e4f4b646f26b80b7325dcea2fae58bc3865df146e1fa606711
+ languageName: node
+ linkType: hard
+
"require-directory@npm:^2.1.1":
version: 2.1.1
resolution: "require-directory@npm:2.1.1"
@@ -8076,6 +8124,15 @@ __metadata:
languageName: node
linkType: hard
+"superjson@npm:^1.10.0":
+ version: 1.12.2
+ resolution: "superjson@npm:1.12.2"
+ dependencies:
+ copy-anything: ^3.0.2
+ checksum: cf7735e172811ed87476a7c2f1bb0e83725a0e3c2d7a50a71303a973060b3c710288767fb767a7a7eee8e5625d3ccaee1176a93e27f43841627512c15c4cdf84
+ languageName: node
+ linkType: hard
+
"supports-color@npm:^5.3.0":
version: 5.5.0
resolution: "supports-color@npm:5.5.0"
|