Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b0f933bb4e
@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Button, Table, Label } from 'semantic-ui-react';
|
import { Button, Table, Label } from 'semantic-ui-react';
|
||||||
import { Targets } from './Targets';
|
import { TargetTable } from './Targets';
|
||||||
|
|
||||||
export class ProbeDetails extends React.Component<any, any> {
|
export class ProbeDetails extends React.Component<any, any> {
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ export class ProbeDetails extends React.Component<any, any> {
|
|||||||
<Button content='Discovery' icon='search' labelPosition='left' floated={'right'} positive onClick={this.handleDiscovery} />
|
<Button content='Discovery' icon='search' labelPosition='left' floated={'right'} positive onClick={this.handleDiscovery} />
|
||||||
{this.showStartStopBtn()}
|
{this.showStartStopBtn()}
|
||||||
|
|
||||||
<Targets/>
|
<TargetTable probe={this.props.probe}/>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -11,13 +11,13 @@ export interface Props {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const osNames = ["Windows","Debian","Ubuntu","Fedora"];
|
const osNames = ["Windows","Debian","Ubuntu","Fedora", "CentOS"];
|
||||||
|
|
||||||
export class ProbeDown extends React.Component<any, any> {
|
export class ProbeDown extends React.Component<any, any> {
|
||||||
constructor(props: any, context: any) {
|
constructor(props: any, context: any) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
this.state = { activeItem: 'Windows' }
|
this.state = { activeItem: osNames[0] }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -35,10 +35,14 @@ const { activeItem } = this.state
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Column width={4}>
|
<Grid.Column width={4}>
|
||||||
<Menu fluid vertical tabular>
|
<Menu fluid vertical tabular>
|
||||||
<Menu.Item name='Windows' active={activeItem === 'Windows'} onClick={this.handleItemClick} />
|
{osNames.map((os: string) => {
|
||||||
<Menu.Item name='Debian' active={activeItem === 'Debian'} onClick={this.handleItemClick} />
|
return (
|
||||||
<Menu.Item name='Ubuntu' active={activeItem === 'Ubuntu'} onClick={this.handleItemClick} />
|
<Menu.Item name={os} active={activeItem === os} onClick={this.handleItemClick} />
|
||||||
<Menu.Item name='Fedora' active={activeItem === 'Fedora'} onClick={this.handleItemClick} />
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Menu>
|
</Menu>
|
||||||
</Grid.Column>
|
</Grid.Column>
|
||||||
|
|
||||||
|
126
src/ts/containers/test/Sensors.tsx
Normal file
126
src/ts/containers/test/Sensors.tsx
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import { Table, Button } from 'semantic-ui-react';
|
||||||
|
|
||||||
|
|
||||||
|
export class Sensors extends React.Component<any, any> {
|
||||||
|
|
||||||
|
private data: any;
|
||||||
|
|
||||||
|
constructor(props: any, context: any) {
|
||||||
|
super(props, context);
|
||||||
|
this.state = {
|
||||||
|
selected: null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
this.data = [
|
||||||
|
{
|
||||||
|
"id": "111",
|
||||||
|
"metaSensorStatus": {
|
||||||
|
"name": "NORMAL"
|
||||||
|
},
|
||||||
|
"target": {
|
||||||
|
"id": "1",
|
||||||
|
},
|
||||||
|
"metaCrawler": {
|
||||||
|
"name": "WMI",
|
||||||
|
"description": "WMI description",
|
||||||
|
},
|
||||||
|
"crawlerInputItems": "json value",
|
||||||
|
"description": "description1111111111",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "222",
|
||||||
|
"metaSensorStatus": {
|
||||||
|
"name": "NORMAL"
|
||||||
|
},
|
||||||
|
"target": {
|
||||||
|
"id": "1",
|
||||||
|
},
|
||||||
|
"metaCrawler": {
|
||||||
|
"name": "SNMP",
|
||||||
|
"description": "SNMP description",
|
||||||
|
},
|
||||||
|
"crawlerInputItems": "json value",
|
||||||
|
"description": "description1111111111",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "333",
|
||||||
|
"metaSensorStatus": {
|
||||||
|
"name": "NORMAL"
|
||||||
|
},
|
||||||
|
"target": {
|
||||||
|
"id": "1",
|
||||||
|
},
|
||||||
|
"metaCrawler": {
|
||||||
|
"name": "JMX",
|
||||||
|
"description": "JMX description",
|
||||||
|
},
|
||||||
|
"crawlerInputItems": "json value",
|
||||||
|
"description": "description1111111111",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSelect(selectedProbe: object) {
|
||||||
|
this.setState({
|
||||||
|
selected: selectedProbe,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
checkCellStatus(status: any): boolean {
|
||||||
|
if (status.name === 'STOPPED') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
showStartStopBtn(status: any) {
|
||||||
|
if (status.name === 'STARTED') {
|
||||||
|
return <Button content='Stop' icon='stop' labelPosition='left' color={'blue'} floated={'right'} onClick={this.handleStartStop} />;
|
||||||
|
} else {
|
||||||
|
return <Button content='Start' icon='play' labelPosition='left' color={'blue'} floated={'right'} onClick={this.handleStartStop} />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleStartStop(event: any, data: any) {
|
||||||
|
console.log(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Table celled selectable striped>
|
||||||
|
<Table.Header>
|
||||||
|
<Table.Row>
|
||||||
|
<Table.HeaderCell textAlign={'center'}>No.</Table.HeaderCell>
|
||||||
|
<Table.HeaderCell textAlign={'center'}>Status</Table.HeaderCell>
|
||||||
|
<Table.HeaderCell textAlign={'center'}>Crawler</Table.HeaderCell>
|
||||||
|
<Table.HeaderCell textAlign={'center'}>Description</Table.HeaderCell>
|
||||||
|
<Table.HeaderCell textAlign={'center'}>Item count</Table.HeaderCell>
|
||||||
|
<Table.HeaderCell />
|
||||||
|
</Table.Row>
|
||||||
|
</Table.Header>
|
||||||
|
|
||||||
|
<Table.Body>
|
||||||
|
{this.data.map((sensor: any, index: number) => (
|
||||||
|
<Table.Row key={index} onClick={this.handleSelect.bind(this, sensor)}>
|
||||||
|
<Table.Cell textAlign={'center'}>{index + 1}</Table.Cell>
|
||||||
|
<Table.Cell negative={this.checkCellStatus(sensor.metaSensorStatus)} textAlign={'center'}>{sensor.metaSensorStatus.name}</Table.Cell>
|
||||||
|
<Table.Cell>{sensor.metaCrawler.name}</Table.Cell>
|
||||||
|
<Table.Cell>{sensor.description}</Table.Cell>
|
||||||
|
<Table.Cell>to do</Table.Cell>
|
||||||
|
<Table.Cell collapsing>{this.showStartStopBtn(sensor.metaSensorStatus)}</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
))}
|
||||||
|
</Table.Body>
|
||||||
|
</Table>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -15,12 +15,16 @@ export class SignIn extends React.Component<any, any> {
|
|||||||
constructor(props: any, context: any) {
|
constructor(props: any, context: any) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
forgotPopup: false,
|
forgotPopup: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
forgotPopupOpen = () => this.setState({ forgotPopup: true });
|
||||||
|
forgotPopupClose = () => this.setState({ forgotPopup: false });
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -35,7 +39,8 @@ export class SignIn extends React.Component<any, any> {
|
|||||||
<Label> Password </Label>
|
<Label> Password </Label>
|
||||||
<Input placeholder='Password' type='password' />
|
<Input placeholder='Password' type='password' />
|
||||||
<br />
|
<br />
|
||||||
<Modal trigger={<Button>Forgot Password</Button>}>
|
<Button onClick={this.forgotPopupOpen}>Forgot Password</Button>
|
||||||
|
<Modal size='small' open={this.state.forgotPopup} onClose={this.forgotPopupClose}>
|
||||||
<Modal.Header>Change your password Enter email address.</Modal.Header>
|
<Modal.Header>Change your password Enter email address.</Modal.Header>
|
||||||
<Modal.Content >
|
<Modal.Content >
|
||||||
<Label> Email </Label>
|
<Label> Email </Label>
|
||||||
@ -43,14 +48,14 @@ export class SignIn extends React.Component<any, any> {
|
|||||||
|
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
<Modal.Actions>
|
<Modal.Actions>
|
||||||
<Button basic color='blue' > Submit </Button>
|
<Button basic color='blue' > Submit </Button>
|
||||||
<Button > Cancel </Button>
|
<Button onClick={this.forgotPopupClose}> Cancel </Button>
|
||||||
</Modal.Actions>
|
</Modal.Actions>
|
||||||
</Modal>
|
</Modal>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<Button> Sign In </Button>
|
<Button> Sign In </Button>
|
||||||
<Button> Sign Up </Button>
|
<Button href='/#/test2'> Sign Up </Button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Button, Table, Label } from 'semantic-ui-react';
|
import { Button, Table, Container } from 'semantic-ui-react';
|
||||||
|
import { Sensors } from './Sensors';
|
||||||
|
|
||||||
export class TargetDetails extends React.Component<any, any> {
|
export class TargetDetails extends React.Component<any, any> {
|
||||||
|
|
||||||
@ -9,11 +10,62 @@ export class TargetDetails extends React.Component<any, any> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleBack() {
|
||||||
|
}
|
||||||
|
|
||||||
|
handleRemoveTarget() {
|
||||||
|
alert('remove');
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<Container>
|
||||||
target details
|
<Table celled={true}>
|
||||||
</div>
|
<Table.Body>
|
||||||
|
<Table.Row>
|
||||||
|
<Table.Cell collapsing>
|
||||||
|
Name
|
||||||
|
</Table.Cell>
|
||||||
|
<Table.Cell>
|
||||||
|
???
|
||||||
|
</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
|
||||||
|
<Table.Row>
|
||||||
|
<Table.Cell collapsing>
|
||||||
|
Type
|
||||||
|
</Table.Cell>
|
||||||
|
<Table.Cell>
|
||||||
|
????
|
||||||
|
</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
|
||||||
|
<Table.Row>
|
||||||
|
<Table.Cell collapsing>
|
||||||
|
Sensor count
|
||||||
|
</Table.Cell>
|
||||||
|
<Table.Cell>
|
||||||
|
???
|
||||||
|
</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
|
||||||
|
<Table.Row>
|
||||||
|
<Table.Cell collapsing>
|
||||||
|
Created at
|
||||||
|
</Table.Cell>
|
||||||
|
<Table.Cell>
|
||||||
|
???
|
||||||
|
</Table.Cell>
|
||||||
|
</Table.Row>
|
||||||
|
|
||||||
|
</Table.Body>
|
||||||
|
</Table>
|
||||||
|
<Button content='Back' icon='left arrow' labelPosition='left' onClick={this.handleBack} />
|
||||||
|
<Button primary floated={'right'} negative onClick={this.handleRemoveTarget}>Remove</Button>
|
||||||
|
|
||||||
|
<Sensors target={this.props.target} />
|
||||||
|
|
||||||
|
</Container >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,47 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { Table } from 'semantic-ui-react';
|
import { Table, Grid, Segment, Button, Container } from 'semantic-ui-react';
|
||||||
|
import { TargetDetails } from './TargetDetails';
|
||||||
|
|
||||||
export class Targets extends React.Component<any, any> {
|
export class Targets extends React.Component<any, any> {
|
||||||
|
|
||||||
|
constructor(props: any, context: any) {
|
||||||
|
super(props, context);
|
||||||
|
this.state = {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
componentWillMount() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
handleAddTarget() {
|
||||||
|
alert('Add a Target');
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Container>
|
||||||
|
<Grid columns={2}>
|
||||||
|
<Grid.Row>
|
||||||
|
<Grid.Column width='4'>
|
||||||
|
<Segment>SEARCH AREA</Segment>
|
||||||
|
</Grid.Column>
|
||||||
|
<Grid.Column>
|
||||||
|
<TargetTable />
|
||||||
|
<Button content='Add' icon='add' labelPosition='left' floated='right' positive onClick={this.handleAddTarget.bind(this)}/>
|
||||||
|
</Grid.Column>
|
||||||
|
</Grid.Row>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<TargetDetails target={this.state.selected}/>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export class TargetTable extends React.Component<any, any> {
|
||||||
private data: any;
|
private data: any;
|
||||||
|
|
||||||
constructor(props: any, context: any) {
|
constructor(props: any, context: any) {
|
||||||
@ -56,7 +96,7 @@ export class Targets extends React.Component<any, any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
console.log(this.props.probe);
|
||||||
return (
|
return (
|
||||||
<Table celled selectable striped>
|
<Table celled selectable striped>
|
||||||
<Table.Header>
|
<Table.Header>
|
||||||
|
@ -46,31 +46,20 @@ export class TopBar extends React.Component<any, any> {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item> Home </Menu.Item>
|
<Menu.Item href='//google.com' target='_blank'> Home </Menu.Item>
|
||||||
<Dropdown text='Monitoring' pointing className='link item'>
|
<Dropdown text='Monitoring' pointing className='link item'>
|
||||||
<Dropdown.Menu>
|
<Dropdown.Menu>
|
||||||
<Dropdown.Header>Monitoring</Dropdown.Header>
|
<Dropdown.Item> Probe </Dropdown.Item>
|
||||||
<Dropdown.Item>
|
|
||||||
<Icon name='dropdown' />
|
|
||||||
<span className='text'>Probe</span>
|
|
||||||
<Dropdown.Menu>
|
|
||||||
<Dropdown.Header>Mens</Dropdown.Header>
|
|
||||||
<Dropdown.Item>Shirts</Dropdown.Item>
|
|
||||||
<Dropdown.Item>Pants</Dropdown.Item>
|
|
||||||
<Dropdown.Item>Jeans</Dropdown.Item>
|
|
||||||
<Dropdown.Item>Shoes</Dropdown.Item>
|
|
||||||
<Dropdown.Divider />
|
|
||||||
<Dropdown.Header>Womens</Dropdown.Header>
|
|
||||||
<Dropdown.Item>Dresses</Dropdown.Item>
|
|
||||||
<Dropdown.Item>Shoes</Dropdown.Item>
|
|
||||||
<Dropdown.Item>Bags</Dropdown.Item>
|
|
||||||
</Dropdown.Menu>
|
|
||||||
</Dropdown.Item>
|
|
||||||
<Dropdown.Item>Sensors</Dropdown.Item>
|
<Dropdown.Item>Sensors</Dropdown.Item>
|
||||||
|
|
||||||
</Dropdown.Menu>
|
</Dropdown.Menu>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
<Menu.Item> Infrastructure </Menu.Item>
|
|
||||||
|
<Dropdown text='Infrastructure' pointing className='link item'>
|
||||||
|
<Dropdown.Menu>
|
||||||
|
<Dropdown.Item> Maps </Dropdown.Item>
|
||||||
|
<Dropdown.Item>Targets</Dropdown.Item>
|
||||||
|
</Dropdown.Menu>
|
||||||
|
</Dropdown>
|
||||||
<Menu.Item> Dashboard </Menu.Item>
|
<Menu.Item> Dashboard </Menu.Item>
|
||||||
<Menu.Item> Metrics </Menu.Item>
|
<Menu.Item> Metrics </Menu.Item>
|
||||||
<Menu.Item> Alert </Menu.Item>
|
<Menu.Item> Alert </Menu.Item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user