Skip to content

Commit

Permalink
Merge branch 'electron' of github.com:adaptivethreat/Bloodhound into …
Browse files Browse the repository at this point in the history
…electron
  • Loading branch information
HarmJ0y committed Aug 6, 2016
2 parents e2f4b00 + 7e8da89 commit 1ffd2af
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 11 deletions.
12 changes: 11 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const electron = require('electron')
var platform = require('os').platform()
// Module to control application life.
const app = electron.app
const Tray = electron.Tray
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow

Expand All @@ -10,8 +12,16 @@ let mainWindow

function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 1280, height: 800, icon:__dirname + '/src/img/favicon.ico'})
mainWindow = new BrowserWindow({width: 1280, height: 800, icon: __dirname + '/src/img/icon.ico'})
var trayIcon;

if (platform == 'darwin'){
trayIcon = __dirname + '/src/img/icon.png'
}else{
trayIcon = __dirname + '/src/img/icon.ico'
}

appIcon = new Tray(trayIcon)
// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"start": "set ENV=development & electron .",
"dev": "concurrently -k \"babel-node server.js\" \"npm start\"",
"build": "webpack --config webpack.config.production.js && electron-packager . Bloodhound --platform=all --arch=all --overwrite --prune",
"winbuild": "webpack --config webpack.config.production.js && electron-packager . Bloodhound --platform=win32 --arch=all --overwrite --prune"
"winbuild": "webpack --config webpack.config.production.js && electron-packager . BloodHound --platform=win32 --arch=x64 --overwrite --prune"
},
"babel": {
"presets": [
Expand Down
20 changes: 12 additions & 8 deletions src/components/SearchContainer/Tabs/PrebuiltQueriesDisplay.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ export default class PrebuiltQueriesDisplay extends Component {
}

componentWillMount() {
fs.readFile('src/components/SearchContainer/Tabs/PrebuiltQueries.json', 'utf8', function(err, data){
var x = JSON.parse(data)
var y = []
$.ajax({
url: 'src/components/SearchContainer/Tabs/prebuiltqueries.json',
type: 'GET',
success: function(response){
var x = JSON.parse(response)
var y = []

$.each(x.queries, function(index, el) {
y.push(el)
});
$.each(x.queries, function(index, el) {
y.push(el)
});

this.setState({queries: y})
}.bind(this))
this.setState({queries: y})
}.bind(this)
})
}

render() {
Expand Down
Binary file added src/img/icon.icns
Binary file not shown.
Binary file added src/img/icon.ico
Binary file not shown.
Binary file added src/img/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion webpack.config.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ var config = {
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
]
],
node: {
__dirname: true
}
};

config.target = webpackTargetElectronRenderer(config);
Expand Down

0 comments on commit 1ffd2af

Please sign in to comment.