diff --git a/web/src/App/Sidebar.jsx b/web/src/App/Sidebar.jsx index 1ecec1b..b6cf730 100644 --- a/web/src/App/Sidebar.jsx +++ b/web/src/App/Sidebar.jsx @@ -1,4 +1,4 @@ -import { playlistAllHost, shutdownHost } from 'utils/Hosts' +import { playlistAllHost } from 'utils/Hosts' import Divider from '@material-ui/core/Divider' import ListItem from '@material-ui/core/ListItem' import ListItemIcon from '@material-ui/core/ListItemIcon' @@ -8,12 +8,9 @@ import RemoveAll from 'components/RemoveAll' import SettingsDialog from 'components/Settings' import AboutDialog from 'components/About' import UploadDialog from 'components/Upload' -import { - CreditCard as CreditCardIcon, - List as ListIcon, - PowerSettingsNew as PowerSettingsNewIcon, -} from '@material-ui/icons' +import { CreditCard as CreditCardIcon, List as ListIcon } from '@material-ui/icons' import List from '@material-ui/core/List' +import CloseServer from 'components/CloseServer' import { useTranslation } from 'react-i18next' import { AppSidebarStyle } from './style' @@ -39,12 +36,7 @@ export default function Sidebar({ isDrawerOpen, setIsDonationDialogOpen }) { - fetch(shutdownHost())}> - - - - - + diff --git a/web/src/components/CloseServer.jsx b/web/src/components/CloseServer.jsx new file mode 100644 index 0000000..22d155b --- /dev/null +++ b/web/src/components/CloseServer.jsx @@ -0,0 +1,43 @@ +import { useState } from 'react' +import { Button, Dialog, DialogActions, DialogTitle, ListItem, ListItemIcon, ListItemText } from '@material-ui/core' +import { PowerSettingsNew as PowerSettingsNewIcon } from '@material-ui/icons' +import { shutdownHost } from 'utils/Hosts' + +export default function CloseServer() { + const [open, setOpen] = useState(false) + const closeDialog = () => setOpen(false) + const openDialog = () => setOpen(true) + + return ( + <> + + + + + + + + + + Close server? + + + + + + + + ) +} diff --git a/web/src/components/DialogTorrentDetailsContent/TorrentCache/index.jsx b/web/src/components/DialogTorrentDetailsContent/TorrentCache/index.jsx index 0938fac..fbb1467 100644 --- a/web/src/components/DialogTorrentDetailsContent/TorrentCache/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/TorrentCache/index.jsx @@ -10,7 +10,7 @@ const TorrentCache = memo( const cacheMap = useCreateCacheMap(cache) const preloadPiecesAmount = Math.round(cache.Capacity / cache.PiecesLength - 1) - const isSnakeLarge = cacheMap.length > 7000 + const isSnakeLarge = cacheMap.length > 5000 return isMini ? (