.
This commit is contained in:
parent
3f1fa9d5f7
commit
d3d11901ab
@ -83,7 +83,6 @@ export class Probes extends React.Component<any, any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSearch(searchWord: string) {
|
handleSearch(searchWord: string) {
|
||||||
console.log(searchWord);
|
|
||||||
let founds = new Array();
|
let founds = new Array();
|
||||||
for (let probe of this.data) {
|
for (let probe of this.data) {
|
||||||
if (probe.domain.name.toLowerCase().indexOf(searchWord) !== -1
|
if (probe.domain.name.toLowerCase().indexOf(searchWord) !== -1
|
||||||
@ -115,6 +114,23 @@ export class Probes extends React.Component<any, any> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderRows() {
|
||||||
|
if(this.state.list.length === 0) {
|
||||||
|
return <Table.Row error >
|
||||||
|
<Table.Cell textAlign='center' colSpan='5'>No results found.</Table.Cell>
|
||||||
|
</Table.Row>;
|
||||||
|
}
|
||||||
|
return this.state.list.map((probe: any, index: number) => (
|
||||||
|
<Table.Row key={index} onClick={this.handleSelect.bind(this, probe)}>
|
||||||
|
<Table.Cell >{probe.domain.name}</Table.Cell>
|
||||||
|
<Table.Cell>{index}</Table.Cell>
|
||||||
|
<Table.Cell negative={this.checkCellStatus(probe.metaProbeStatus)} textAlign={'center'}>{probe.metaProbeStatus.name}</Table.Cell>
|
||||||
|
<Table.Cell textAlign={'center'} >todo. {probe.targetCnt}</Table.Cell>
|
||||||
|
<Table.Cell textAlign={'center'} >todo. {probe.sensorCnt}</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.state.isDetail) {
|
if (this.state.isDetail) {
|
||||||
return <ProbeDetails probe={this.state.selected} onBack={() => this.setState({ isDetail: false })} />;
|
return <ProbeDetails probe={this.state.selected} onBack={() => this.setState({ isDetail: false })} />;
|
||||||
@ -133,15 +149,7 @@ export class Probes extends React.Component<any, any> {
|
|||||||
</Table.Header>
|
</Table.Header>
|
||||||
|
|
||||||
<Table.Body>
|
<Table.Body>
|
||||||
{this.state.list.map((probe: any, index: number) => (
|
{this.renderRows()}
|
||||||
<Table.Row key={index} onClick={this.handleSelect.bind(this, probe)}>
|
|
||||||
<Table.Cell >{probe.domain.name}</Table.Cell>
|
|
||||||
<Table.Cell>{index}</Table.Cell>
|
|
||||||
<Table.Cell negative={this.checkCellStatus(probe.metaProbeStatus)} textAlign={'center'}>{probe.metaProbeStatus.name}</Table.Cell>
|
|
||||||
<Table.Cell textAlign={'center'} >todo. {probe.targetCnt}</Table.Cell>
|
|
||||||
<Table.Cell textAlign={'center'} >todo. {probe.sensorCnt}</Table.Cell>
|
|
||||||
</Table.Row>
|
|
||||||
))}
|
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
</Table>
|
</Table>
|
||||||
</Container>;
|
</Container>;
|
||||||
|
@ -33,7 +33,7 @@ export class LeftMenu extends React.Component<any, any> {
|
|||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Item name='Monitoring' >
|
<Menu.Item name='Monitoring' >
|
||||||
<Icon name='bar graph' />
|
<Icon name='bar graph' />
|
||||||
<Dropdown item text='Monitoring' >
|
<Dropdown text='Monitoring' pointing>
|
||||||
<Dropdown.Menu>
|
<Dropdown.Menu>
|
||||||
<Dropdown.Header>Monitoring</Dropdown.Header>
|
<Dropdown.Header>Monitoring</Dropdown.Header>
|
||||||
<Dropdown.Item>Probe</Dropdown.Item>
|
<Dropdown.Item>Probe</Dropdown.Item>
|
||||||
@ -44,7 +44,7 @@ export class LeftMenu extends React.Component<any, any> {
|
|||||||
|
|
||||||
<Menu.Item name='Infrastructure' >
|
<Menu.Item name='Infrastructure' >
|
||||||
<Icon name='sitemap' />
|
<Icon name='sitemap' />
|
||||||
<Dropdown item text='Infrastructure' >
|
<Dropdown text='Infrastructure' >
|
||||||
|
|
||||||
|
|
||||||
<Dropdown.Menu>
|
<Dropdown.Menu>
|
||||||
@ -78,7 +78,7 @@ export class LeftMenu extends React.Component<any, any> {
|
|||||||
|
|
||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
<Icon name='play circle' />
|
<Icon name='play circle' />
|
||||||
<Dropdown item text='Custom'>
|
<Dropdown text='Custom'>
|
||||||
<Dropdown.Menu>
|
<Dropdown.Menu>
|
||||||
<Dropdown.Header>Custom</Dropdown.Header>
|
<Dropdown.Header>Custom</Dropdown.Header>
|
||||||
<Dropdown.Item href='#/test2'> SignUp </Dropdown.Item>
|
<Dropdown.Item href='#/test2'> SignUp </Dropdown.Item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user