fixed noauthprobe

This commit is contained in:
snoop 2017-09-13 17:55:38 +09:00
parent 4d1eb970ce
commit d7dda6f910
2 changed files with 60 additions and 28 deletions

View File

@ -3,16 +3,24 @@ import MetaNoAuthProbeStatus from '@overflow/meta/api/model/MetaNoAuthProbeStatu
import Domain from '@overflow/domain/api/model/Domain'; import Domain from '@overflow/domain/api/model/Domain';
interface NoAuthProbe { interface NoAuthProbe {
id?: number; // id?: number;
hostName?: string; // hostName?: string;
macAddress?: number; // macAddress?: number;
ipAddress?: number; // ipAddress?: number;
status?: MetaNoAuthProbeStatus; // status?: MetaNoAuthProbeStatus;
tempProbeKey?: string; // tempProbeKey?: string;
createDate?: Date; // createDate?: Date;
apiKey?: string; // apiKey?: string;
domain?: Domain; // domain?: Domain;
probe?: Probe; // probe?: Probe;
id: number;
description: string;
status: MetaNoAuthProbeStatus;
tempProbeKey: string;
createDate: Date;
apiKey: string;
domain: Domain;
probe: Probe;
} }
export default NoAuthProbe; export default NoAuthProbe;

View File

@ -115,11 +115,21 @@ export class NoauthProbeList extends React.Component<Props, State> {
return true; return true;
} }
public showList(): JSX.Element[] { public showList(): JSX.Element[] {
return this.state.selected.map((probe: NoAuthProbe, index: number) => (
<div key={index}> let elem: Array<JSX.Element> = new Array();
{probe.ipAddress}
</div> this.state.selected.map((probe: NoAuthProbe, index: number) => {
));
let map: any = JSON.parse(probe.description);
elem.push(
<div key={index}>
{map.network.address}
</div>,
);
});
return elem;
} }
public render(): JSX.Element { public render(): JSX.Element {
@ -191,19 +201,33 @@ export class NoauthProbeList extends React.Component<Props, State> {
</Table.Row>; </Table.Row>;
} }
return this.props.noauthList.map((probe: NoAuthProbe, index: number) => ( let elem: Array<JSX.Element> = new Array();
<Table.Row key={index} onClick={this.handleSelect.bind(this, probe)} active={this.handleRowActive(probe)}>
<Table.Cell collapsing> this.props.noauthList.map((probe: NoAuthProbe, index: number) => {
<Checkbox checked={this.checkExist(probe)} />
</Table.Cell> let map: any = JSON.parse(probe.description);
<Table.Cell textAlign={'center'}>{index + 1}</Table.Cell>
<Table.Cell textAlign={'center'}>{probe.ipAddress}</Table.Cell> let addressArray: string[] = map.network.address.split('|', 2);
<Table.Cell textAlign={'center'}>{probe.macAddress}</Table.Cell> let ipv4: string = addressArray[0];
<Table.Cell>{probe.hostName}</Table.Cell> let ipv6: string = addressArray[1];
<Table.Cell textAlign={'center'}>{Utils.date2date(probe.createDate)}</Table.Cell>
<Table.Cell textAlign={'center'}>{probe.apiKey}</Table.Cell> elem.push(
</Table.Row> <Table.Row key={index} onClick={this.handleSelect.bind(this, probe)} active={this.handleRowActive(probe)}>
)); <Table.Cell collapsing>
<Checkbox checked={this.checkExist(probe)} />
</Table.Cell>
<Table.Cell textAlign={'center'}>{index + 1}</Table.Cell>
<Table.Cell textAlign={'center'}>ipv4 - {ipv4} <br/> ipv6 - {ipv6}</Table.Cell>
<Table.Cell textAlign={'center'}>{map.network.macAddress}</Table.Cell>
<Table.Cell>{map.host.name}</Table.Cell>
<Table.Cell textAlign={'center'}>{Utils.date2date(probe.createDate)}</Table.Cell>
<Table.Cell textAlign={'center'}>{probe.apiKey}</Table.Cell>
</Table.Row>,
);
});
return elem;
} }
} }