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 * 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 { export interface Props {

View File

@ -1,9 +1,16 @@
import * as React from 'react'; 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'; import { TargetTable } from './Targets';
export interface Props { export interface Props {
probe: object; probe: object;
onBack(): void;
} }
export interface State { export interface State {

View File

@ -1,35 +1,39 @@
import *as React from 'react' import *as React from 'react';
import { import {
Grid, Menu, Segment, MenuItemProps, Header, Container Grid,
} from 'semantic-ui-react' Menu,
Segment,
MenuItemProps,
Header,
Container,
} from 'semantic-ui-react';
export interface State { export interface State {
activeItem: string[];
} }
export interface Props { 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> { 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: osNames[0] } this.state = { activeItem: osNames[0] };
} }
handleItemClick = (event: React.SyntheticEvent<HTMLAnchorElement>, data: MenuItemProps) => {
this.setState({ activeItem: data.name }) public handleItemClick = (event: React.SyntheticEvent<HTMLAnchorElement>, data: MenuItemProps): void => {
this.setState({ activeItem: data.name });
console.log(data.name); console.log(data.name);
} }
render() { public render(): JSX.Element {
const { activeItem } = this.state const { activeItem } = this.state.activeItem;
return ( return (
<Container fluid> <Container fluid>
<Header as='h3' dividing>Probe Download</Header> <Header as='h3' dividing>Probe Download</Header>
@ -39,11 +43,8 @@ const { activeItem } = this.state
{osNames.map((os: string) => { {osNames.map((os: string) => {
return ( return (
<Menu.Item name={os} active={activeItem === os} onClick={this.handleItemClick} /> <Menu.Item name={os} active={activeItem === os} onClick={this.handleItemClick} />
) );
})} })}
</Menu> </Menu>
</Grid.Column> </Grid.Column>
@ -57,8 +58,5 @@ const { activeItem } = this.state
</Container> </Container>
); );
} }
} }