From f8f10bff6193e336de01a98c08542324bdb1f9cb Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 2 Jan 2018 10:40:33 +0900 Subject: [PATCH] fixed sensor config --- .../sensor/react/components/sensor_config.tsx | 41 ++-- .../react/components/sensor_config_item.tsx | 16 +- .../components/sensor_config_setting.tsx | 180 ++++++++++++++++++ .../react/components/sensor_config_target.tsx | 53 +++--- 4 files changed, 245 insertions(+), 45 deletions(-) create mode 100644 src/ts/@overflow/sensor/react/components/sensor_config_setting.tsx diff --git a/src/ts/@overflow/sensor/react/components/sensor_config.tsx b/src/ts/@overflow/sensor/react/components/sensor_config.tsx index 72f8189..219a734 100644 --- a/src/ts/@overflow/sensor/react/components/sensor_config.tsx +++ b/src/ts/@overflow/sensor/react/components/sensor_config.tsx @@ -1,12 +1,13 @@ import * as React from 'react'; import { Table, Header, Container, Form, Checkbox, Button, Rating, - List, Icon, + List, Icon, Grid, } from 'semantic-ui-react'; -import {SensorConfigTarget} from './sensor_config_target'; -import {SensorConfigCrawler} from './sensor_config_crawler'; -import {SensorConfigAuthCrawler} from './sensor_config_auth_crawler'; -import {SensorConfigItem} from './sensor_config_item'; +import { SensorConfigTarget } from './sensor_config_target'; +import { SensorConfigCrawler } from './sensor_config_crawler'; +import { SensorConfigAuthCrawler } from './sensor_config_auth_crawler'; +import { SensorConfigItem } from './sensor_config_item'; +import { SensorConfigSetting } from './sensor_config_setting'; export interface StateProps { } @@ -33,15 +34,33 @@ export class SensorConfig extends React.Component { public render(): JSX.Element { return ( - Target Select + + + + Target Select - Crawler Select - - Auth Crawler + + + Auth Crawler - Sensor Item + + + + + Crawler Select + + + + Sensor Item - {/* */} + + + + Sensor Setting + + + + ); } diff --git a/src/ts/@overflow/sensor/react/components/sensor_config_item.tsx b/src/ts/@overflow/sensor/react/components/sensor_config_item.tsx index ad28c14..223502b 100644 --- a/src/ts/@overflow/sensor/react/components/sensor_config_item.tsx +++ b/src/ts/@overflow/sensor/react/components/sensor_config_item.tsx @@ -33,17 +33,19 @@ export class SensorConfigItem extends React.Component { let item: ItemTreeObj = { icon: 'chevron up|chevron down', isCheckBox: true, - label: 'test label', + label: 'CPU', }; item.children = new Array(); - for(let idx: number = 0; idx < 10; ++idx) { - item.children.push({ - isCheckBox: true, - label: 'test label-' + String(idx), - }); - } + item.children.push({ + isCheckBox: true, + label: 'CPU Total Usage(%)', + }); + item.children.push({ + isCheckBox: true, + label: 'CPU Free Usage(%)', + }); this.state.testItemTreeList.push(item); } diff --git a/src/ts/@overflow/sensor/react/components/sensor_config_setting.tsx b/src/ts/@overflow/sensor/react/components/sensor_config_setting.tsx new file mode 100644 index 0000000..74387cf --- /dev/null +++ b/src/ts/@overflow/sensor/react/components/sensor_config_setting.tsx @@ -0,0 +1,180 @@ +import * as React from 'react'; +import { + Table, Header, Container, Form, Checkbox, Button, Rating, + List, Icon, Radio, CheckboxProps, InputOnChangeData, Input, +} from 'semantic-ui-react'; + + + + +export interface StateProps { +} + +export interface DispatchProps { +} + +export type Props = StateProps & DispatchProps; + +export interface State { + +} + +export class SensorConfigSetting extends React.Component { + + constructor(props: Props, context: State) { + super(props, context); + + this.state = { + + }; + } + + public render(): JSX.Element { + return ( + + Interval select + + + ); + } + +} + + + + +export interface NameIntervalStateProps { +} + +export interface NameIntervalDispatchProps { +} + +export type NameIntervalProps = NameIntervalStateProps & NameIntervalDispatchProps; + +export interface NameIntervalState { + selectedValue: number | string; +} + +export class SensorConfigSettingNameInterval extends React.Component { + + constructor(props: NameIntervalProps, context: NameIntervalState) { + super(props, context); + + this.state = { + selectedValue: null, + }; + } + + public handleChange = (event: React.FormEvent, data: CheckboxProps) => { + this.setState({ selectedValue: data.value }); + } + + + public render(): JSX.Element { + return ( + + , data: InputOnChangeData) => { + {/* this.onChangeAuth(item.name, data.value); */ } + }} /> +
+ + + + + + + + + +
+
+ ); + } + +} + + + +export interface TargetInfoStateProps { +} + +export interface TargetInfoDispatchProps { +} + +export type TargetInfoProps = TargetInfoStateProps & TargetInfoDispatchProps; + +export interface TargetInfoState { + +} + +export class SensorConfigSettingTargetInfo extends React.Component { + + constructor(props: TargetInfoProps, context: TargetInfoState) { + super(props, context); + + this.state = { + + }; + } + + public render(): JSX.Element { + return ( + + + ); + } + +} + + + + +export interface SensorItemInfoStateProps { +} + +export interface SensorItemInfoDispatchProps { +} + +export type SensorItemInfoProps = SensorItemInfoStateProps & SensorItemInfoDispatchProps; + +export interface SensorItemInfoState { + +} + +export class SensorConfigSettingSensorItemInfo extends React.Component { + + constructor(props: SensorItemInfoProps, context: SensorItemInfoState) { + super(props, context); + + this.state = { + + }; + } + + public render(): JSX.Element { + return ( + + + ); + } + +} diff --git a/src/ts/@overflow/sensor/react/components/sensor_config_target.tsx b/src/ts/@overflow/sensor/react/components/sensor_config_target.tsx index 20a38dd..ef224ec 100644 --- a/src/ts/@overflow/sensor/react/components/sensor_config_target.tsx +++ b/src/ts/@overflow/sensor/react/components/sensor_config_target.tsx @@ -3,7 +3,7 @@ import { Table, Header, Container, Form, Checkbox, Button, Rating, List, Icon, } from 'semantic-ui-react'; -import { ListContainer } from '@overflow/commons/react/component/ListContainer'; +import {ItemTree, ItemTreeObj} from './item_tree'; export interface StateProps { @@ -15,6 +15,7 @@ export interface DispatchProps { export type Props = StateProps & DispatchProps; export interface State { + testItemTreeList: Array; } export class SensorConfigTarget extends React.Component { @@ -23,39 +24,37 @@ export class SensorConfigTarget extends React.Component { super(props, context); this.state = { - selected: null, + testItemTreeList: new Array(), }; + + this.testData(); + } + + private testData(): void { + + let item: ItemTreeObj = { + icon: 'chevron up|chevron down', + isCheckBox: false, + label: 'Host', + }; + + item.children = new Array(); + + for(let idx: number = 0; idx < 10; ++idx) { + item.children.push({ + isCheckBox: true, + label: '192.168.1.' + String(idx + 1), + }); + } + + this.state.testItemTreeList.push(item); } public render(): JSX.Element { return ( - - - - - - - - - - - - - - - - - - - - - - - - + ); }