Skip to content

Instantly share code, notes, and snippets.

@remyleone
Created November 2, 2017 15:00
Show Gist options
  • Select an option

  • Save remyleone/bb58045a9fd479a076672b4ca8eb881e to your computer and use it in GitHub Desktop.

Select an option

Save remyleone/bb58045a9fd479a076672b4ca8eb881e to your computer and use it in GitHub Desktop.
import React from 'react';
import PropTypes from 'prop-types';
import {DebugPanel} from './DebutPanel';
import {SessionConfig} from './SessionConfig';
import {AboutTestingTool} from './AboutTestingTool';
import {Agent} from './Agent';
import {Footer} from './Footer';
import {TestNavigation} from './session/TestNavigation';
export default class App extends React.Component {
constructor() {
super();
this.refresh_state()
}
render() {
return (
<div>
<TestNavigation supported_tests={this.props.supported_tests}/>
<Agent agent_link="http://localhost/agent_location"/>
<DebugPanel/>
<SessionConfig amqp_url={this.state.session_config.amqp_url}/>
<AboutTestingTool/>
<Footer/>
</div>
)
}
static propTypes = {
// supported_tests: PropTypes.arrayOf(String).isRequired
};
refresh_state() {
fetch('/state')
.then(response => {
if (response.status !== 200) {
console.log('Looks like there was a problem. Status Code: ' +
response.status);
return;
}
// Examine the text in the response
response.json().then(data => this.setState(data));
}
)
.catch(err => {
console.log('Fetch Error :-S', err);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment