This commit is contained in:
insanity 2017-07-20 12:44:46 +09:00
parent 743f135df3
commit 92dcfa2d64
4 changed files with 36 additions and 61 deletions

View File

@ -1,35 +0,0 @@
import * as React from 'react';
import { Probes } from './Probes';
import { NoauthProbes } from './NoauthProbes';
import { SensorConfiguration } from './SensorConfiguration';
import { Targets } from './Targets';
import { Sensors } from './Sensors';
import { Tab } from './commons/Tab';
// import Tab, { TabProps } from 'semantic-ui-react/dist/commonjs/modules/Tab';
export class Components extends React.Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
this.state = {
};
}
render() {
const items = [
{ name: 'Probes', child: <Probes /> },
{ name: 'NoauthProbes', child: <NoauthProbes /> },
{ name: 'Targets', child: <Targets /> },
{ name: 'SensorConfiguration', child: <SensorConfiguration /> },
{ name: 'Sensors', child: <Sensors /> },
];
return (
<Tab panes={items} />
);
}
}

View File

@ -1,5 +1,10 @@
import * as React from 'react';
import { Table, Checkbox, Button, Header, Container } from 'semantic-ui-react';
import { Table,
Checkbox,
Button,
Header,
Container,
} from 'semantic-ui-react';
export interface Props {

View File

@ -1,9 +1,16 @@
import * as React from 'react';
import { Button, Table, Label, Segment, Header, Container } from 'semantic-ui-react';
import { Button,
Table,
Label,
Segment,
Header,
Container,
} from 'semantic-ui-react';
import { TargetTable } from './Targets';
export interface Props {
probe: object;
onBack(): void;
}
export interface State {

View File

@ -1,35 +1,39 @@
import *as React from 'react'
import *as React from 'react';
import {
Grid, Menu, Segment, MenuItemProps, Header, Container
} from 'semantic-ui-react'
Grid,
Menu,
Segment,
MenuItemProps,
Header,
Container,
} from 'semantic-ui-react';
export interface State {
activeItem: string[];
}
export interface Props {
}
const osNames = ["Windows","Debian","Ubuntu","Fedora", "CentOS"];
const osNames = ['Windows', 'Debian', 'Ubuntu', 'Fedora', 'CentOS'];
export class ProbeDown extends React.Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
this.state = { activeItem: osNames[0] }
this.state = { activeItem: osNames[0] };
}
handleItemClick = (event: React.SyntheticEvent<HTMLAnchorElement>, data: MenuItemProps) => {
this.setState({ activeItem: data.name })
console.log(data.name);
}
public handleItemClick = (event: React.SyntheticEvent<HTMLAnchorElement>, data: MenuItemProps): void => {
this.setState({ activeItem: data.name });
render() {
console.log(data.name);
}
const { activeItem } = this.state
public render(): JSX.Element {
const { activeItem } = this.state.activeItem;
return (
<Container fluid>
<Header as='h3' dividing>Probe Download</Header>
@ -37,16 +41,13 @@ const { activeItem } = this.state
<Grid.Column width={4}>
<Menu fluid vertical tabular>
{osNames.map((os: string) => {
return (
<Menu.Item name={os} active={activeItem === os} onClick={this.handleItemClick} />
)
return (
<Menu.Item name={os} active={activeItem === os} onClick={this.handleItemClick} />
);
})}
</Menu>
</Grid.Column>
<Grid.Column stretched width={12}>
<Segment vertical>
@ -57,8 +58,5 @@ const { activeItem } = this.state
</Container>
);
}
}