mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 23:15:46 +01:00
Usenet styling and fixes
This commit is contained in:
@@ -17,7 +17,11 @@ import dayjs from 'dayjs';
|
|||||||
import duration from 'dayjs/plugin/duration';
|
import duration from 'dayjs/plugin/duration';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { useConfigContext } from '../../config/provider';
|
import { useConfigContext } from '../../config/provider';
|
||||||
import { useGetUsenetInfo, usePauseUsenetQueue, useResumeUsenetQueue } from '../../hooks/widgets/dashDot/api';
|
import {
|
||||||
|
useGetUsenetInfo,
|
||||||
|
usePauseUsenetQueue,
|
||||||
|
useResumeUsenetQueue,
|
||||||
|
} from '../../hooks/widgets/dashDot/api';
|
||||||
import { humanFileSize } from '../../tools/humanFileSize';
|
import { humanFileSize } from '../../tools/humanFileSize';
|
||||||
import { AppIntegrationType } from '../../types/app';
|
import { AppIntegrationType } from '../../types/app';
|
||||||
import { defineWidget } from '../helper';
|
import { defineWidget } from '../helper';
|
||||||
@@ -52,6 +56,8 @@ function UseNetTile({}: UseNetTileProps) {
|
|||||||
const downloadApps =
|
const downloadApps =
|
||||||
config?.apps.filter((x) => x.integration && downloadAppTypes.includes(x.integration.type)) ??
|
config?.apps.filter((x) => x.integration && downloadAppTypes.includes(x.integration.type)) ??
|
||||||
[];
|
[];
|
||||||
|
const { ref, width, height } = useElementSize();
|
||||||
|
const MIN_WIDTH_MOBILE = useMantineTheme().breakpoints.xs;
|
||||||
|
|
||||||
const [selectedAppId, setSelectedApp] = useState<string | null>(downloadApps[0]?.id);
|
const [selectedAppId, setSelectedApp] = useState<string | null>(downloadApps[0]?.id);
|
||||||
const { data } = useGetUsenetInfo({ appId: selectedAppId! });
|
const { data } = useGetUsenetInfo({ appId: selectedAppId! });
|
||||||
@@ -80,9 +86,6 @@ function UseNetTile({}: UseNetTileProps) {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { ref, width, height } = useElementSize();
|
|
||||||
const MIN_WIDTH_MOBILE = useMantineTheme().breakpoints.xs;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs keepMounted={false} defaultValue="queue">
|
<Tabs keepMounted={false} defaultValue="queue">
|
||||||
<Tabs.List ref={ref} mb="md" style={{ flex: 1 }} grow>
|
<Tabs.List ref={ref} mb="md" style={{ flex: 1 }} grow>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export const UsenetHistoryList: FunctionComponent<UsenetHistoryListProps> = ({ a
|
|||||||
const { data, isLoading, isError, error } = useGetUsenetHistory({
|
const { data, isLoading, isError, error } = useGetUsenetHistory({
|
||||||
limit: PAGE_SIZE,
|
limit: PAGE_SIZE,
|
||||||
offset: (page - 1) * PAGE_SIZE,
|
offset: (page - 1) * PAGE_SIZE,
|
||||||
appId: appId,
|
appId,
|
||||||
});
|
});
|
||||||
const totalPages = Math.ceil((data?.total || 1) / PAGE_SIZE);
|
const totalPages = Math.ceil((data?.total || 1) / PAGE_SIZE);
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export const UsenetQueueList: FunctionComponent<UsenetQueueListProps> = ({ appId
|
|||||||
const { data, isLoading, isError, error } = useGetUsenetDownloads({
|
const { data, isLoading, isError, error } = useGetUsenetDownloads({
|
||||||
limit: PAGE_SIZE,
|
limit: PAGE_SIZE,
|
||||||
offset: (page - 1) * PAGE_SIZE,
|
offset: (page - 1) * PAGE_SIZE,
|
||||||
appId: appId,
|
appId,
|
||||||
});
|
});
|
||||||
const totalPages = Math.ceil((data?.total || 1) / PAGE_SIZE);
|
const totalPages = Math.ceil((data?.total || 1) / PAGE_SIZE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user