Merge branch 'master' of https://git.loafle.net/overflow/overflow_app
This commit is contained in:
commit
7fa9c30e6d
|
@ -90,7 +90,7 @@ export class DiscoveryProbe extends React.Component<Props, State> {
|
|||
</Table>
|
||||
|
||||
</Container>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
24
src/ts/@overflow/target/react/TargetDetail.tsx
Normal file
24
src/ts/@overflow/target/react/TargetDetail.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { connect, Dispatch } from 'react-redux';
|
||||
import {
|
||||
TargetDetail,
|
||||
StateProps as StateProps,
|
||||
DispatchProps as DispatchProps,
|
||||
} from './components/TargetDetail';
|
||||
|
||||
import * as targetDetailActions from '../redux/action/read';
|
||||
|
||||
export function mapStateToProps(state: any): StateProps {
|
||||
return {
|
||||
probe: state.probe,
|
||||
};
|
||||
}
|
||||
|
||||
export function mapDispatchToProps(dispatch: Dispatch<any>): DispatchProps {
|
||||
return {
|
||||
onRead: (id: string) => {
|
||||
dispatch(targetDetailActions.request(id));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(TargetDetail);
|
|
@ -6,20 +6,33 @@ import { DetailContainer } from '@overflow/commons/react/component/DetailContain
|
|||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
import Target from '@overflow/target/api/model/Target';
|
||||
|
||||
export interface TargetDetailsProps {
|
||||
|
||||
export interface StateProps {
|
||||
probe?: Probe;
|
||||
target?: Target;
|
||||
}
|
||||
|
||||
export interface TargetDetailsState {
|
||||
|
||||
export interface DispatchProps {
|
||||
onRead(id: string): void;
|
||||
}
|
||||
|
||||
export class TargetDetails extends React.Component<TargetDetailsProps, TargetDetailsState> {
|
||||
export type Props = StateProps & DispatchProps;
|
||||
|
||||
constructor(props: TargetDetailsProps, context: TargetDetailsState) {
|
||||
export interface State {
|
||||
selected: Probe;
|
||||
isDetail: boolean;
|
||||
list: Probe[];
|
||||
}
|
||||
|
||||
|
||||
export class TargetDetail extends React.Component<Props, State> {
|
||||
|
||||
constructor(props: Props, context: State) {
|
||||
super(props, context);
|
||||
this.state = {
|
||||
selected: null,
|
||||
isDetail: false,
|
||||
list: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -43,7 +56,6 @@ export class TargetDetails extends React.Component<TargetDetailsProps, TargetDet
|
|||
];
|
||||
|
||||
return (
|
||||
// <DetailContainer panes={items}/>
|
||||
<Container fluid>
|
||||
<TargetBasicInfo probe={this.props.probe} />
|
||||
<SensorList target={this.props.target} />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { Table, Button, Modal, Input, Header, Container, InputOnChangeData, ButtonProps } from 'semantic-ui-react';
|
||||
import { TargetDetails } from './TargetDetail';
|
||||
import { TargetDetail } from './TargetDetail';
|
||||
import Target from '@overflow/target/api/model/Target';
|
||||
import Probe from '@overflow/probe/api/model/Probe';
|
||||
import { ListContainer } from '@overflow/commons/react/component/ListContainer';
|
||||
|
@ -23,7 +23,7 @@ export interface State {
|
|||
|
||||
export class TargetList extends React.Component<Props, State> {
|
||||
|
||||
private data: any;
|
||||
private data: any;
|
||||
constructor(props: Props, context: State) {
|
||||
super(props, context);
|
||||
this.state = {
|
||||
|
@ -34,7 +34,6 @@ export class TargetList extends React.Component<Props, State> {
|
|||
}
|
||||
|
||||
public handleAddTarget(event: React.MouseEvent<HTMLButtonElement>, data: ButtonProps): void {
|
||||
alert('test');
|
||||
this.setState({
|
||||
openAddTarget: true,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user