feat(config): saving configuration
This commit is contained in:
@ -15,14 +15,14 @@ export default class AdminPage extends Page {
|
||||
this.loadSettings()
|
||||
}
|
||||
loadSettings() {
|
||||
window.torrentSocket.emit('admin', window.customLoader((options) => {
|
||||
window.torrentSocket.emit('config', window.customLoader((options) => {
|
||||
this.options = options;
|
||||
console.log(this.options)
|
||||
this.forceUpdate();
|
||||
}));
|
||||
}
|
||||
saveSettings() {
|
||||
window.torrentSocket.emit('setAdmin', this.options)
|
||||
window.torrentSocket.emit('setConfig', this.options)
|
||||
this.forceUpdate()
|
||||
}
|
||||
render() {
|
||||
@ -32,12 +32,12 @@ export default class AdminPage extends Page {
|
||||
<div className='column center w100p pad0-75'>
|
||||
<Toggle
|
||||
style={{marginTop: '10px'}}
|
||||
label="Disable DHT scanning"
|
||||
toggled={this.options.dhtDisabled}
|
||||
label="Enabled network scanning"
|
||||
toggled={this.options.indexer}
|
||||
thumbSwitchedStyle={{backgroundColor: 'red'}}
|
||||
trackSwitchedStyle={{backgroundColor: '#ff9d9d'}}
|
||||
onToggle={(e, checked) => {
|
||||
this.options.dhtDisabled = checked
|
||||
this.options.indexer = checked
|
||||
this.saveSettings()
|
||||
}}
|
||||
/>
|
||||
|
@ -40,6 +40,12 @@ const { ipcRenderer, remote } = require('electron');
|
||||
});
|
||||
|
||||
|
||||
ipcRenderer.on('url', (event, url) => {
|
||||
console.log('url', url)
|
||||
router(url)
|
||||
});
|
||||
|
||||
|
||||
// Needed for onTouchTap
|
||||
// http://stackoverflow.com/a/34015469/988941
|
||||
injectTapEventPlugin();
|
||||
|
@ -71,7 +71,7 @@ router('/DMCA', () => {
|
||||
});
|
||||
|
||||
|
||||
router('/admi5p', () => {
|
||||
router('/config', () => {
|
||||
//singleton
|
||||
let pie = new PagesPie;
|
||||
pie.open(AdminPage, {replace: 'all'});
|
||||
|
Reference in New Issue
Block a user