diff --git a/web/src/components/DialogTorrentDetailsContent/index.jsx b/web/src/components/DialogTorrentDetailsContent/index.jsx index 93bb969..09f5207 100644 --- a/web/src/components/DialogTorrentDetailsContent/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/index.jsx @@ -1,18 +1,9 @@ import { NoImageIcon } from 'icons' -import { getPeerString, humanizeSize } from 'utils/Utils' +import { humanizeSize } from 'utils/Utils' import { CopyToClipboard } from 'react-copy-to-clipboard' import { useEffect, useState } from 'react' import { Button } from '@material-ui/core' import ptt from 'parse-torrent-title' -import { - ArrowDownward as ArrowDownwardIcon, - ArrowUpward as ArrowUpwardIcon, - SwapVerticalCircle as SwapVerticalCircleIcon, - ViewAgenda as ViewAgendaIcon, - Widgets as WidgetsIcon, - PhotoSizeSelectSmall as PhotoSizeSelectSmallIcon, - Build as BuildIcon, -} from '@material-ui/icons' import axios from 'axios' import { playlistTorrHost, streamHost, torrentsHost, viewedHost } from 'utils/Hosts' import { GETTING_INFO, IN_DB } from 'torrentStates' @@ -28,7 +19,7 @@ import { Poster, SectionTitle, SectionSubName, - StatisticsWrapper, + WidgetWrapper, LoadingProgress, SectionHeader, CacheSection, @@ -37,7 +28,15 @@ import { SmallLabel, Table, } from './style' -import StatisticsField from './StatisticsField' +import { + DownlodSpeedWidget, + UploadSpeedWidget, + PeersWidget, + SizeWidget, + PiecesCountWidget, + PiecesLengthWidget, + StatusWidget, +} from './widgets' const shortenText = (text, count) => text.slice(0, count) + (text.length > count ? '...' : '') @@ -120,64 +119,23 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { 'loading' ) : isDetailedCacheView ? ( - - +
+ Data + + + + + + + + + +
- - - - - - - - - - - -
- +
+ Cache + +
) : ( @@ -194,39 +152,12 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { {shortenText(title, 50)} )} - - - - - - - - - + + + + + + diff --git a/web/src/components/DialogTorrentDetailsContent/style.js b/web/src/components/DialogTorrentDetailsContent/style.js index 3ae704f..fe62ab2 100644 --- a/web/src/components/DialogTorrentDetailsContent/style.js +++ b/web/src/components/DialogTorrentDetailsContent/style.js @@ -91,12 +91,15 @@ export const SectionHeader = styled.div` ` export const DetailedTorrentCacheViewWrapper = styled.div` - padding: 40px; overflow: auto; min-height: 80vh; + padding: 40px; + > :not(:last-child) { + padding-bottom: 50px; + } ` -export const StatisticsWrapper = styled.div` +export const WidgetWrapper = styled.div` display: grid; grid-template-columns: repeat(auto-fit, minmax(max-content, 220px)); gap: 20px; diff --git a/web/src/components/DialogTorrentDetailsContent/widgets.jsx b/web/src/components/DialogTorrentDetailsContent/widgets.jsx new file mode 100644 index 0000000..6a59f0c --- /dev/null +++ b/web/src/components/DialogTorrentDetailsContent/widgets.jsx @@ -0,0 +1,68 @@ +import { + ArrowDownward as ArrowDownwardIcon, + ArrowUpward as ArrowUpwardIcon, + SwapVerticalCircle as SwapVerticalCircleIcon, + ViewAgenda as ViewAgendaIcon, + Widgets as WidgetsIcon, + PhotoSizeSelectSmall as PhotoSizeSelectSmallIcon, + Build as BuildIcon, +} from '@material-ui/icons' +import { getPeerString, humanizeSize } from 'utils/Utils' + +import StatisticsField from './StatisticsField' + +export const DownlodSpeedWidget = ({ data }) => ( + +) + +export const UploadSpeedWidget = ({ data }) => ( + +) + +export const PeersWidget = ({ data }) => ( + +) + +export const PiecesCountWidget = ({ data }) => ( + +) +export const PiecesLengthWidget = ({ data }) => ( + +) +export const StatusWidget = ({ data }) => ( + +) + +export const SizeWidget = ({ data }) => ( + +)