From 16a28eca258e07d45c7e2a8ee95368d4eb077d4d Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 15 Jun 2016 01:18:10 +0800 Subject: [web] websocket --- web/src/js/components/ProxyApp.jsx | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'web/src/js/components') diff --git a/web/src/js/components/ProxyApp.jsx b/web/src/js/components/ProxyApp.jsx index 81272268..2aedba7c 100644 --- a/web/src/js/components/ProxyApp.jsx +++ b/web/src/js/components/ProxyApp.jsx @@ -1,14 +1,15 @@ -import React, { Component, PropTypes } from "react" -import ReactDOM from "react-dom" -import _ from "lodash" +import React, { Component, PropTypes } from 'react' +import ReactDOM from 'react-dom' +import _ from 'lodash' import { connect } from 'react-redux' -import { Splitter } from "./common.js" -import Header from "./Header" -import EventLog from "./EventLog" -import Footer from "./Footer" -import { SettingsStore } from "../store/store.js" -import { Key } from "../utils.js" +import { Splitter } from './common.js' +import { connect as wsConnect } from '../ducks/websocket' +import Header from './Header' +import EventLog from './EventLog' +import Footer from './Footer' +import { SettingsStore } from '../store/store.js' +import { Key } from '../utils.js' class ProxyAppMain extends Component { @@ -37,6 +38,10 @@ class ProxyAppMain extends Component { this.onSettingsChange = this.onSettingsChange.bind(this) } + componentWillMount() { + this.props.wsConnect() + } + /** * @todo move to actions */ @@ -166,5 +171,8 @@ class ProxyAppMain extends Component { export default connect( state => ({ showEventLog: state.eventLog.visible - }) + }), + { + wsConnect, + } )(ProxyAppMain) -- cgit v1.2.3