probe
This commit is contained in:
parent
1f3ad4b588
commit
6c89e0bcad
|
@ -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;
|
27
src/ts/@overflow/probe/react/ProbeList.tsx
Normal file
27
src/ts/@overflow/probe/react/ProbeList.tsx
Normal 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);
|
|
@ -16,7 +16,7 @@ export interface Props {
|
||||||
export interface State {
|
export interface State {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ProbeDetails extends React.Component<Props, State> {
|
export class ProbeDetail extends React.Component<Props, State> {
|
||||||
|
|
||||||
constructor(props: Props, context: State) {
|
constructor(props: Props, context: State) {
|
||||||
super(props, context);
|
super(props, context);
|
|
@ -1,20 +1,26 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Table, Header, Container, Form, Checkbox, Button } from 'semantic-ui-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 { ListContainer } from '@overflow/commons/react/component/ListContainer';
|
||||||
import Probe from '@overflow/probe/api/model/Probe';
|
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 {
|
export interface State {
|
||||||
selected: Probe;
|
selected: Probe;
|
||||||
isDetail: boolean;
|
isDetail: boolean;
|
||||||
list: Probe[];
|
list: Probe[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Probes extends React.Component<Props, State> {
|
export class ProbeList extends React.Component<Props, State> {
|
||||||
|
|
||||||
private data: any;
|
private data: any;
|
||||||
|
|
||||||
|
@ -121,7 +127,7 @@ export class Probes extends React.Component<Props, State> {
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
if (this.state.isDetail) {
|
if (this.state.isDetail) {
|
||||||
return <ProbeDetails probe={this.state.selected} />;
|
return <ProbeDetail probe={this.state.selected} />;
|
||||||
}
|
}
|
||||||
let probeList =
|
let probeList =
|
||||||
<Container fluid>
|
<Container fluid>
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
export interface State {
|
||||||
|
readonly test: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const defaultState: State = {
|
||||||
|
test: undefined,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default State;
|
Loading…
Reference in New Issue
Block a user