From 0fe9fe63dee50e15c0ffb7439db446c454996128 Mon Sep 17 00:00:00 2001 From: YouROK <8yourok8@mail.ru> Date: Wed, 20 Jan 2021 10:13:29 +0300 Subject: [PATCH] update web --- web/dest/index.html | 4 ++-- web/src/components/DialogTorrentInfo.js | 6 ++++++ web/src/components/Torrent.js | 10 ++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/dest/index.html b/web/dest/index.html index 9ce8953..250aec9 100644 --- a/web/dest/index.html +++ b/web/dest/index.html @@ -2,5 +2,5 @@ //# sourceMappingURL=firebase-app.js.map \ No newline at end of file + \ No newline at end of file diff --git a/web/src/components/DialogTorrentInfo.js b/web/src/components/DialogTorrentInfo.js index ddc3f93..6bc382e 100644 --- a/web/src/components/DialogTorrentInfo.js +++ b/web/src/components/DialogTorrentInfo.js @@ -2,6 +2,7 @@ import React, { useEffect } from 'react' import Typography from '@material-ui/core/Typography' import { Button, ButtonGroup, Grid, List, ListItem } from '@material-ui/core' import CachedIcon from '@material-ui/icons/Cached' +import LinearProgress from '@material-ui/core/LinearProgress'; import { getPeerString, humanizeSize } from '../utils/Utils' import { playlistTorrHost, streamHost } from '../utils/Hosts' @@ -18,14 +19,18 @@ const style = { poster: { display: 'flex', flexDirection: 'row', + borderRadius:'5px', }, } export default function DialogTorrentInfo(props) { const [torrent, setTorrent] = React.useState(props.torrent) + const [progress, setProgress] = React.useState(-1) useEffect(() => { setTorrent(props.torrent) + if(torrent.stat==2) + setProgress(torrent.preloaded_bytes * 100 / torrent.preload_size) }, [props.torrent, props.open]) return ( @@ -47,6 +52,7 @@ export default function DialogTorrentInfo(props) { + {torrent.stat==2 && } diff --git a/web/src/components/Torrent.js b/web/src/components/Torrent.js index 3a533f6..f302c6a 100644 --- a/web/src/components/Torrent.js +++ b/web/src/components/Torrent.js @@ -17,12 +17,6 @@ import { torrentsHost } from '../utils/Hosts' import DialogCacheInfo from './DialogCacheInfo' import DataUsageIcon from '@material-ui/icons/DataUsage' -const style = { - width100: { - width: '100%', - }, -} - export default function Torrent(props) { const [open, setOpen] = React.useState(false) const [showCache, setShowCache] = React.useState(false) @@ -53,14 +47,14 @@ export default function Torrent(props) {