From b823b54a9828c9b97db0c42bcea1d25ff8b35d85 Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 24 Aug 2017 16:26:48 +0900 Subject: [PATCH] sensor config target ing --- .../react/components/SensorConfiguration.tsx | 54 ++++++++++++++++--- 1 file changed, 47 insertions(+), 7 deletions(-) diff --git a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx index e80833d..bc6df93 100644 --- a/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorConfiguration.tsx @@ -1,6 +1,26 @@ import * as React from 'react'; -import { Icon, Step, Button, Table, Radio, Form, Container, Checkbox } from 'semantic-ui-react'; -import { Grid, Image, Label, Segment, Dropdown, Input, List, Accordion, Loader } from 'semantic-ui-react'; +import { + Icon, + Step, + Button, + Table, + Radio, + Form, + Container, + Checkbox, +} from 'semantic-ui-react'; +import { + Grid, + Image, + Label, + Segment, + Dropdown, + Input, + List, + Accordion, + Loader, + DropdownItemProps, +} from 'semantic-ui-react'; import MetaCrawler from '@overflow/meta/api/model/MetaCrawler'; import Infra from '@overflow/infra/api/model/Infra'; @@ -17,7 +37,7 @@ export interface SensorConfigurationStateProps { export interface SensorConfigurationDispatchProps { onReadAllTargetByDomain?(domain: Domain): void; - onReadInfra?(infraId: number ): void; + onReadInfra?(infraId: number): void; } export interface SensorConfigurationState { @@ -36,8 +56,8 @@ export class SensorConfiguration extends React.Component, ]; return ( - + ); } } @@ -73,6 +93,8 @@ export interface ConfigStepperState { export class ConfigStepper extends React.Component { + private selectOptions: Array; + constructor(props: ConfigStepperProps, context: ConfigStepperState) { super(props, context); this.state = { @@ -80,6 +102,24 @@ export class ConfigStepper extends React.Component = new Array; + + for (let infra of this.props.infraList) { + + let option = { + // key: crawler.id, + text: infra.target.displayName, + value: infra.target.id, + icon: 'check', // or close? + }; + selectionOptions.push(option); + + } + this.selectOptions = selectionOptions; + } + public handleActive(idx: number): boolean { if (this.state.currentStep === idx) { return true; @@ -142,7 +182,7 @@ export class ConfigStepper extends React.Component