From 4a5e181138e4ccd324d33426f3903825c178af48 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 28 Feb 2017 22:12:09 -0600 Subject: [bug] correctly determine available services in the ui --- ui/app/components/main_panel/vpn_section.js | 102 ++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) (limited to 'ui/app/components/main_panel/vpn_section.js') diff --git a/ui/app/components/main_panel/vpn_section.js b/ui/app/components/main_panel/vpn_section.js index e69de29b..ece8d496 100644 --- a/ui/app/components/main_panel/vpn_section.js +++ b/ui/app/components/main_panel/vpn_section.js @@ -0,0 +1,102 @@ +import React from 'react' +import { Button, Glyphicon, Alert } from 'react-bootstrap' +import SectionLayout from './section_layout' + +import Spinner from 'components/spinner' +import bitmask from 'lib/bitmask' + +export default class VPNSection extends React.Component { + + static get defaultProps() {return{ + account: null + }} + + constructor(props) { + super(props) + this.state = { + error: null, + expanded: false, + vpn: "down", + } + this.expand = this.expand.bind(this) + this.connect = this.connect.bind(this) + this.disconnect = this.disconnect.bind(this) + this.cancel = this.cancel.bind(this) + this.unblock = this.unblock.bind(this) + this.location = this.location.bind(this) + } + + expand() { + this.setState({expanded: !this.state.expanded}) + } + + connect() { + this.setState({vpn: "up"}) + } + + disconnect() { + this.setState({vpn: "down"}) + } + + cancel() { + + } + + unblock() { + + } + + location() { + + } + + render () { + let message = null + let body = null + let button = null + let icon = null + + let header =

VPN

+ if (this.state.error) { + // style may be: success, warning, danger, info + message = ( + {this.state.error} + ) + } + if (this.state.expanded) { + body =
traffic details go here
+ } + + switch(this.state.vpn) { + case "down": + button = + icon = "disabled" + break + case "up": + button = + icon = "on" + break + case "connecting": + button = + icon = "wait" + break + case "disconnecting": + button = + icon = "wait" + break + case "failed": + button =
+ + +
+ icon = "off" + break + } + + return ( + + ) + } + +} -- cgit v1.2.3