Packages

Live error monitoring to watch your Phoenix app going up in flames in real time! Open source version of error aggregation services. Hooks into Elixir's Logger to provide accurate error reporting all throughout your application.

Retired package: Release invalid

Current section

Files

Jump to
flames lib web static js flames-frontend.jsx
Raw

lib/web/static/js/flames-frontend.jsx

import React, { Component } from 'react';
import {render} from 'react-dom';
import {Socket} from "phoenix";
import ErrorTable from './error-table.jsx';
import Error from './error.jsx';
import Layout from './layout.jsx';
import { Router, Route, useRouterHistory, IndexRoute, withRouter } from 'react-router';
import { createHashHistory } from 'history';
import PropTypes from 'prop-types';
const appHistory = useRouterHistory(createHashHistory)({ queryKey: false })
class Main extends Component {
static contextTypes: {
router: PropTypes.object.isRequired
}
constructor(props) {
super(props);
let socket = new Socket(`${window.location.pathname}/socket`, {params: {token: window.token}});
socket.connect();
this.state = {socket: socket};
}
render () {
return (
<Layout>
<ErrorTable socket={this.state.socket} router={this.props.router} search={this.state.search} />
</Layout>
);
}
}
render(
<Router history={appHistory}>
<Route path="/" >
<IndexRoute component={withRouter(Main)}/>
<Route path="/errors/:id" component={withRouter(Error)} />
</Route>
</Router>
, document.getElementById('app'));