basic web page build restored

This commit is contained in:
Alexey Kasyanchuk
2018-04-06 16:21:17 +03:00
parent a2ade1cd68
commit 0cdfd136c5
8 changed files with 2038 additions and 722 deletions

View File

@ -9,11 +9,17 @@ import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import {Header} from './header'
import Footer from './footer'
const { ipcRenderer, remote } = require('electron');
window.currentWindow = remote.getCurrentWindow()
//var io = require("socket.io-client");
//window.torrentSocket = io(document.location.protocol + '//' + document.location.hostname + (process.env.NODE_ENV === 'production' ? '/' : ':8095/'));
if(typeof WEB !== 'undefined')
{
const io = require("socket.io-client");
window.torrentSocket = io(document.location.protocol + '//' + document.location.hostname + (process.env.NODE_ENV === 'production' ? '/' : ':8095/'));
}
else
{
const { ipcRenderer, remote } = require('electron');
window.currentWindow = remote.getCurrentWindow()
window.torrentSocket = {}
window.torrentSocket.callbacks = {}
window.torrentSocket.listeners = {}
@ -53,12 +59,13 @@ window.currentWindow = remote.getCurrentWindow()
delete window.torrentSocket.callbacks[id]
});
ipcRenderer.on('url', (event, url) => {
console.log('url', url)
router(url)
});
}
// Needed for onTouchTap
// http://stackoverflow.com/a/34015469/988941
@ -132,7 +139,7 @@ class App extends Component {
<MuiThemeProvider>
<div>
{
!window.currentWindow.isModal()
window.currentWindow && !window.currentWindow.isModal()
&&
<Header />
}

View File

@ -7,8 +7,6 @@ import TextField from 'material-ui/TextField'
import Slider from 'material-ui/Slider'
import fs from 'fs'
const {dialog} = require('electron').remote
export default class ConfigPage extends Page {
constructor(props) {
super(props)

View File

@ -7,7 +7,6 @@ import TextField from 'material-ui/TextField'
import Slider from 'material-ui/Slider'
import fs from 'fs'
const {dialog} = require('electron').remote
export default class ConfigPage extends Page {
constructor(props) {