[web] fix updateLocation

This commit is contained in:
Jason 2016-06-09 14:20:14 +08:00
parent 851bb4bf68
commit 8e538c7630
5 changed files with 853 additions and 663 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -155,7 +155,7 @@ class MainView extends Component {
<div className="main-view">
<FlowTable
ref="flowTable"
selectFlow={this.selectFlow}
selectFlow={flow => this.selectFlow(flow)}
selected={selectedFlow}
/>
{selectedFlow && [

View File

@ -21,13 +21,19 @@ class ProxyAppMain extends Component {
router: PropTypes.object.isRequired,
}
constructor() {
constructor(props, context) {
super(props, context)
this.settingsStore = new SettingsStore()
// Default Settings before fetch
_.extend(this.settingsStore.dict, {})
this.state = { settings: this.settingsStore.dict }
this.onKeyDown = this.onKeyDown.bind(this)
this.updateLocation = this.updateLocation.bind(this)
this.onSettingsChange = this.onSettingsChange.bind(this)
}
/**
@ -41,7 +47,7 @@ class ProxyAppMain extends Component {
for (const key of Object.keys(queryUpdate || {})) {
query[i] = queryUpdate[i] || undefined
}
this.context.router.replace({pathname, query})
this.context.router.replace({ pathname, query })
}
/**
@ -101,7 +107,7 @@ class ProxyAppMain extends Component {
/**
* @todo move to actions
*/
onKeydown(e) {
onKeyDown(e) {
let name = null
switch (e.keyCode) {
@ -140,7 +146,7 @@ class ProxyAppMain extends Component {
const { settings } = this.state
const query = this.getQuery()
return (
<div id="container" tabIndex="0" onKeyDown={this.onKeydown}>
<div id="container" tabIndex="0" onKeyDown={this.onKeyDown}>
<Header ref="header" settings={settings} updateLocation={this.updateLocation} query={query} />
{React.cloneElement(
children,
@ -154,7 +160,7 @@ class ProxyAppMain extends Component {
</div>
)
}
})
}
export default connect(
state => ({

View File

@ -89,7 +89,6 @@ var FlowView = React.createClass({
} else {
active = tabs[0];
}
this.selectTab(active);
}
var prompt = null;