diff --git a/src/ts/containers/config/crawlerSelector.tsx b/src/ts/containers/config/crawlerSelector.tsx new file mode 100644 index 0000000..658105a --- /dev/null +++ b/src/ts/containers/config/crawlerSelector.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; + +export class CrawlerSelector extends React.Component { + constructor(props: any, context: any) { + super(props, context) + this.state = { + }; + } + + + render() { + return ( + +
+ CrawlerSelector +
+
+ ); + } +} \ No newline at end of file diff --git a/src/ts/containers/config/itemSelector.tsx b/src/ts/containers/config/itemSelector.tsx new file mode 100644 index 0000000..cf7cf78 --- /dev/null +++ b/src/ts/containers/config/itemSelector.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; + +export class ItemSelector extends React.Component { + constructor(props: any, context: any) { + super(props, context) + this.state = { + }; + } + + + render() { + return ( + +
+ ItemSelector +
+
+ ); + } +} \ No newline at end of file diff --git a/src/ts/containers/config/sensorConfig.tsx b/src/ts/containers/config/sensorConfig.tsx new file mode 100644 index 0000000..e349f56 --- /dev/null +++ b/src/ts/containers/config/sensorConfig.tsx @@ -0,0 +1,118 @@ +import * as React from 'react'; +import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; +import { + Step, + Stepper, + StepLabel, +} from 'material-ui/Stepper'; +import RaisedButton from 'material-ui/RaisedButton'; +import FlatButton from 'material-ui/FlatButton'; +import Divider from 'material-ui/Divider'; + +import { TargetSelector } from './targetSelector'; +import { CrawlerSelector } from './crawlerSelector'; +import { ItemSelector } from './itemSelector'; + +export class SensorConfig extends React.Component { + + constructor(props: any, context: any) { + super(props, context) + } + + state = { + finished: false, + stepIndex: 0, + selected: -1 + }; + + handleNext = () => { + const { stepIndex } = this.state; + this.setState({ + stepIndex: stepIndex + 1, + finished: stepIndex >= 2, + }); + if(this.state.stepIndex == 0) { + alert(this.state.selected); + } + + }; + + handlePrev = () => { + const { stepIndex } = this.state; + if (stepIndex > 0) { + this.setState({ stepIndex: stepIndex - 1 }); + } + }; + + handleChange(idx :any) { + this.setState({ + selected : idx + }); + } + + getStepContent(stepIndex: any) { + switch (stepIndex) { + case 0: + return ; + case 1: + return ; + case 2: + return ; + default: + return 'errrrrrr'; + } + } + + render() { + return ( + +
+ + + MONITOR WHAT? + + + TECHNOLOGY USED? + + + SELEC ITEMS + + + +
+ {this.state.finished ? ( +

+ { + event.preventDefault(); + this.setState({ stepIndex: 0, finished: false }); + }} + > + Click here + to reset the example. +

+ ) : ( +
+ {this.getStepContent(this.state.stepIndex)} +
+ + +
+
+ )} +
+
+
+ ); + } +} \ No newline at end of file diff --git a/src/ts/containers/config/targetSelector.tsx b/src/ts/containers/config/targetSelector.tsx new file mode 100644 index 0000000..143d885 --- /dev/null +++ b/src/ts/containers/config/targetSelector.tsx @@ -0,0 +1,99 @@ +import * as React from 'react'; +import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; + +import { List, ListItem, makeSelectable } from 'material-ui/List'; +import Subheader from 'material-ui/Subheader'; +import Checkbox from 'material-ui/Checkbox'; + + +let SelectableList = makeSelectable(List); + +function wrapState(ComposedComponent: any, par : any) { + return class SelectableList extends React.Component { + + constructor(props: any) { + super(props); + } + + componentWillMount() { + this.setState({ + selectedIndex: this.props.defaultValue, + }); + } + + handleRequestChange = (event: any, index: any) => { + par.handleSelect(index); + }; + + render() { + return ( + + {this.props.children} + + ); + } + }; +} + + + +export class TargetSelector extends React.Component { + constructor(props: any, context: any) { + super(props, context) + this.state = { + }; + SelectableList = wrapState(SelectableList, this); + } + + handleSelect(idx : any) { + this.props.onChange(idx); + } + + render() { + return ( + +
+ + Select a target to monitor + , + , + ]} + />, + , + , + ]} + />, + , + ]} + />, + ]} + /> + +
+
+ ); + } +} diff --git a/src/ts/containers/prove/download.tsx b/src/ts/containers/prove/download.tsx index b8e9ae8..3fd068f 100644 --- a/src/ts/containers/prove/download.tsx +++ b/src/ts/containers/prove/download.tsx @@ -8,19 +8,19 @@ import Download from 'material-ui/svg-icons/file/file-download'; import Delete from 'material-ui/svg-icons/action/delete'; import ContentCopy from 'material-ui/svg-icons/content/content-copy'; -import {InstallGuide} from './installguide'; +import { InstallGuide } from './installguide'; const styles = { - osSelector : { - display: 'inline-block', - float: 'left', + osSelector: { + display: 'inline-block', + float: 'left', }, content: { display: 'inline-block', float: 'left', - width : "85%", - height : 700, - padding : 20, + width: "85%", + height: 700, + padding: 20, }, } @@ -29,14 +29,14 @@ export class ProveDownload extends React.Component { super(props, context) this.state = { selectedOSidx: 0, - selectedOSName : "Windows", + selectedOSName: "Windows", }; } - handleOSChange = (event :any, menuItem: any, index: any) => { + handleOSChange = (event: any, menuItem: any, index: any) => { this.setState({ selectedOSidx: index, - selectedOSName : menuItem.props.primaryText + selectedOSName: menuItem.props.primaryText }); } @@ -45,7 +45,7 @@ export class ProveDownload extends React.Component { return ( -
+
@@ -60,7 +60,7 @@ export class ProveDownload extends React.Component { - +
diff --git a/src/ts/containers/prove/installguide.tsx b/src/ts/containers/prove/installguide.tsx index ad7960b..344babd 100644 --- a/src/ts/containers/prove/installguide.tsx +++ b/src/ts/containers/prove/installguide.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'; -import {List, ListItem} from 'material-ui/List'; +import { List, ListItem } from 'material-ui/List'; import ActionInfo from 'material-ui/svg-icons/action/info'; import SelectField from 'material-ui/SelectField'; import MenuItem from 'material-ui/MenuItem'; @@ -9,8 +9,8 @@ const styles = { content: { display: 'inline-block', float: 'left', - width : "85%", - height : 700, + width: "85%", + height: 700, }, } @@ -26,19 +26,19 @@ export class InstallGuide extends React.Component { const osIdx = this.props.idx; let target = null; if (osIdx == 0) { - target = ; - }else if (osIdx == 1) { - target = ; - }else { + target = ; + } else if (osIdx == 1) { + target = ; + } else { target =

Not support yet.

; } return ( -
+

Installing on {this.props.name}

} /> - {target} + {target}
); @@ -52,7 +52,7 @@ export class WindowsInstallGuide extends React.Component { }; } - handleArchChange = (event :any, menuItem: any, value: any) => { + handleArchChange = (event: any, menuItem: any, value: any) => { this.setState({ selectedArch: value, }); @@ -61,12 +61,12 @@ export class WindowsInstallGuide extends React.Component { render() { return ( -
+
+ > @@ -87,9 +87,9 @@ export class UbuntuInstallGuide extends React.Component { render() { return ( -
+
Ubuntu blah blah -
+
); } diff --git a/src/ts/index.tsx b/src/ts/index.tsx index bb4d280..433cf86 100644 --- a/src/ts/index.tsx +++ b/src/ts/index.tsx @@ -8,6 +8,7 @@ import { MemberEmailConfirm } from './containers/member/emailConfirm'; import { MemberLogin } from './containers/member/login'; import { Main } from './containers/Main'; import { ProveDownload } from './containers/prove/download'; +import { SensorConfig } from './containers/config/sensorConfig'; import '../scss/index.scss'; @@ -15,6 +16,6 @@ import '../scss/index.scss'; injectTapEventPlugin(); ReactDOM.render( - , + , document.getElementById('example') ); \ No newline at end of file