Update lots of stuff
parent
73fa4260c3
commit
5844ff5a82
21
package.json
21
package.json
|
@ -36,35 +36,36 @@
|
|||
"devDependencies": {
|
||||
"babel-cli": "^6.22.2",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-loader": "^6.2.4",
|
||||
"babel-loader": "^7.0.0",
|
||||
"babel-polyfill": "^6.22.0",
|
||||
"babel-preset-es2015": "^6.22.0",
|
||||
"babel-preset-react": "^6.22.0",
|
||||
"babel-preset-stage-0": "^6.22.0",
|
||||
"concurrently": "^3.1.0",
|
||||
"cross-env": "^3.1.4",
|
||||
"cross-env": "^5.0.0",
|
||||
"electron": "^1.4.15",
|
||||
"express": "^4.14.0",
|
||||
"webpack": "^1.13.1",
|
||||
"webpack": "^2.5.1",
|
||||
"webpack-dev-middleware": "^1.6.1",
|
||||
"webpack-hot-middleware": "^2.12.1",
|
||||
"webpack-target-electron-renderer": "^0.4.0"
|
||||
"webpack-hot-middleware": "^2.12.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"async": "^2.1.4",
|
||||
"bootstrap": "^3.3.6",
|
||||
"bootstrap-3-typeahead": "^4.0.1",
|
||||
"configstore": "^2.1.0",
|
||||
"dagre": "^0.7.4",
|
||||
"eventemitter2": "^2.2.2",
|
||||
"jquery": "^2.2.4",
|
||||
"eventemitter2": "^4.1.0",
|
||||
"jquery": "^3.2.1",
|
||||
"linkurious": "^1.5.1",
|
||||
"mustache": "^2.2.1",
|
||||
"neo4j-driver": "^1.1.0",
|
||||
"neo4j-driver": "*",
|
||||
"prop-types": "^15.5.10",
|
||||
"react": "^15.4.2",
|
||||
"react-addons-css-transition-group": "^15.4.2",
|
||||
"react-bootstrap": "^0.30.3",
|
||||
"react-bootstrap": "^0.31.0",
|
||||
"react-dom": "^15.4.2",
|
||||
"react-if": "^2.1.0"
|
||||
"react-if": "^2.1.0",
|
||||
"react-transition-group": "^1.1.3"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,17 +16,13 @@ import Settings from './components/Float/Settings'
|
|||
import ZoomContainer from './components/Zoom/ZoomContainer'
|
||||
import QueryNodeSelect from './components/Float/QueryNodeSelect'
|
||||
import SessionClearModal from './components/Modals/SessionClearModal'
|
||||
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
|
||||
import CSSTransitionGroup from 'react-transition-group/CSSTransitionGroup'
|
||||
import About from './components/Modals/About.jsx'
|
||||
|
||||
export default class AppContainer extends Component {
|
||||
constructor(){
|
||||
super();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<ReactCSSTransitionGroup transitionName="mainfade"
|
||||
<CSSTransitionGroup transitionName="mainfade"
|
||||
transitionAppear={true}
|
||||
transitionAppearTimeout={1000}
|
||||
transitionEnter={false}
|
||||
|
@ -51,7 +47,7 @@ export default class AppContainer extends Component {
|
|||
<QueryNodeSelect />
|
||||
<About />
|
||||
</div>
|
||||
</ReactCSSTransitionGroup>
|
||||
</CSSTransitionGroup>
|
||||
);
|
||||
};
|
||||
}
|
|
@ -39,23 +39,15 @@ export default class Login extends Component {
|
|||
icon.removeClass();
|
||||
icon.addClass("fa fa-spinner fa-spin form-control-feedback");
|
||||
icon.toggle(true);
|
||||
var driver = neo4j.driver(url)
|
||||
var driver = neo4j.driver(url, neo4j.auth.basic("",""), {encrypted:'ENCRYPTION_ON'})
|
||||
var session = driver.session();
|
||||
|
||||
driver.onCompleted = function(){
|
||||
session.close()
|
||||
driver.close()
|
||||
}
|
||||
driver.onError = function(error){
|
||||
if (error.message && error.message.includes("encryption certificate has changed")){
|
||||
var path = error.message.match("`(.*?)`")[1]
|
||||
icon.removeClass();
|
||||
icon.addClass("fa fa-times-circle red-icon-color form-control-feedback");
|
||||
icon.attr('data-original-title', 'Certificate error - delete localhost line in {}'.format(path))
|
||||
.tooltip('fixTitle')
|
||||
.tooltip('show')
|
||||
this.setState({
|
||||
loginInProgress: false,
|
||||
loginEnabled: false
|
||||
})
|
||||
}else if (error.fields && error.fields[0].code === "Neo.ClientError.Security.Unauthorized"){
|
||||
if (error.message.includes("authentication failure")){
|
||||
icon.removeClass();
|
||||
icon.addClass("fa fa-check-circle green-icon-color form-control-feedback");
|
||||
this.setState({loginEnabled: true, url: url})
|
||||
|
@ -70,9 +62,10 @@ export default class Login extends Component {
|
|||
loginEnabled: false
|
||||
})
|
||||
}
|
||||
session.close()
|
||||
driver.close()
|
||||
}.bind(this)
|
||||
driver.session();
|
||||
session.run("return 1")
|
||||
}
|
||||
|
||||
checkDBCreds(){
|
||||
|
@ -89,7 +82,8 @@ export default class Login extends Component {
|
|||
|
||||
var driver = neo4j.driver(this.state.url, neo4j.auth.basic(this.state.user, this.state.password))
|
||||
driver.onError = function(error){
|
||||
if (error.fields && error.fields[0].code === "Neo.ClientError.Security.Unauthorized"){
|
||||
console.log(error)
|
||||
if (error.message.includes("authentication failure")){
|
||||
btn.removeClass('activate');
|
||||
this.setState({
|
||||
loginInProgress: false,
|
||||
|
@ -98,7 +92,7 @@ export default class Login extends Component {
|
|||
pwf.attr('data-original-title', 'Invalid username or password')
|
||||
.tooltip('fixTitle')
|
||||
.tooltip('show')
|
||||
}else if (error.fields && error.fields[0].code === "Neo.ClientError.Security.AuthenticationRateLimit"){
|
||||
}else if (error.message.includes("too many times in a row")){
|
||||
btn.removeClass('activate');
|
||||
this.setState({
|
||||
loginInProgress: false,
|
||||
|
@ -107,24 +101,6 @@ export default class Login extends Component {
|
|||
pwf.attr('data-original-title', 'Too many authentication attempts, please wait')
|
||||
.tooltip('fixTitle')
|
||||
.tooltip('show')
|
||||
}else if (error.message && error.message.includes("encryption certificate has changed")){
|
||||
var path = error.message.match("`(.*?)`")[1]
|
||||
var icon = this.state.icon
|
||||
icon.toggle('true')
|
||||
icon.removeClass();
|
||||
icon.addClass("fa fa-times-circle red-icon-color form-control-feedback");
|
||||
jQuery(icon).tooltip({
|
||||
placement : 'right',
|
||||
title: 'Certificate error - delete localhost line in ' + path,
|
||||
container: 'body',
|
||||
delay: {show: 200, hide: 0},
|
||||
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner tooltip-inner-custom"></div></div>'
|
||||
})
|
||||
this.setState({
|
||||
loginInProgress: false,
|
||||
loginEnabled: false
|
||||
})
|
||||
jQuery(icon).tooltip('show')
|
||||
}else if (error.toString().includes('ECONNREFUSED')){
|
||||
var icon = this.state.icon
|
||||
icon.toggle('true')
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
import React, { Component } from 'react';
|
||||
import { If, Then, Else } from 'react-if';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class GlyphiconSpan extends Component {
|
||||
propTypes: {
|
||||
classes : React.PropTypes.string,
|
||||
tooltipDir : React.PropTypes.string,
|
||||
tooltipTitle : React.PropTypes.string,
|
||||
tooltip : React.PropTypes.bool.isRequired,
|
||||
click: React.PropTypes.func
|
||||
}
|
||||
|
||||
export default class GlyphiconSpan extends Component {
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
|
@ -31,3 +24,11 @@ export default class GlyphiconSpan extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
GlyphiconSpan.propTypes = {
|
||||
classes : React.PropTypes.string,
|
||||
tooltipDir : React.PropTypes.string,
|
||||
tooltipTitle : React.PropTypes.string,
|
||||
tooltip : React.PropTypes.bool.isRequired,
|
||||
click: React.PropTypes.func
|
||||
}
|
||||
|
|
|
@ -778,6 +778,7 @@ export default class GraphContainer extends Component {
|
|||
}, this);
|
||||
if (!needsfix){
|
||||
emitter.emit('updateLoadingText', 'Done!');
|
||||
sigma.canvas.edges.autoCurve(sigmaInstance)
|
||||
setTimeout(function(){
|
||||
emitter.emit('showLoadingIndicator', false);
|
||||
}, 1500)
|
||||
|
@ -801,8 +802,9 @@ export default class GraphContainer extends Component {
|
|||
|
||||
noverlapListener.bind('stop', function(event) {
|
||||
emitter.emit('updateLoadingText', 'Done!');
|
||||
sigma.canvas.edges.autoCurve(sigmaInstance)
|
||||
setTimeout(function(){
|
||||
emitter.emit('showLoadingIndicator', false);
|
||||
emitter.emit('showLoadingIndicator', false);
|
||||
}, 1500)
|
||||
|
||||
});
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class Icon extends Component {
|
||||
propTypes: {
|
||||
glyph : React.PropTypes.string.isRequired,
|
||||
extraClass : React.PropTypes.string
|
||||
}
|
||||
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
|
@ -16,3 +12,8 @@ export default class Icon extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
Icon.propTypes = {
|
||||
glyph : React.PropTypes.string.isRequired,
|
||||
extraClass : React.PropTypes.string
|
||||
}
|
|
@ -1,12 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class MenuButton extends Component {
|
||||
propTypes: {
|
||||
hoverVal : React.PropTypes.string.isRequired,
|
||||
glyphicon : React.PropTypes.string.isRequired,
|
||||
click : React.PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
_leave(e){
|
||||
var target = $(e.target)
|
||||
target.css('width', 'auto')
|
||||
|
@ -44,3 +39,9 @@ export default class MenuButton extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
MenuButton.propTypes = {
|
||||
hoverVal : React.PropTypes.string.isRequired,
|
||||
glyphicon : React.PropTypes.string.isRequired,
|
||||
click : React.PropTypes.func.isRequired
|
||||
}
|
|
@ -1,11 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class ProgressBarMenuButton extends Component {
|
||||
propTypes: {
|
||||
progress : React.PropTypes.number.isRequired,
|
||||
click : React.PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
constructor(){
|
||||
super()
|
||||
|
||||
|
@ -77,3 +73,8 @@ export default class ProgressBarMenuButton extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
ProgressBarMenuButton.propTypes = {
|
||||
progress : React.PropTypes.number.isRequired,
|
||||
click : React.PropTypes.func.isRequired
|
||||
}
|
|
@ -1,12 +1,9 @@
|
|||
import React, { Component } from 'react';
|
||||
import NodeALink from './NodeALink.jsx'
|
||||
import LoadLabel from './LoadLabel.jsx'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class DomainNodeData extends Component {
|
||||
propTypes: {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
||||
|
||||
constructor(){
|
||||
super();
|
||||
|
||||
|
@ -224,3 +221,7 @@ export default class DomainNodeData extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
DomainNodeData.propTypes = {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
|
@ -1,11 +1,8 @@
|
|||
import React, { Component } from 'react';
|
||||
import NodeALink from './NodeALink'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class GroupNodeData extends Component {
|
||||
propTypes: {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
||||
|
||||
constructor(){
|
||||
super();
|
||||
|
||||
|
@ -384,4 +381,8 @@ export default class GroupNodeData extends Component {
|
|||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
GroupNodeData.propTypes = {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
|
@ -1,11 +1,8 @@
|
|||
import React, { Component } from 'react';
|
||||
import { If, Then, Else } from 'react-if';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class LoadLabel extends Component {
|
||||
propTypes: {
|
||||
ready : React.PropTypes.bool.isRequired,
|
||||
value : React.PropTypes.number
|
||||
}
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
|
@ -24,3 +21,8 @@ export default class LoadLabel extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
LoadLabel.propTypes = {
|
||||
ready : React.PropTypes.bool.isRequired,
|
||||
value : React.PropTypes.number
|
||||
}
|
|
@ -1,10 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class NoNodeData extends Component {
|
||||
propTypes: {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={this.props.visible ? "" : "hidden"}>
|
||||
|
@ -18,3 +15,8 @@ export default class NoNodeData extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NoNodeData.propTypes = {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
|
@ -1,12 +1,8 @@
|
|||
import React, { Component } from 'react';
|
||||
import { If, Then, Else } from 'react-if';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class NodeALink extends Component {
|
||||
propTypes: {
|
||||
ready : React.PropTypes.bool.isRequired,
|
||||
click : React.PropTypes.func,
|
||||
value : React.PropTypes.number
|
||||
}
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
|
@ -25,3 +21,9 @@ export default class NodeALink extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
NodeALink.propTypes = {
|
||||
ready : React.PropTypes.bool.isRequired,
|
||||
click : React.PropTypes.func,
|
||||
value : React.PropTypes.number
|
||||
}
|
|
@ -1,11 +1,8 @@
|
|||
import React, { Component } from 'react';
|
||||
import NodeALink from './NodeALink'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class UserNodeData extends Component {
|
||||
propTypes: {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
||||
|
||||
constructor(){
|
||||
super();
|
||||
|
||||
|
@ -353,3 +350,7 @@ export default class UserNodeData extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
UserNodeData.propTypes = {
|
||||
visible : React.PropTypes.bool.isRequired
|
||||
}
|
|
@ -59,7 +59,8 @@ export default class SpotlightContainer extends Component {
|
|||
<tbody ref="spotlight-tbody" className="searchable">
|
||||
{Object.keys(this.state.data).map(function(key){
|
||||
var d = this.state.data[key]
|
||||
var x = this.state.rex.test(d[0]) ? <SpotlightRow key={key} nodeId={key} parentNodeId={d[1]} nodeLabel={d[0]} parentNodeLabel={d[2]} nodeType={d[3]} parentNodeType={d[4]} /> : null
|
||||
var nid = parseInt(key)
|
||||
var x = this.state.rex.test(d[0]) ? <SpotlightRow key={key} nodeId={nid} parentNodeId={d[1]} nodeLabel={d[0]} parentNodeLabel={d[2]} nodeType={d[3]} parentNodeType={d[4]} /> : null
|
||||
return x
|
||||
}.bind(this))}
|
||||
</tbody>
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
export default class SpotlightRow extends Component {
|
||||
propTypes: {
|
||||
nodeId : React.PropTypes.number.isRequired,
|
||||
parentNodeId : React.PropTypes.number.isRequired,
|
||||
nodeLabel : React.PropTypes.string.isRequired,
|
||||
parentNodeLabel : React.PropTypes.string.isRequired,
|
||||
nodeType: React.PropTypes.string.isRequired,
|
||||
parentNodeType: React.PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
_handleClick(){
|
||||
emitter.emit('spotlightClick', this.props.nodeId, this.props.parentNodeId)
|
||||
}
|
||||
|
@ -60,3 +52,12 @@ export default class SpotlightRow extends Component {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
SpotlightRow.propTypes = {
|
||||
nodeId : React.PropTypes.number.isRequired,
|
||||
parentNodeId : React.PropTypes.number.isRequired,
|
||||
nodeLabel : React.PropTypes.string.isRequired,
|
||||
parentNodeLabel : React.PropTypes.string.isRequired,
|
||||
nodeType: React.PropTypes.string.isRequired,
|
||||
parentNodeType: React.PropTypes.string.isRequired
|
||||
}
|
|
@ -1,15 +1,27 @@
|
|||
var webpack = require('webpack');
|
||||
var webpackTargetElectronRenderer = require('webpack-target-electron-renderer');
|
||||
var path = require('path')
|
||||
|
||||
var config = {
|
||||
target: 'electron-renderer',
|
||||
externals: [{
|
||||
'electron-config': 'electron-config'
|
||||
}],
|
||||
entry: [
|
||||
'webpack-hot-middleware/client?reload=true&path=http://localhost:9000/__webpack_hmr',
|
||||
'./src/index',
|
||||
],
|
||||
module: {
|
||||
loaders: [{test: /\.jsx?$/,loaders: ['babel-loader'], exclude: /node_modules/
|
||||
}]
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /(node_modules)/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
output: {
|
||||
path: __dirname + '/dist',
|
||||
|
@ -17,7 +29,7 @@ var config = {
|
|||
filename: 'bundle.js'
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['', '.js', '.jsx'],
|
||||
extensions: ['.js', '.jsx'],
|
||||
alias: {
|
||||
utils: path.resolve(__dirname, 'src', 'js', 'utils.js'),
|
||||
modals: path.resolve(__dirname, 'src', 'components', 'Modals')
|
||||
|
@ -31,7 +43,4 @@ var config = {
|
|||
__filename: false
|
||||
}
|
||||
};
|
||||
|
||||
config.target = webpackTargetElectronRenderer(config);
|
||||
|
||||
module.exports = config;
|
Loading…
Reference in New Issue