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 { 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>
);
}
}

View File

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

View File

@ -1,6 +1,14 @@
import * as React from '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> {
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;
}
handleClick(index: number) {
public handleClick(index: number): void {
this.setState({
active: index,
});
}
render() {
public render(): JSX.Element {
const activeItem = this.state.activeItem;
return (
@ -41,4 +49,4 @@ export class DetailContainer extends React.Component<any, any> {
</Grid>
);
}
}
}

View File

@ -1,6 +1,14 @@
import * as React from '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> {
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 items: object[];
items = this.props.data;
@ -30,13 +38,13 @@ export class ListContainer extends React.Component<any, any> {
this.props.onSearch(result);
}
handleSearchInput(e: any, data: any) {
public handleSearchInput(e: any, data: any): void {
this.setState({
searchWord: data.value,
});
}
search(item: any, searchWord: string) {
public search(item: any, searchWord: string): void {
let key: any;
for (key in item) {
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') {
return true;
}
return false;
}
render() {
public render(): JSX.Element {
return (
<Grid>
<Grid.Column width={4}>
@ -71,4 +79,4 @@ export class ListContainer extends React.Component<any, any> {
</Grid>
);
}
}
}

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>
);
}
}