commons lint
This commit is contained in:
parent
f01f185ed6
commit
743f135df3
|
@ -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;
|
||||||
|
|
|
@ -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 (
|
||||||
|
|
|
@ -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}>
|
||||||
|
|
|
@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user