2018-12-29 17:33:08 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2018-12-29 21:19:09 +00:00
|
|
|
import Login from './Login';
|
2018-12-31 19:35:55 +00:00
|
|
|
import Dashboard from './Dashboard';
|
2018-12-29 17:33:08 +00:00
|
|
|
import $ from 'jquery';
|
|
|
|
|
|
|
|
export default class LightningPanel extends React.Component {
|
|
|
|
static defaultProps = {
|
|
|
|
apiKey: "",
|
|
|
|
};
|
|
|
|
static propTypes = {
|
|
|
|
apiKey: PropTypes.string
|
|
|
|
}
|
|
|
|
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
|
2018-12-31 19:35:55 +00:00
|
|
|
|
|
|
|
this.state = {
|
|
|
|
apiKey: props.apiKey
|
|
|
|
}
|
2018-12-29 17:33:08 +00:00
|
|
|
}
|
|
|
|
|
2018-12-31 19:35:55 +00:00
|
|
|
handleLogin = (apiKey) => {
|
|
|
|
this.setState({ apiKey });
|
|
|
|
}
|
2018-12-29 21:19:09 +00:00
|
|
|
|
2018-12-31 19:35:55 +00:00
|
|
|
handleLogout = () => {
|
|
|
|
this.setState({ apiKey: ""});
|
|
|
|
}
|
|
|
|
|
|
|
|
render(){
|
|
|
|
const { apiKey } = this.state;
|
2018-12-29 21:19:09 +00:00
|
|
|
|
2018-12-31 19:35:55 +00:00
|
|
|
return (<div className="plugin-lightning">
|
|
|
|
{ !apiKey ?
|
|
|
|
<div>
|
|
|
|
<h4><i className="fa fa-bolt"/> Lightning Network</h4>
|
|
|
|
Lightning is a service that allows you to quickly process small and large datasets using high performance servers in the cloud.
|
|
|
|
Below you can enter your <a href="https://webodm.net" target="_blank">webodm.net</a> credentials to sync your account and automatically setup a new processing node. If you don't have an account, you can <a href="https://webodm.net/register" target="_blank">register</a> for free.
|
|
|
|
<Login onLogin={this.handleLogin} />
|
|
|
|
</div> :
|
|
|
|
<div>
|
|
|
|
<Dashboard apiKey={apiKey} onLogout={this.handleLogout} />
|
|
|
|
</div>}
|
2018-12-29 17:33:08 +00:00
|
|
|
</div>);
|
|
|
|
}
|
|
|
|
}
|