-
-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TorBot GUI #152
TorBot GUI #152
Changes from 2 commits
d69ade6
cfdb4c3
e055ab1
d43521a
81a3316
6d54348
e119490
d52b5a6
30b82d7
d725b11
06ef3be
36f0f86
941e8fe
66b1376
2a08689
dc5636b
540e68e
a143d36
9bbe784
0c14198
d8c42f8
f994c3c
31ba103
f5a3b14
9b1ff79
200917d
85cc2aa
9265007
aa70a9a
43dd359
1989da5
622a931
54515e9
71594bf
e9032c7
e33e272
fcf739d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module.exports = { | ||
"env": { | ||
"node": true, | ||
"browser": true, | ||
"commonjs": true, | ||
"es6": true | ||
}, | ||
"extends": ["eslint:recommended", "plugin:react/recommended"], | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": 2018, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"rules": { | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
] | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", | ||
monospace; | ||
} | ||
|
||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#000000"> | ||
<title>TorBot</title> | ||
<link href="bundle.css" rel="stylesheet"></head> | ||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
<div id="root"></div> | ||
<script type="text/javascript" src="bundle.js"></script></body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "torbot", | ||
"version": "0.1.0", | ||
"private": true, | ||
"dependencies": { | ||
"electron-reload-webpack-plugin": "^2.0.4", | ||
"extract-text-webpack-plugin": "^4.0.0-beta.0", | ||
"react": "^16.6.0", | ||
"react-dom": "^16.6.0", | ||
"react-scripts": "2.0.5" | ||
}, | ||
"scripts": { | ||
"start": "webpack --mode development --watch", | ||
"build": "webpack --mode production", | ||
"test": "react-scripts test", | ||
"eject": "react-scripts eject", | ||
"electron": "electron ." | ||
}, | ||
"homepage": "./", | ||
"main": "src/electron-main.js", | ||
"browserslist": [ | ||
">0.2%", | ||
"not dead", | ||
"not ie <= 11", | ||
"not op_mini all" | ||
], | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.1.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-loader": "^8.0.4", | ||
"css-loader": "^1.0.1", | ||
"electron": "^3.0.8", | ||
"electron-connect": "^0.6.3", | ||
"electron-reload": "^1.2.5", | ||
"eslint": "^5.9.0", | ||
"eslint-config-prettier": "^3.3.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"eslint-plugin-react": "^7.11.1", | ||
"html-webpack-plugin": "^3.2.0", | ||
"mini-css-extract-plugin": "^0.4.4", | ||
"prettier": "^1.15.2", | ||
"webpack-cli": "^3.1.2" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import Home from './components/home'; | ||
import './app.css'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'import' is only available in ES6 (use 'esversion: 6'). |
||
|
||
class App extends React.Component { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'class' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz). |
||
render() { | ||
return <Home/>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected an assignment or function call and instead saw an expression. |
||
} | ||
} | ||
|
||
export default App; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'export' is only available in ES6 (use 'esversion: 6'). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
|
||
class Home extends React.Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
} | ||
|
||
render() { | ||
return ( | ||
<p>Hello World!</p> | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
); | ||
} | ||
} | ||
|
||
export default Home; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Modules to control application life and create native browser window | ||
const { app, BrowserWindow } = require('electron'); | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Keep a global reference of the window object, if you don't, the window will | ||
// be closed automatically when the JavaScript object is garbage collected. | ||
let mainWindow; | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// Used in configuring path to load html from React | ||
const path = require('path'); | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const url = require('url'); | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
function createWindow () { | ||
let browserOptions = {width: 800, height: 600}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'let' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz). |
||
// Create the browser window. | ||
mainWindow = new BrowserWindow(browserOptions); | ||
|
||
// Configuring locaiton for HTML outputted after React | ||
const startURL = url.format({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz). |
||
pathname: path.join(__dirname, '../build/index.html'), | ||
protocol: 'file:', | ||
slashes: true | ||
}); | ||
|
||
// Loads html | ||
mainWindow.loadURL(startURL); | ||
|
||
// Open the DevTools | ||
mainWindow.webContents.openDevTools(); | ||
|
||
// Emitted when the window is closed. | ||
mainWindow.on('closed', function () { | ||
// Dereference the window object, usually you would store windows | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
mainWindow = null; | ||
}); | ||
} | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
app.on('ready', createWindow); | ||
|
||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', function () { | ||
// On OS X it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
if (process.platform !== 'darwin') { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on('activate', function () { | ||
// On OS X it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (mainWindow === null) { | ||
createWindow(); | ||
} | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", | ||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", | ||
sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
} | ||
|
||
code { | ||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", | ||
monospace; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#000000"> | ||
<title>TorBot</title> | ||
</head> | ||
<body> | ||
<noscript> | ||
You need to enable JavaScript to run this app. | ||
</noscript> | ||
<div id="root"></div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'import' is only available in ES6 (use 'esversion: 6'). |
||
import ReactDOM from 'react-dom'; | ||
PSNAppz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import './global.css'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'import' is only available in ES6 (use 'esversion: 6'). |
||
import App from './app'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'import' is only available in ES6 (use 'esversion: 6'). |
||
|
||
|
||
ReactDOM.render(<App/>, document.getElementById('root')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected ')' and instead saw 'App'. |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
const MiniCssExtractTextPlugin = require('mini-css-extract-plugin') | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const createElectronReloadWebpackPlugin = require('electron-reload-webpack-plugin'); | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const ElectronReloadWebpackPlugin = createElectronReloadWebpackPlugin({ | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
path: './', | ||
logLevel: 0 | ||
}); | ||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
module.exports = { | ||
|
||
watch: true, | ||
|
||
target: 'electron-main', | ||
|
||
entry: ['./src/renderer.js'], | ||
|
||
output: { | ||
path: __dirname + '/build', | ||
filename: 'bundle.js' | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
{ | ||
test: /\.jsx?$/, | ||
loader: 'babel-loader', | ||
options: { | ||
presets: ['@babel/react'] | ||
} | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: [ | ||
{ | ||
loader: MiniCssExtractTextPlugin.loader | ||
}, | ||
'css-loader' | ||
] | ||
}, | ||
{ | ||
test: /\.(png|jpg|gif|svg)$/, | ||
loader: 'file-loader', | ||
query: { | ||
name: '[name].[ext]?[hash]' | ||
} | ||
} | ||
] | ||
}, | ||
|
||
plugins: [ | ||
new MiniCssExtractTextPlugin({ | ||
filename: 'bundle.css', | ||
}), | ||
new ElectronReloadWebpackPlugin(), | ||
new HtmlWebpackPlugin({ | ||
title: 'TorBot', | ||
template: 'src/index.html' | ||
|
||
}) | ||
], | ||
|
||
resolve: { | ||
extensions: ['.js', '.json', '.jsx'] | ||
} | ||
|
||
} | ||
KingAkeem marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'import' is only available in ES6 (use 'esversion: 6').