mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
update web
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react'
|
|||||||
import Typography from '@material-ui/core/Typography'
|
import Typography from '@material-ui/core/Typography'
|
||||||
import { Button, ButtonGroup, Grid, List, ListItem } from '@material-ui/core'
|
import { Button, ButtonGroup, Grid, List, ListItem } from '@material-ui/core'
|
||||||
import CachedIcon from '@material-ui/icons/Cached'
|
import CachedIcon from '@material-ui/icons/Cached'
|
||||||
|
import LinearProgress from '@material-ui/core/LinearProgress';
|
||||||
|
|
||||||
import { getPeerString, humanizeSize } from '../utils/Utils'
|
import { getPeerString, humanizeSize } from '../utils/Utils'
|
||||||
import { playlistTorrHost, streamHost } from '../utils/Hosts'
|
import { playlistTorrHost, streamHost } from '../utils/Hosts'
|
||||||
@@ -18,14 +19,18 @@ const style = {
|
|||||||
poster: {
|
poster: {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
borderRadius:'5px',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DialogTorrentInfo(props) {
|
export default function DialogTorrentInfo(props) {
|
||||||
const [torrent, setTorrent] = React.useState(props.torrent)
|
const [torrent, setTorrent] = React.useState(props.torrent)
|
||||||
|
const [progress, setProgress] = React.useState(-1)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTorrent(props.torrent)
|
setTorrent(props.torrent)
|
||||||
|
if(torrent.stat==2)
|
||||||
|
setProgress(torrent.preloaded_bytes * 100 / torrent.preload_size)
|
||||||
}, [props.torrent, props.open])
|
}, [props.torrent, props.open])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -47,6 +52,7 @@ export default function DialogTorrentInfo(props) {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
{torrent.stat==2 && <LinearProgress style={{marginTop:'10px'}} variant="determinate" value={progress} />}
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<List>
|
<List>
|
||||||
|
|||||||
@@ -17,12 +17,6 @@ import { torrentsHost } from '../utils/Hosts'
|
|||||||
import DialogCacheInfo from './DialogCacheInfo'
|
import DialogCacheInfo from './DialogCacheInfo'
|
||||||
import DataUsageIcon from '@material-ui/icons/DataUsage'
|
import DataUsageIcon from '@material-ui/icons/DataUsage'
|
||||||
|
|
||||||
const style = {
|
|
||||||
width100: {
|
|
||||||
width: '100%',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Torrent(props) {
|
export default function Torrent(props) {
|
||||||
const [open, setOpen] = React.useState(false)
|
const [open, setOpen] = React.useState(false)
|
||||||
const [showCache, setShowCache] = React.useState(false)
|
const [showCache, setShowCache] = React.useState(false)
|
||||||
@@ -53,14 +47,14 @@ export default function Torrent(props) {
|
|||||||
<ListItem>
|
<ListItem>
|
||||||
<ButtonGroup style={{width:'100%',boxShadow:'2px 2px 2px gray'}} disableElevation variant="contained" color="primary">
|
<ButtonGroup style={{width:'100%',boxShadow:'2px 2px 2px gray'}} disableElevation variant="contained" color="primary">
|
||||||
<Button
|
<Button
|
||||||
style={style.width100}
|
style={{width: '100%', justifyContent:'start'}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowCache(false)
|
setShowCache(false)
|
||||||
setOpen(true)
|
setOpen(true)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{torrent.poster &&
|
{torrent.poster &&
|
||||||
<img src={torrent.poster} alt={torrent.title} style={{width: 'auto',height:'100px',margin:'0 10px 0 0',borderRadius:'5px'}}/>
|
<img src={torrent.poster} alt={torrent.title} align="left" style={{width: 'auto',height:'100px',margin:'0 10px 0 0',borderRadius:'5px'}}/>
|
||||||
}
|
}
|
||||||
<Typography>
|
<Typography>
|
||||||
{torrent.name ? torrent.name : torrent.title}
|
{torrent.name ? torrent.name : torrent.title}
|
||||||
|
|||||||
Reference in New Issue
Block a user