This commit is contained in:
insanity 2017-07-25 19:59:04 +09:00
parent 1cdc1306de
commit 478d99e732
3 changed files with 44 additions and 24 deletions

View File

@ -47,9 +47,9 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
'domain': {
'name': 'insanity\'s domain',
},
'cidr': '192.168.1.0/24',
'displayName': '192.168.1.105\'s probe',
'network': {
'cidr': '192.168.1.0/24',
'infraHost': {
'ip': '192.168.1.105',
'mac': 'ab:cd:ef:gh:ij',
},
@ -88,13 +88,16 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
}
public showStartStopBtn(): JSX.Element {
return <Button content='Stop' icon='stop' labelPosition='left' negative />;
if (this.state.probe.status.name === 'STARTED') {
return <Button content='Stop' icon='stop' labelPosition='left' negative />;
}
return <Button content='Start' icon='play' labelPosition='left' positive />;
}
public render(): JSX.Element {
return (
<Container>
<Table celled={false}>
<Table celled={false} >
<Table.Body>
<Table.Row>
<Table.Cell collapsing>
@ -102,7 +105,7 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
</Table.Cell>
<Table.Cell>{this.state.probe.displayName}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Row>
<Table.Cell collapsing>
<Header size='small'>Status</Header>
</Table.Cell>
@ -149,7 +152,6 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
</Table.Footer>
</Table>
{/* {this.showStartStopBtn()} */}
{this.renderDiscovery()}
</Container>
);

View File

@ -33,7 +33,33 @@ export class ProbeHost extends React.Component<Props, State> {
}
public componentWillMount(): void {
console.log(this.props.id);
// todo. getting probe by probeId
let p = {
'id': '11',
'status': {
'name': 'STARTED',
},
'domain': {
'name': 'insanity\'s domain',
},
'cidr': '192.168.1.0/24',
'displayName': '192.168.1.105\'s probe',
'targetCount': '20',
'sensorCount': '30',
'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ',
'description': 'description1111111111',
'createDate': '2017-01-01',
'authorizeDate': '2017-01-01',
'restartDate': '2017-01-01',
'authorizeMember': {
'name': 'insanity',
},
};
this.setState({
probe: p,
});
}

View File

@ -42,12 +42,12 @@ export class ProbeList extends React.Component<Props, State> {
'domain': {
'name': 'insanity\'s domain',
},
'cidr': '192.168.1.0/24',
'displayName': '192.168.1.105\'s probe',
'network': {
'cidr': '192.168.1.0/24',
'ip': '192.168.1.105',
'mac': 'ab:cd:ef:gh:ij',
},
// 'infraHost': {
// 'ip': '192.168.1.105',
// 'mac': 'ab:cd:ef:gh:ij',
// },
'targetCount': '20',
'sensorCount': '30',
'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ',
@ -62,11 +62,7 @@ export class ProbeList extends React.Component<Props, State> {
'name': 'insanity\'s domain',
},
'displayName': '192.168.1.105\'s probe',
'network': {
'cidr': '192.168.1.0/24',
'ip': '192.168.1.105',
'mac': 'ab:cd:ef:gh:ij',
},
'cidr': '192.168.1.0/24',
'targetCount': '20',
'sensorCount': '30',
'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ',
@ -80,12 +76,8 @@ export class ProbeList extends React.Component<Props, State> {
'domain': {
'name': 'insanity\'s domain',
},
'cidr': '192.168.1.0/24',
'displayName': '192.168.1.105\'s probe',
'network': {
'cidr': '192.168.1.0/24',
'ip': '192.168.1.105',
'mac': 'ab:cd:ef:gh:ij',
},
'targetCount': '20',
'sensorCount': '30',
'probeKey': '1AGBLKDFJ2452ASDGFL2KWJLKSDJ',
@ -176,8 +168,8 @@ export class ProbeList extends React.Component<Props, State> {
return this.state.list.map((probe: any, index: number) => (
<Table.Row key={index} onClick={this.handleSelect.bind(this, probe)}>
<Table.Cell >{probe.displayName}</Table.Cell>
<Table.Cell>{probe.network.cidr}</Table.Cell>
<Table.Cell>{probe.network.ip}</Table.Cell>
<Table.Cell>{probe.cidr}</Table.Cell>
<Table.Cell>todo</Table.Cell>
<Table.Cell negative={this.checkCellStatus(probe.status)} textAlign={'center'}>{probe.status.name}</Table.Cell>
<Table.Cell textAlign={'center'} >{probe.targetCount}</Table.Cell>
<Table.Cell textAlign={'center'} >{probe.sensorCount}</Table.Cell>