mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 05:43:59 -07:00
Beginning of HTML+Bootstrap+React UI for new desktop client -- looking like it will be easier than retrofitting the old Qt client for the new API.
This commit is contained in:
parent
40f312a827
commit
b2b32e5969
12 changed files with 16097 additions and 31 deletions
51
ui/ZeroTierNode.jsx
Normal file
51
ui/ZeroTierNode.jsx
Normal file
|
@ -0,0 +1,51 @@
|
|||
var ZeroTierNode = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {
|
||||
address: '----------',
|
||||
online: false,
|
||||
version: '_._._'
|
||||
};
|
||||
},
|
||||
|
||||
updateAll: function() {
|
||||
Ajax.call({
|
||||
url: 'status?auth='+this.props.authToken,
|
||||
cache: false,
|
||||
type: 'GET',
|
||||
success: function(data) {
|
||||
if (data)
|
||||
this.setState(JSON.parse(data));
|
||||
}.bind(this),
|
||||
error: function() {
|
||||
this.setState(this.getInitialState());
|
||||
}.bind(this)
|
||||
})
|
||||
},
|
||||
|
||||
componentDidMount: function() {
|
||||
this.updateAll();
|
||||
// this.updateIntervalId = setInterval(this.updateAll,2500);
|
||||
},
|
||||
componentWillUnmount: function() {
|
||||
// clearInterval(this.updateIntervalId);
|
||||
},
|
||||
render: function() {
|
||||
return (
|
||||
<div className="container-fluid zeroTierNode">
|
||||
<div className="row">
|
||||
</div>
|
||||
<div className="row">
|
||||
<div className="col-xs-8">
|
||||
<span className="zerotier-address">{this.state.address}</span>
|
||||
<span className="zerotier-node-statusline">{this.state.online ? 'ONLINE' : 'OFFLINE'} {this.state.version}</span>
|
||||
</div>
|
||||
<div className="col-xs-4">
|
||||
<form>
|
||||
<input type="text"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue