This commit is contained in:
geek 2017-05-30 19:56:16 +09:00
parent e7589e4cc1
commit 9d920efbde
3 changed files with 171 additions and 12 deletions

View File

@ -0,0 +1,158 @@
import * as React from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import {
Table,
TableBody,
TableHeader,
TableHeaderColumn,
TableFooter,
TableRow,
TableRowColumn,
} from 'material-ui/Table';
import Toggle from 'material-ui/Toggle';
import FlatButton from 'material-ui/FlatButton';
import Dialog from 'material-ui/Dialog';
const styles = {
propContainer: {
width: 200,
overflow: 'hidden',
margin: '20px auto 0',
},
propToggleHeader: {
margin: '20px auto 10px',
},
};
const tableData = [
{
apiKey: 'wqekoekeeeeerw',
name: 'Agent 1',
status: 'Wait For Auth',
},
{
apiKey: 'wqekoekeeeeerw',
name: 'Agent 2',
status: 'Wait For Auth',
},
{
apiKey: 'wqekoekeeeeerw',
name: 'Agent 3',
status: 'Wait For Auth',
},
{
apiKey: 'wqekoekeeeeerw',
name: 'Agent 4',
status: 'Wait For Auth',
},
{
apiKey: 'wqekoekeeeeerw',
name: 'Agent 5',
status: 'Wait For Auth',
},
{
apiKey: 'wqekoekeeeeerw',
name: 'Agent 6',
status: 'Wait For Auth',
},
{
apiKey: 'wqekoekeeeeerw',
name: 'Agent 7',
status: 'Wait For Auth',
},
];
export class WaitForAuth extends React.Component<any, any> {
constructor(props: any, context: any) {
super(props, context)
};
state = {
selectable: true,
multiSelectable: true,
enableSelectAll: true,
showCheckboxes: true,
stripedRows: false,
open: false,
};
handleCellClick = (e: any, idx: number) => {
console.log(e)
this.setState({open:true})
}
handleRowSelected = (selectedRows: number[] | string) => {
// console.log(selectedRows)
}
handleClose = () => {
this.setState({ open: false });
};
render() {
const actions = [
<FlatButton
label="Cancel"
primary={true}
onTouchTap={this.handleClose}
/>,
<FlatButton
label="Submit"
primary={true}
disabled={true}
onTouchTap={this.handleClose}
/>,
]
return (
<MuiThemeProvider >
<div>
<Table
selectable={this.state.selectable}
multiSelectable={this.state.multiSelectable}
onCellClick={this.handleCellClick}
onRowSelection={this.handleRowSelected}
>
<TableHeader
displaySelectAll={this.state.showCheckboxes}
adjustForCheckbox={this.state.showCheckboxes}
enableSelectAll={this.state.enableSelectAll} >
<TableRow>
<TableHeaderColumn colSpan={3} tooltip="Super Header" style={{ textAlign: 'center' }}>
Super Header
</TableHeaderColumn>
</TableRow>
<TableRow>
<TableHeaderColumn tooltip="The API Key">API Key</TableHeaderColumn>
<TableHeaderColumn tooltip="The Name">Name</TableHeaderColumn>
<TableHeaderColumn tooltip="The Status">Status</TableHeaderColumn>
</TableRow>
</TableHeader>
<TableBody
displayRowCheckbox={this.state.showCheckboxes}
stripedRows={this.state.stripedRows}>
{tableData.map((row: any, index: number) => (
<TableRow key={index} >
<TableRowColumn>{row.apiKey}</TableRowColumn>
<TableRowColumn>{row.name}</TableRowColumn>
<TableRowColumn>{row.status}</TableRowColumn>
</TableRow>
))};
</TableBody>
<TableFooter
adjustForCheckbox={this.state.showCheckboxes} >
< Dialog
title="Dialog With Actions"
actions={actions}
modal={true}
open={this.state.open} >
Agent를 ?
</Dialog >
</TableFooter>
</Table>
</div>
</MuiThemeProvider>
);
}
}

View File

@ -101,16 +101,16 @@ export class MemberRegist extends React.Component<any, any> {
let os: OFRest = new OFRest("Member", "Regist", obj); let os: OFRest = new OFRest("Member", "Regist", obj);
os.Call().then(function (res) { os.Call().then(function (res) {
return res.json(); return res.json();
}).then(function(json) { }).then(function (json) {
console.log(json); console.log(json);
ReactDOM.render(<MemberRegistResult />, document.getElementById('example')); ReactDOM.render(<MemberRegistResult />, document.getElementById('example'));
}).catch(function(err) { }).catch(function (err) {
console.log(err); console.log(err);
}); });
} }
@ -260,7 +260,7 @@ export class MemberRegist extends React.Component<any, any> {
ref="email" ref="email"
hintText="smith@gmail.com" hintText="smith@gmail.com"
floatingLabelText="Email address*" floatingLabelText="Email address*"
errorText={this.state.isEmail ? "":"Please Email Format"} errorText={this.state.isEmail ? "" : "Please Email Format"}
style={styles.textfield} style={styles.textfield}
underlineShow={true} underlineShow={true}
value={this.state.email} value={this.state.email}

View File

@ -9,6 +9,7 @@ import { MemberLogin } from './containers/member/login';
import { Main } from './containers/Main'; import { Main } from './containers/Main';
import { ProveDownload } from './containers/prove/download'; import { ProveDownload } from './containers/prove/download';
import { SensorConfig } from './containers/config/sensorConfig'; import { SensorConfig } from './containers/config/sensorConfig';
import { WaitForAuth } from './containers/agent/waitForAuth';
import '../scss/index.scss'; import '../scss/index.scss';
@ -16,6 +17,6 @@ import '../scss/index.scss';
injectTapEventPlugin(); injectTapEventPlugin();
ReactDOM.render( ReactDOM.render(
<SensorConfig />, <WaitForAuth />,
document.getElementById('example') document.getElementById('example')
); );