diff --git a/src/app/config-page.js b/src/app/config-page.js index 296fc16..65b6a1a 100644 --- a/src/app/config-page.js +++ b/src/app/config-page.js @@ -5,6 +5,8 @@ import Toggle from 'material-ui/Toggle'; import RaisedButton from 'material-ui/RaisedButton'; import TextField from 'material-ui/TextField' import Slider from 'material-ui/Slider' +import {Tabs, Tab} from 'material-ui/Tabs'; +import SvgIcon from 'material-ui/SvgIcon'; import fs from 'fs' let dialog @@ -16,6 +18,7 @@ export default class ConfigPage extends Page { super(props) this.setTitle('Rats settings'); this.options = {} + this.state = {tabIndex: 'main'} } componentDidMount() { this.loadSettings() @@ -38,286 +41,397 @@ export default class ConfigPage extends Page { render() { return (
-
- { + this.setState({tabIndex: index})}> + { window.router('/') }} /> -
+ + + + }> +
+ { + this.options.indexer = checked + if(!this.options.indexer) + this.options.p2p = false + this.forceUpdate() + }} + /> + +
+
+
{__('Scanning port')}
+ 0 ? undefined : __('This field is required')} + value={this.options.spiderPort} + onChange={(e, value) => { + if(!value) + value = 0 + if(value > 65535) + value = 65535 + + this.options.spiderPort = parseInt(value) + this.forceUpdate() + }} + /> +
+
* {__('For current work TCP and UDP ports must be fully open and forward in case of router usage')}
+
+ +
+
+
{__('Trackers responce port')}
+ 0 ? undefined : __('This field is required')} + value={this.options.udpTrackersPort} + onChange={(e, value) => { + if(!value) + value = 0 + if(value > 65535) + value = 65535 + + this.options.udpTrackersPort = parseInt(value) + this.forceUpdate() + }} + /> +
+
* {__('For current work UDP port must be fully open and forward in case of router usage')}
+
+ + { + this.options.upnp = checked + this.forceUpdate() + }} + /> + +
+
{__('Collection directory')}
+ 0 ? undefined : __('This field is required')} + value={this.options.dbPath} + onChange={(e, value) => { + if(!fs.existsSync(value)) + return + + this.options.dbPath = value + this.forceUpdate() + }} + /> + { + if(!dialog) + return + const dir = dialog.showOpenDialog({properties: ['openDirectory']})[0] + if(dir) + { + this.options.dbPath = dir + this.forceUpdate() + } + }} /> +
+ +
+
{__('Download torrents directory')}
+ { + if(!fs.existsSync(value)) + return + + this.options.client.downloadPath = value + this.forceUpdate() + }} + /> + { + if(!dialog) + return + const dir = dialog.showOpenDialog({properties: ['openDirectory']})[0] + if(dir) + { + this.options.client.downloadPath = dir + this.forceUpdate() + } + }} /> +
+ + { + this.options.trayOnMinimize = checked + this.forceUpdate() + }} + /> + + { + this.options.trayOnClose = checked + this.forceUpdate() + }} + /> + +
+
+ + + + + + + + + + }> +
+ +
{__('P2P Rats network settings')}:
+ + { + this.options.p2p = this.options.indexer && checked + this.forceUpdate() + }} + /> +
+ { + this.options.p2pBootstrap = checked + this.forceUpdate() + }} + /> +
* {__('Use extrnral bootstrap nodes to get p2p peers when network setted wrong or need external source')}
+
+
+
+
{__('Max peers limit')} ({__('current')}: {this.options.p2pConnections})
+ { + this.options.p2pConnections = value + this.forceUpdate() + }} + /> +
+
+
+ { + this.options.p2pReplicationServer = checked + if(!checked) + this.options.p2pReplication = false + this.forceUpdate() + }} + /> +
* {__('Enable torrents replication server for other rats clients (required for replication)')}.
+
+
+ { + this.options.p2pReplication = checked + if(checked) + this.options.p2pReplicationServer = true + this.forceUpdate() + }} + /> +
* {__('Enable torrents replication from another rats clients. Dont recomended if torrent scanner works correct')}.
+
+ +
+
+ + + + + + + + + + + + + + }> +
+ +
+ { + this.options.recheckFilesOnAdding = checked + this.forceUpdate() + }} + /> +
* {__('Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.')}
+
+ +
{__('Torrent network scanner settings')}:
+ +
+
+
{__('Scanner walk speed')} ({__('current')}: {this.options.spider && this.options.spider.walkInterval}) [{__('affected after program reload')}]
+ { + this.options.spider.walkInterval = value + this.forceUpdate() + }} + /> +
+
* {__('Low value')} - {__('fast initial scanning and high cpu usage')}. {__('High Value')} - {__('low cpu usage but very slow scanning')}. + {__('Good value between')} 3-60. {__('Defaul value')}: 5
+
+
+
+
{__('Nodes usage')} ({__('current')}: {this.options.spider && this.options.spider.nodesUsage})
+ { + this.options.spider.nodesUsage = value + this.forceUpdate() + }} + /> +
+
* {__('Low Value')} - {__('very low usage of nodes, low network traffic, slow torrent scanning')}. {__('High value')} - {__('high traffic, fast scanning, high routers usage')}. + {__('Recomended value between')} 10-1000. {__('Defaul value')}: 100. 0 - {__('Ignore this option')} ({__('no limit')}). +
+
+
+
+
{__('Reduce network packages')} ({__('current')}: {this.options.spider && this.options.spider.packagesLimit})
+ { + this.options.spider.packagesLimit = value + this.forceUpdate() + }} + /> +
+
* {__('Low Value')} - {__('ignore more usless network packages, lower traffic and routers usage')}. {__('High Value')} - {__('high traffic and router usage in prospect')}. + {__('Recomended value between')} 300-2000. {__('Defaul value')}: 500. 0 - {__('Ignore this option')} ({__('no limit')}). +
+
+ +
+
+
- { - this.options.indexer = checked - if(!this.options.indexer) - this.options.p2p = false - this.forceUpdate() - }} - /> -
-
-
{__('Scanning port')}
- 0 ? undefined : __('This field is required')} - value={this.options.spiderPort} - onChange={(e, value) => { - if(!value) - value = 0 - if(value > 65535) - value = 65535 - - this.options.spiderPort = parseInt(value) - this.forceUpdate() - }} - /> -
-
* {__('For current work TCP and UDP ports must be fully open and forward in case of router usage')}
-
- -
-
-
{__('Trackers responce port')}
- 0 ? undefined : __('This field is required')} - value={this.options.udpTrackersPort} - onChange={(e, value) => { - if(!value) - value = 0 - if(value > 65535) - value = 65535 - - this.options.udpTrackersPort = parseInt(value) - this.forceUpdate() - }} - /> -
-
* {__('For current work UDP port must be fully open and forward in case of router usage')}
-
- - { - this.options.upnp = checked - this.forceUpdate() - }} - /> - -
-
{__('Collection directory')}
- 0 ? undefined : __('This field is required')} - value={this.options.dbPath} - onChange={(e, value) => { - if(!fs.existsSync(value)) - return - - this.options.dbPath = value - this.forceUpdate() - }} - /> - { - if(!dialog) - return - const dir = dialog.showOpenDialog({properties: ['openDirectory']})[0] - if(dir) - { - this.options.dbPath = dir - this.forceUpdate() - } - }} /> -
- -
-
{__('Download torrents directory')}
- { - if(!fs.existsSync(value)) - return - - this.options.client.downloadPath = value - this.forceUpdate() - }} - /> - { - if(!dialog) - return - const dir = dialog.showOpenDialog({properties: ['openDirectory']})[0] - if(dir) - { - this.options.client.downloadPath = dir - this.forceUpdate() - } - }} /> -
- - { - this.options.trayOnMinimize = checked - this.forceUpdate() - }} - /> - - { - this.options.trayOnClose = checked - this.forceUpdate() - }} - /> - -
{__('P2P Rats network settings')}:
- { - this.options.p2p = this.options.indexer && checked - this.forceUpdate() - }} - /> -
- { - this.options.p2pBootstrap = checked - this.forceUpdate() - }} - /> -
* {__('Use extrnral bootstrap nodes to get p2p peers when network setted wrong or need external source')}
-
-
-
-
{__('Max peers limit')} ({__('current')}: {this.options.p2pConnections})
- { - this.options.p2pConnections = value - this.forceUpdate() - }} - /> -
-
-
- { - this.options.p2pReplicationServer = checked - if(!checked) - this.options.p2pReplication = false - this.forceUpdate() - }} - /> -
* {__('Enable torrents replication server for other rats clients (required for replication)')}.
-
-
- { - this.options.p2pReplication = checked - if(checked) - this.options.p2pReplicationServer = true - this.forceUpdate() - }} - /> -
* {__('Enable torrents replication from another rats clients. Dont recomended if torrent scanner works correct')}.
-
-
- { - this.options.recheckFilesOnAdding = checked - this.forceUpdate() - }} - /> -
* {__('Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.')}
-
- - -
{__('Torrent network scanner settings')}:
-
-
-
{__('Scanner walk speed')} ({__('current')}: {this.options.spider && this.options.spider.walkInterval}) [{__('affected after program reload')}]
- { - this.options.spider.walkInterval = value - this.forceUpdate() - }} - /> -
-
* {__('Low value')} - {__('fast initial scanning and high cpu usage')}. {__('High Value')} - {__('low cpu usage but very slow scanning')}. - {__('Good value between')} 3-60. {__('Defaul value')}: 5
-
-
-
-
{__('Nodes usage')} ({__('current')}: {this.options.spider && this.options.spider.nodesUsage})
- { - this.options.spider.nodesUsage = value - this.forceUpdate() - }} - /> -
-
* {__('Low Value')} - {__('very low usage of nodes, low network traffic, slow torrent scanning')}. {__('High value')} - {__('high traffic, fast scanning, high routers usage')}. - {__('Recomended value between')} 10-1000. {__('Defaul value')}: 100. 0 - {__('Ignore this option')} ({__('no limit')}). -
-
-
-
-
{__('Reduce network packages')} ({__('current')}: {this.options.spider && this.options.spider.packagesLimit})
- { - this.options.spider.packagesLimit = value - this.forceUpdate() - }} - /> -
-
* {__('Low Value')} - {__('ignore more usless network packages, lower traffic and routers usage')}. {__('High Value')} - {__('high traffic and router usage in prospect')}. - {__('Recomended value between')} 300-2000. {__('Defaul value')}: 500. 0 - {__('Ignore this option')} ({__('no limit')}). -
-
- { this.settingsSavedMessage && @@ -329,7 +443,6 @@ export default class ConfigPage extends Page { this.saveSettings() }} />
-
); diff --git a/translations/cn.json b/translations/cn.json index 9e2da63..4d00519 100644 --- a/translations/cn.json +++ b/translations/cn.json @@ -188,6 +188,9 @@ "or with hash": "或者使用Hash", "Check torrent files intergrity": "检查种子文件的完整性", "Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.": "每个种子添加到数据库时都检查完整性,禁用这个可用减少一些CPU使用率。", - "Download to": "下载到" + "Download to": "下载到", + "Main settings": "Main settings", + "P2P settings": "P2P settings", + "Performance settings": "Performance settings" } -} +} \ No newline at end of file diff --git a/translations/en.json b/translations/en.json index 4cb7e61..14e6600 100644 --- a/translations/en.json +++ b/translations/en.json @@ -188,6 +188,9 @@ "or with hash": "or with hash", "Check torrent files intergrity": "Check torrent files intergrity", "Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.": "Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.", - "Download to": "Download to" + "Download to": "Download to", + "Main settings": "Main settings", + "P2P settings": "P2P settings", + "Performance settings": "Performance settings" } } \ No newline at end of file diff --git a/translations/ru.json b/translations/ru.json index 22d3bdf..989f147 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -188,6 +188,9 @@ "or with hash": "или по хэшу", "Check torrent files intergrity": "Проверка целостности файлов", "Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.": "Включить проверку целостности файлов в базе при добавлении каждого торрента. Отключение этой опции освободит некоторорое количество ресурсов процессора при добавлении.", - "Download to": "Скачать в" + "Download to": "Скачать в", + "Main settings": "Главные настройки", + "P2P settings": "Настройки P2P", + "Performance settings": "Настройки производительности" } } \ No newline at end of file diff --git a/translations/ua.json b/translations/ua.json index fde101b..27fba02 100644 --- a/translations/ua.json +++ b/translations/ua.json @@ -188,6 +188,9 @@ "or with hash": "or with hash", "Check torrent files intergrity": "Check torrent files intergrity", "Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.": "Enable database torrents files intergrity check on adding each torrent. Disable this will free some cpu usage on adding operation.", - "Download to": "Download to" + "Download to": "Download to", + "Main settings": "Main settings", + "P2P settings": "P2P settings", + "Performance settings": "Performance settings" } } \ No newline at end of file