From 81b0f7c6e3b42fcc8b87bbbaedb776dafbf66fbf Mon Sep 17 00:00:00 2001 From: Daniel Shleifman Date: Sun, 6 Jun 2021 17:32:20 +0300 Subject: [PATCH 1/2] 7000 -> 5000 --- .../DialogTorrentDetailsContent/TorrentCache/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ? ( From 0d61c5192f25ebdfba3ffcadbe8dfd03bec90b97 Mon Sep 17 00:00:00 2001 From: Daniel Shleifman Date: Sun, 6 Jun 2021 19:50:11 +0300 Subject: [PATCH 2/2] closeServer dialog added --- web/src/App/Sidebar.jsx | 16 +++-------- web/src/components/CloseServer.jsx | 43 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 web/src/components/CloseServer.jsx diff --git a/web/src/App/Sidebar.jsx b/web/src/App/Sidebar.jsx index 5d6edac..0f911c8 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 { AppSidebarStyle } from './style' @@ -37,12 +34,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? + + + + + + + + ) +}