update web

This commit is contained in:
nikk gitanes
2021-07-15 10:18:41 +03:00
parent ab04c97de5
commit c2eb026ae9
21 changed files with 118 additions and 120 deletions

View File

@@ -21,7 +21,7 @@ export default function AboutDialog() {
useEffect(() => {
axios.get(echoHost()).then(({ data }) => setTorrServerVersion(data))
}, [])
return (
<>
<ListItem button key='Settings' onClick={() => setOpen(true)}>

View File

@@ -15,7 +15,7 @@ export const HeaderSection = styled.section`
padding: 20px;
img {
width: 80px;
width: 64px;
}
@media (max-width: 930px) {

View File

@@ -99,7 +99,9 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
})
}, [hash])
const bufferSize = settings?.PreloadBuffer ? Capacity : 33554432 // Default is 32mb if PreloadBuffer is false
const preloadPerc = settings?.PreloadCache
const preloadSize = (Capacity / 100) * preloadPerc
const bufferSize = preloadSize > 33554432 ? preloadSize : 33554432 // Not less than 32MB
const getParsedTitle = () => {
const newNameStringArr = []
@@ -199,7 +201,7 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
<CacheSection>
<SectionHeader>
<SectionTitle mb={20}>{t('Buffer')}</SectionTitle>
{!settings?.PreloadBuffer && <SectionSubName>{t('BufferNote')}</SectionSubName>}
{bufferSize <= 33554432 && <SectionSubName>{t('BufferNote')}</SectionSubName>}
<LoadingProgress
value={Filled}
fullAmount={bufferSize}

View File

@@ -4,7 +4,6 @@ import { FormControlLabel, Switch } from '@material-ui/core'
import TextField from '@material-ui/core/TextField'
import {
Divider,
PreloadCacheValue,
MainSettingsContent,
StorageButton,
@@ -41,7 +40,8 @@ export default function PrimarySettingsComponent({
updateSettings,
}) {
const { t } = useTranslation()
const { PreloadBuffer, UseDisk, TorrentsSavePath, RemoveCacheOnDrop } = settings || {}
const { UseDisk, TorrentsSavePath, RemoveCacheOnDrop } = settings || {}
const preloadCacheSize = Math.round((cacheSize / 100) * preloadCachePercentage)
return (
<MainSettingsContent>
@@ -51,7 +51,7 @@ export default function PrimarySettingsComponent({
<PreloadCachePercentage
value={100 - cachePercentage}
label={`${t('Cache')} ${cacheSize} MB`}
isPreloadEnabled={PreloadBuffer}
preloadCachePercentage={preloadCachePercentage}
/>
<PreloadCacheValue color={cacheBeforeReaderColor}>
@@ -70,7 +70,7 @@ export default function PrimarySettingsComponent({
<div>{t('SettingsDialog.CacheAfterReaderDesc')}</div>
</PreloadCacheValue>
<Divider />
<br />
<SliderInput
isProMode={isProMode}
@@ -97,16 +97,15 @@ export default function PrimarySettingsComponent({
/>
<SliderInput
isProMode={isProMode}
title={t('SettingsDialog.PreloadCache')}
value={preloadCachePercentage}
setValue={setPreloadCachePercentage}
sliderMin={0}
sliderMax={100}
inputMin={0}
inputMax={100}
isProMode={isProMode}
title={`${t('SettingsDialog.PreloadCache')} - ${preloadCachePercentage}% (${preloadCacheSize} MB)`}
value={preloadCachePercentage}
setValue={setPreloadCachePercentage}
sliderMin={0}
sliderMax={100}
inputMin={0}
inputMax={100}
/>
</div>
{UseDisk ? (

View File

@@ -70,7 +70,7 @@ export default function SettingsDialog({ handleClose }) {
const { CacheSize, ReaderReadAHead, PreloadCache } = settings || {}
useEffect(() => {
if (!CacheSize || !ReaderReadAHead || !PreloadCache) return
if (!CacheSize || !ReaderReadAHead) return
setCacheSize(CacheSize)
setCachePercentage(ReaderReadAHead)

View File

@@ -17,7 +17,7 @@ export default {
EnableIPv6: false,
ForceEncrypt: false,
PeersListenPort: 0,
PreloadBuffer: false,
PreloadCache: 0,
RemoveCacheOnDrop: false,
RetrackersMode: 1,
Strategy: 0,

View File

@@ -175,7 +175,7 @@ export const PreloadCachePercentage = styled.div.attrs(({ value }) => ({
background: `linear-gradient(to right, ${cacheBeforeReaderColor} 0%, ${cacheBeforeReaderColor} ${value}%, ${cacheAfterReaderColor} ${value}%, ${cacheAfterReaderColor} 100%)`,
},
}))`
${({ label, isPreloadEnabled }) => css`
${({ label, preloadCachePercentage }) => css`
border: 1px solid #323637;
padding: 10px 20px;
border-radius: 5px;
@@ -190,17 +190,16 @@ export const PreloadCachePercentage = styled.div.attrs(({ value }) => ({
font-size: 20px;
}
${isPreloadEnabled &&
css`
:after {
content: '';
width: 100%;
height: 2px;
background: #323637;
position: absolute;
bottom: 0;
left: 0;
}
`}
:after {
content: '';
width: ${preloadCachePercentage}%;
height: 100%;
background: #323637;
position: absolute;
bottom: 0;
left: 0;
border-radius: 4px;
filter: opacity(0.15);
}
`}
`

View File

@@ -21,7 +21,7 @@
"AddFromLink": "Add from Link",
"AddNewTorrent": "Add new torrent",
"Buffer": "Preload Buffer / Cache",
"BufferNote": "Enable “Preload Buffer” in settings to see cache loading progress",
"BufferNote": "Set Preload Cache Before Play > 32 MB in settings to change preload size",
"Cache": "Cache",
"Cancel": "Cancel",
"Clear": "Clear",
@@ -88,11 +88,10 @@
"DownloadRateLimit": "Download Rate Limit (Kilobytes)",
"ForceEncrypt": "Force Encrypt Headers",
"PeersListenPort": "Peers Listen Port",
"PreloadBuffer": "Preload Buffer",
"PreloadCache": "Preload Cache Before Play",
"ProMode": "PRO mode",
"RAM": "RAM",
"ReaderReadAHead": "Readahead Cache % (5-100%, rec. 95%)",
"PreloadCache": "Preload Cache Before Play %",
"ReaderReadAHead": "Readahead Cache (5-100%, rec. 95%)",
"RemoveCacheOnDrop": "Remove Cache from Disk on Drop Torrent",
"RemoveCacheOnDropDesc": "If disabled, remove cache on delete torrent.",
"RemoveRetrackers": "Remove retrackers",

View File

@@ -21,7 +21,7 @@
"AddFromLink": "Добавить",
"AddNewTorrent": "Добавить новый торрент",
"Buffer": "Предзагрузка / Кеш",
"BufferNote": "Включите «Наполнять кеш перед началом воспроизведения» в настройках для показа заполнения кеша",
"BufferNote": "Установите Буфер предзагрузки > 32 МБ в настройках для измененения размера предзагрузки",
"Cache": "Кеш",
"Cancel": "Отмена",
"Clear": "Очистить",
@@ -83,18 +83,17 @@
"ConnectionsLimit": "Торрент-соединения (рек. 20-25)",
"DHT": "DHT (Distributed Hash Table)",
"DhtConnectionLimit": "Лимит подключений DHT",
"Disk": "Диск",
"Disk": "ПЗУ / Диск",
"DontAddRetrackers": "Ничего не делать",
"DownloadRateLimit": "Ограничение скорости загрузки (Килобайты)",
"ForceEncrypt": "Принудительное шифрование заголовков",
"PeersListenPort": "Порт для входящих подключений",
"PreloadBuffer": "Наполнять кеш перед началом воспроизведения",
"PreloadCache": "Буфер предзагрузки",
"ProMode": "ПРО-режим",
"RAM": "Оперативная память",
"ReaderReadAHead": "Наполнять кэш % (5-100%, рек. 95%)",
"PreloadCache": "Загружать кэш перед проигрыванием %",
"ReaderReadAHead": "Опережающий кеш (5-100%, рек. 95%)",
"RemoveCacheOnDrop": "Очищать кеш на диске при отключении торрента",
"RemoveCacheOnDropDesc": "Если отключено, кэш очищается при удалении торрента.",
"RemoveCacheOnDropDesc": "Если отключено, кеш очищается при удалении торрента.",
"RemoveRetrackers": "Удалять",
"ReplaceRetrackers": "Заменять",
"RetrackersMode": "Ретрекеры",

View File

@@ -4,7 +4,7 @@ export const themeColors = {
light: {
app: {
headerToggleColor: '#4db380',
appSecondaryColor: '#CBE8D9',
appSecondaryColor: '#cbe8d9',
sidebarBGColor: '#575757',
sidebarFillColor: '#dee3e5',
},
@@ -99,7 +99,7 @@ export const themeColors = {
defaultTertiaryColor: '#545a5e',
},
settingsDialog: {
contentBG: '#5A6166',
contentBG: '#5a6166',
footerBG: '#323637',
},
},