Merge remote-tracking branch 'origin/master'

This commit is contained in:
geek 2017-07-20 12:45:15 +09:00
commit fdf176d745
8 changed files with 62 additions and 110 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 })
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 ( return (
<Container fluid> <Container fluid>
<Header as='h3' dividing>Probe Download</Header> <Header as='h3' dividing>Probe Download</Header>
@ -37,13 +41,10 @@ const { activeItem } = this.state
<Grid.Column width={4}> <Grid.Column width={4}>
<Menu fluid vertical tabular> <Menu fluid vertical tabular>
{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>
); );
} }
} }

View File

@ -13,7 +13,6 @@ export interface State {
list: object[]; list: object[];
} }
export class Probes extends React.Component<Props, State> { export class Probes extends React.Component<Props, State> {
private data: any; private data: any;

View File

@ -1,6 +1,14 @@
import * as React from 'react'; import * as React from 'react';
import { Grid, Menu, Segment } from 'semantic-ui-react'; import { Grid, Menu, Segment } from 'semantic-ui-react';
export interface Props {
}
export interface State {
active: number;
}
export class DetailContainer extends React.Component<any, any> { export class DetailContainer extends React.Component<any, any> {
constructor(props: any, context: any) { constructor(props: any, context: any) {
@ -10,17 +18,17 @@ export class DetailContainer extends React.Component<any, any> {
}; };
} }
showContents() { public showContents(): JSX.Element {
return this.props.panes[this.state.active].child; return this.props.panes[this.state.active].child;
} }
handleClick(index: number) { public handleClick(index: number): void {
this.setState({ this.setState({
active: index, active: index,
}); });
} }
render() { public render(): JSX.Element {
const activeItem = this.state.activeItem; const activeItem = this.state.activeItem;
return ( return (

View File

@ -1,6 +1,14 @@
import * as React from 'react'; import * as React from 'react';
import { Grid, Input, Form, Checkbox, Divider } from 'semantic-ui-react'; import { Grid, Input, Form, Checkbox, Divider } from 'semantic-ui-react';
export interface Props {
}
export interface State {
}
export class ListContainer extends React.Component<any, any> { export class ListContainer extends React.Component<any, any> {
private found: boolean = false; private found: boolean = false;
@ -12,7 +20,7 @@ export class ListContainer extends React.Component<any, any> {
} }
handleSearch(e: any, data: any) { public handleSearch(e: any, data: any): void {
let searchWord = data.value; let searchWord = data.value;
let items: object[]; let items: object[];
items = this.props.data; items = this.props.data;
@ -30,13 +38,13 @@ export class ListContainer extends React.Component<any, any> {
this.props.onSearch(result); this.props.onSearch(result);
} }
handleSearchInput(e: any, data: any) { public handleSearchInput(e: any, data: any): void {
this.setState({ this.setState({
searchWord: data.value, searchWord: data.value,
}); });
} }
search(item: any, searchWord: string) { public search(item: any, searchWord: string): void {
let key: any; let key: any;
for (key in item) { for (key in item) {
if (this.isString(item[key])) { if (this.isString(item[key])) {
@ -49,14 +57,14 @@ export class ListContainer extends React.Component<any, any> {
} }
} }
isString(val: any): boolean { public isString(val: any): boolean {
if (typeof val === 'string') { if (typeof val === 'string') {
return true; return true;
} }
return false; return false;
} }
render() { public render(): JSX.Element {
return ( return (
<Grid> <Grid>
<Grid.Column width={4}> <Grid.Column width={4}>

View File

@ -1,38 +0,0 @@
import * as React from 'react';
import { Menu, Segment } from 'semantic-ui-react';
export class Tab extends React.Component<any, any> {
constructor(props: any, context: any) {
super(props, context);
this.state = {
active: 0,
};
}
showContents() {
return this.props.panes[this.state.active].child;
}
handleClick(index: number) {
this.setState({
active: index,
});
}
render() {
return (
<div>
<Menu pointing secondary>
{this.props.panes.map((pane: any, index: number) => (
<Menu.Item key={index} name={pane.name} onClick={this.handleClick.bind(this, index)} active={this.state.active === index} />
))}
</Menu>
<Segment vertical>
{this.showContents()}
</Segment>
</div>
);
}
}