This commit is contained in:
insanity 2017-07-20 16:52:34 +09:00
parent 1f3ad4b588
commit 6c89e0bcad
5 changed files with 75 additions and 6 deletions

View File

@ -0,0 +1,26 @@
import * as React from 'react';
import { RouteComponentProps } from 'react-router';
import ProbeListContainer from '@overflow/probe/react/ProbeList';
import WebSocketRPC from '@overflow/commons/websocket/WebSocketRPC';
import AppContext from '@overflow/commons/context';
import inject from '@overflow/commons/context/decorator/inject';
class ProbeList extends React.Component<RouteComponentProps<object>, object> {
@inject()
private client: WebSocketRPC;
public constructor(props?: RouteComponentProps<object>, context?: object) {
super(props, context);
let con = AppContext.get<WebSocketRPC>();
}
public render(): JSX.Element {
return (
<ProbeListContainer/>
);
}
}
export default ProbeList;

View File

@ -0,0 +1,27 @@
import { connect, Dispatch } from 'react-redux';
import {
ProbeList,
StateProps as ProbeListStateProps,
DispatchProps as ProbeListDispatchProps,
} from './components/ProbeList';
import Domain from '@overflow/domain/api/model/Domain';
import State from '../redux/state/ProbeRegist';
import * as probeListActions from '../redux/action/read_all_by_domain';
export function mapStateToProps(state: any): ProbeListStateProps {
return {
};
}
export function mapDispatchToProps(dispatch: Dispatch<any>): ProbeListDispatchProps {
return {
onReadAllByDomain: (domain: Domain) => {
dispatch(probeListActions.request(domain));
},
};
}
export default connect(mapStateToProps, mapDispatchToProps)(ProbeList);

View File

@ -16,7 +16,7 @@ export interface Props {
export interface State {
}
export class ProbeDetails extends React.Component<Props, State> {
export class ProbeDetail extends React.Component<Props, State> {
constructor(props: Props, context: State) {
super(props, context);

View File

@ -1,20 +1,26 @@
import * as React from 'react';
import { Table, Header, Container, Form, Checkbox, Button } from 'semantic-ui-react';
import { ProbeDetails } from './ProbeDetails';
import { ProbeDetail } from './ProbeDetail';
import { ListContainer } from '@overflow/commons/react/component/ListContainer';
import Probe from '@overflow/probe/api/model/Probe';
import Domain from '@overflow/domain/api/model/Domain';
export interface Props {
export interface StateProps {
}
export interface DispatchProps {
onReadAllByDomain(domain: Domain): void;
}
export type Props = StateProps & DispatchProps;
export interface State {
selected: Probe;
isDetail: boolean;
list: Probe[];
}
export class Probes extends React.Component<Props, State> {
export class ProbeList extends React.Component<Props, State> {
private data: any;
@ -121,7 +127,7 @@ export class Probes extends React.Component<Props, State> {
public render(): JSX.Element {
if (this.state.isDetail) {
return <ProbeDetails probe={this.state.selected} />;
return <ProbeDetail probe={this.state.selected} />;
}
let probeList =
<Container fluid>

View File

@ -0,0 +1,10 @@
export interface State {
readonly test: boolean;
}
export const defaultState: State = {
test: undefined,
};
export default State;