Commit 6f05bf21 by jutawuth nantawan

push project

0 parents
Showing with 1327 additions and 0 deletions
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
node_modules/
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
{
"useTabs": false,
"printWidth": 80,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "all",
"jsxBracketSameLine": true,
"semi": false,
"rcVerbose": false
}
\ No newline at end of file
File mode changed
File mode changed
const cors = require("cors")
const express = require("express")
const app = express()
const bodyParser = require("body-parser")
const Login = require("./routes/login")
const Menu = require("./routes/menu")
app.use(bodyParser.json())
app.use(cors())
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
new Login(app)
new Menu(app)
app.listen("8000",()=>console.log("listen on port 8000"))
\ No newline at end of file
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('server:server');
var http = require('http');
/**
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '8000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
server.listen(port);
server.on('error', onError);
server.on('listening', onListening);
/**
* Normalize a port into a number, string, or false.
*/
function normalizePort(val) {
var port = parseInt(val, 10);
if (isNaN(port)) {
// named pipe
return val;
}
if (port >= 0) {
// port number
return port;
}
return false;
}
/**
* Event listener for HTTP server "error" event.
*/
function onError(error) {
if (error.syscall !== 'listen') {
throw error;
}
var bind = typeof port === 'string'
? 'Pipe ' + port
: 'Port ' + port;
// handle specific listen errors with friendly messages
switch (error.code) {
case 'EACCES':
console.error(bind + ' requires elevated privileges');
process.exit(1);
break;
case 'EADDRINUSE':
console.error(bind + ' is already in use');
process.exit(1);
break;
default:
throw error;
}
}
/**
* Event listener for HTTP server "listening" event.
*/
function onListening() {
var addr = server.address();
var bind = typeof addr === 'string'
? 'pipe ' + addr
: 'port ' + addr.port;
debug('Listening on ' + bind);
}
{
"success": true,
"message": "login pass"
}
\ No newline at end of file
{
"success": true,
"message": "Menu list",
"menuList": [
{
"menuId": 1,
"menuName": "Home"
},
{
"menuId": 2,
"menuName": "Profile"
}
]
}
\ No newline at end of file
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Routing from './routes/MainRoutes'
class App extends Component {
render() {
return (
<Routing />
);
}
}
export default App;
\ No newline at end of file
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
export const increment = (score = 1) => ({
type: 'INCREMENT',
score
})
export const decrement = (score = -1) => ({
type: 'DECREMENT',
score
})
import React from 'react'
import { connect } from 'react-redux'
import { increment, decrement } from '../../action/countersAction'
class Text extends React.Component {
constructor(props) {
super(props)
this.state = { date: new Date() }
}
render() {
return (
<div className="container">
<div className="columns column is-12">
<h1>Counter : {this.props.counter}</h1>
</div>
</div>
)
}
}
const mapStateToProps = state => ({
message: 'This is message from mapStateToProps',
counter: state.countersReducers || 0
})
const TextWithConnect = connect(mapStateToProps)(Text)
export default TextWithConnect
import { createBrowserHistory } from 'history'
export default createBrowserHistory({
/* pass a configuration object here if needed */
})
\ No newline at end of file
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import rootReducer from './reducers'
import { Router } from 'react-router-dom'
import History from './history/History'
import registerServiceWorker from './registerServiceWorker'
import { createStore, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import logger from 'redux-logger'
const store = createStore(rootReducer, applyMiddleware(logger))
const AppWithRouter = () => (
<Provider store={store}>
<Router history={History}>
<App />
</Router>
</Provider>
)
ReactDOM.render(<AppWithRouter />, document.getElementById('root'))
registerServiceWorker()
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
<g fill="#61DAFB">
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
<circle cx="420.9" cy="296.5" r="45.7"/>
<path d="M520.5 78.1z"/>
</g>
</svg>
import React from "react";
import Login from "../../components/form/login/Login";
import Axios from "axios";
import History from "../../history/History";
import Logo from "./resources/images/logo_login.png";
import * as UrlConstants from "../../resources/js/constants/UrlConstants";
import "./resources/css/login.css";
export default class LoginPage extends React.Component {
_login = async(params) => {
const results = await Axios.post(UrlConstants.URL_LOGIN, params)
if (results.data.success) {
History.replace({ pathname: "/main" });
}
}
render() {
return (
<div className="login">
<img src={Logo} className="login-logo" alt="logo" />
<br/>
<br/>
<br/>
<Login getFormSubmitFn={this._login} />
</div>
);
}
}
.login {
height: 100vh;
background-color: #404041;
text-align: center
}
\ No newline at end of file
import React from 'react'
import Axios from 'axios'
import { Layout } from 'antd'
import * as UrlConstants from '../../resources/js/constants/UrlConstants'
import Header from '../../templates/layout/header/HeaderCanvasXTemplate'
import Sider from '../../templates/layout/sider/SiderCanvasXTemplate'
import Content from '../../templates/layout/content/ContentCanvasXTemplate'
import Footer from '../../templates/layout/footer/FooterCanvasXTemplate'
import './resources/css/mainPage.css'
export default class MainPage extends React.Component {
constructor(props) {
super(props)
this.state = { collapsed: false }
}
async componentDidMount() {
const params = {}
const results = await Axios.post(UrlConstants.URL_GET_MENU, params)
if (results.data.success) {
console.log('menuList: ', results.data.menuList)
}
}
render() {
return (
<Layout style={{ minHeight: '100vh' }}>
<Header />
<Sider />
<Layout>
<Content />
<Footer />
</Layout>
</Layout>
)
}
}
#components-layout-demo-custom-trigger .trigger {
font-size: 18px;
line-height: 64px;
padding: 0 24px;
cursor: pointer;
transition: color .3s;
}
#components-layout-demo-custom-trigger .trigger:hover {
color: #1890ff;
}
\ No newline at end of file
import React from 'react'
import { connect } from 'react-redux'
import Text from '../../components/text/Text'
import { increment, decrement } from '../../action/countersAction'
const App = ({ message, counter, dispatch }) => (
<div className="container">
<Text />
{/* <div className="columns column is-12">
<h1>Counter : {counter}</h1>
</div> */}
<div className="buttons">
<button
onClick={() => dispatch(increment(1))}
className="button is-primary">
+1
</button>
<button onClick={() => dispatch(increment(2))} className="button is-link">
+2
</button>
<button onClick={() => dispatch(increment(3))} className="button is-info">
+3
</button>
</div>
<div className="buttons">
<button
onClick={() => dispatch(decrement(1))}
className="button is-primary">
-1
</button>
<button onClick={() => dispatch(decrement(2))} className="button is-link">
-2
</button>
<button onClick={() => dispatch(decrement(3))} className="button is-info">
-3
</button>
</div>
</div>
)
const mapStateToProps = state => ({
message: 'This is message from mapStateToProps',
counter: state.countersReducers || 0,
})
const AppWithConnect = connect(mapStateToProps)(App)
export default AppWithConnect
export default (state = 0, { type, score }) => {
switch (type) {
case 'INCREMENT':
return state + score
case 'DECREMENT':
return state - score
default:
return state
}
}
\ No newline at end of file
import { combineReducers } from 'redux'
import countersReducers from './countersReducers'
export default combineReducers({
countersReducers
})
\ No newline at end of file
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
)
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location)
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`
if (isLocalhost) {
// This is running on localhost. Lets check if a service worker still exists or not.
checkValidServiceWorker(swUrl)
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://goo.gl/SC7cgQ'
)
})
} else {
// Is not local host. Just register service worker
registerValidSW(swUrl)
}
})
}
}
function registerValidSW(swUrl) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.')
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.')
}
}
}
}
})
.catch(error => {
console.error('Error during service worker registration:', error)
})
}
function checkValidServiceWorker(swUrl) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
if (
response.status === 404 ||
response.headers.get('content-type').indexOf('javascript') === -1
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload()
})
})
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl)
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
)
})
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister()
})
}
}
const URI = "http://localhost:8000/"; // local server
export const URL_LOGIN = URI + "login";
export const URL_GET_MENU = URI + "getMenu";
import React from 'react'
import { Switch, Route } from 'react-router-dom'
import LoginPage from '../pages/login/LoginPage'
import MainPage from '../pages/main/MainPage'
import Test from '../pages/test/Test'
export default () => (
<Switch>
<Route exact path="/" component={LoginPage} />
<Route path="/login" component={LoginPage} />
<Route path="/main" component={MainPage} />
<Route path="/test" component={Test} />
</Switch>
)
\ No newline at end of file
import React from 'react'
import { Switch, Route } from 'react-router-dom'
import Topic from '../pages/topics/Topic'
export default ({ match }) =>{ console.log(match);
return (
<Switch>
<Route path={`${match.url}/:topicId`} component={Topic} />
</Switch>
)}
\ No newline at end of file
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read http://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit http://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See http://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
import React from "react";
import {
Form, Icon, Input, Button, Checkbox, DatePicker
} from 'antd';
import 'antd/dist/antd.css';
import './resources/css/login.css';
class Login extends React.Component {
_validateFromSubmitFn = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
this._getFormSubmit(values)
}
});
}
_getFormSubmit = (value)=> {
this.props.getFormSubmitFn(value)
}
render() {
const { getFieldDecorator } = this.props.form;
return (
<React.Fragment>
<Form onSubmit={this._validateFromSubmitFn} className="login-form">
<Form.Item>
{getFieldDecorator('userName', {
rules: [{ required: true, message: 'Please input your username !!!' }],
})(
<Input prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} placeholder="Username" />
)}
</Form.Item>
<Form.Item>
{getFieldDecorator('password', {
rules: [{ required: true, message: 'Please input your Password!' }],
})(
<Input prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} type="password" placeholder="Password" />
)}
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit" className="login-form-button">
Log in
</Button>
</Form.Item>
</Form>
</React.Fragment>
);
}
}
const WrappedLoginForm = Form.create({ name: 'normal_login' })(Login);
export default WrappedLoginForm;
\ No newline at end of file
.login-form {
margin: auto;
width: 250px;
}
.login-form-forgot {
float: right;
}
.login-form-button {
width: 100%;
}
\ No newline at end of file
import React, { Component, Fragment } from 'react'
import moment from 'moment'
import 'antd/dist/antd.css'
import { Form, Input, Button, Icon, Select, Row, Col, DatePicker } from 'antd'
const { RangePicker } = DatePicker
const { Option } = Select
class SearchConditions extends Component {
state = {
isAnonymous: false,
expand: false,
}
handleSelectChange = value => {
this.setState({
isAnonymous: value === 'true' ? true : false,
})
}
toggle = () => {
const { expand } = this.state
this.setState({ expand: !expand })
}
disabledDate = current => {
return current && current < moment().subtract(30, 'days')
}
_handleSubmitFn = e => {
e.preventDefault()
this.props.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values)
}
})
}
render() {
console.log('render')
const { getFieldDecorator } = this.props.form
return (
<Fragment>
<Form onSubmit={this._handleSubmitFn} hidden={this.state.expand}>
<Row gutter={16}>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Log ID :">
{getFieldDecorator('logID')(<Input placeholder="Log ID" />)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Anonymous :">
{getFieldDecorator('isAnonymous', {
initialValue: 'false',
})(
<Select onChange={this.handleSelectChange}>
<Option value="false">Username</Option>
<Option value="true">Anonymous</Option>
</Select>,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Username :">
{getFieldDecorator('username', {})(
<Input
placeholder="Username"
disabled={this.state.isAnonymous}
/>,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Mobile ID :">
{getFieldDecorator('mobileID')(
<Input placeholder="Mobile ID" />,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Device Type :">
{getFieldDecorator('deviceType', {
initialValue: 'All',
})(
<Select>
<Option value="All">All</Option>
<Option value="iOS">iOS</Option>
<Option value="Android">Android</Option>
</Select>,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Screen :">
{getFieldDecorator('screen')(<Input placeholder="Screen" />)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Action :">
{getFieldDecorator('action')(<Input placeholder="Action" />)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Transaction Message :">
{getFieldDecorator('message')(
<Input placeholder="Transaction Message" />,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Result From :">
{getFieldDecorator('resultFrom')(
<Input placeholder="Result From" />,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Result :">
{getFieldDecorator('result', {
initialValue: 'All',
})(
<Select>
<Option value="All">All</Option>
<Option value="SUCCESS">SUCCESS</Option>
<Option value="FAIL">FAIL</Option>
</Select>,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Http Status :">
{getFieldDecorator('resultHttpStatus')(
<Input placeholder="Http Status" />,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Result Code :">
{getFieldDecorator('resultCode', {
initialValue: 'All',
})(
<Select>
<Option value="All">All</Option>
<Option value="200">200</Option>
<Option value="201">201</Option>
<Option value="202">202</Option>
<Option value="203">203</Option>
<Option value="204">204</Option>
<Option value="300">300</Option>
</Select>,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item label="Result Message :">
{getFieldDecorator('resultMessage')(
<Input placeholder="Result Message" />,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 24 }}
sm={{ span: 16 }}
md={{ span: 11 }}
lg={{ span: 8 }}>
<Form.Item label="Request Time :">
{getFieldDecorator('requestTime', {
initialValue: [
moment(moment().format('HH:mm:'), 'HH:mm'),
moment(moment().format('HH:mm:'), 'HH:mm'),
],
})(
<RangePicker
disabledDate={this.disabledDate}
showTime={{ format: 'HH:mm' }}
format="YYYY-MM-DD HH:mm"
/>,
)}
</Form.Item>
</Col>
<Col
xs={{ span: 12 }}
sm={{ span: 6 }}
md={{ span: 4 }}
lg={{ span: 4 }}>
<Form.Item>
<Button className="top" type="primary" htmlType="submit">
Search
</Button>
</Form.Item>
</Col>
</Row>
</Form>
<div style={{ textAlign: 'center' }}>
<Button onClick={this.toggle} block type="primary">
<Icon type={this.state.expand ? 'down' : 'up'} />
</Button>
</div>
</Fragment>
)
}
}
export default Form.create({ name: 'transaction_search' })(SearchConditions)
import React from 'react'
import { connect } from 'react-redux'
import { increment, decrement } from '../../action/countersAction'
class Text extends React.Component {
constructor(props) {
super(props)
this.state = { date: new Date() }
}
render() {
return (
<div className="container">
<div className="columns column is-12">
<h1>Counter : {this.props.counter}</h1>
</div>
</div>
)
}
}
const mapStateToProps = state => ({
message: 'This is message from mapStateToProps',
counter: state.countersReducers || 0
})
const TextWithConnect = connect(mapStateToProps)(Text)
export default TextWithConnect
import React from "react";
// import "./resources/css/footer.css";
import { Breadcrumb } from "antd";
export default class BreadcrumbComponent extends React.Component {
render() {
return (
<Breadcrumb style={{ margin: "16px 0" }}>
<Breadcrumb.Item>User</Breadcrumb.Item>
<Breadcrumb.Item>Bill</Breadcrumb.Item>
</Breadcrumb>
);
}
}
import React, { Component, Fragment } from 'react'
import moment from 'moment'
import 'antd/dist/antd.css'
// import './resources/css/wdsSearchStyle.css'
import { Form, Input, Button, Icon, Select, Row, Col, DatePicker } from 'antd'
import SerarchForm from '../../form/search/WDSSearchTemplate'
import { style } from './resources/style/contentStyle'
class SearchConditions extends Component {
render() {
const { getFieldDecorator } = this.props.form
return (
<Fragment>
<div style={style}>
<SerarchForm />
</div>
</Fragment>
)
}
}
export default Form.create({ name: 'transaction_search' })(SearchConditions)
export const style = {
marginTop: 45,
marginLeft: 10,
marginRight: 10
}
\ No newline at end of file
import React from "react";
// import "./resources/css/footer.css";
import { Layout } from "antd";
const { Footer } = Layout;
export default class FooterComponent extends React.Component {
render() {
return (
<Footer style={{ textAlign: "center" }}>
Ant Design ©2018 Created by Ant UED
</Footer>
);
}
}
.footer {
color: #FFF;
background-color: #404041;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 20px;
line-height: 20px;
text-align: center;
font-size: calc(4px + 1vmin);
}
\ No newline at end of file
import React from 'react'
import { Layout, Row, Col, Menu, Icon, Comment, Avatar } from 'antd'
import logo from './resources/images/logo.png'
import { style, logoStyle } from './resources/style/js/headerStyle'
const { Header } = Layout
const SubMenu = Menu.SubMenu
const MenuItemGroup = Menu.ItemGroup
export default class HeaderCanvasXTemplate extends React.Component {
constructor(props) {
super(props)
this.state = { current: '' }
}
handleClick = e => {
console.log('click ', e)
this.setState({
current: e.key,
})
}
render() {
return (
<Header className="header" style={style}>
<Row>
{/* <Col span={8}>
<Comment
avatar={<Avatar src={logo} alt="logo" />}
content={<p>Canvas X</p>}
style={logoStyle}
/>
</Col> */}
<Col span={8} offset={8}>
<Menu
onClick={this.handleClick}
selectedKeys={[this.state.current]}
mode="horizontal"
style={style}
theme="dark">
<SubMenu
// style={{ float: 'right' }}
title={
<span className="submenu-title-wrapper">
<Icon type="user" />
User
</span>
}>
<MenuItemGroup title="Item 1">
<Menu.Item key="setting:1">Option 1</Menu.Item>
<Menu.Item key="setting:2">Option 2</Menu.Item>
</MenuItemGroup>
<MenuItemGroup title="Item 2">
<Menu.Item key="setting:3">Option 3</Menu.Item>
<Menu.Item key="setting:4">Option 4</Menu.Item>
</MenuItemGroup>
</SubMenu>
</Menu>
</Col>
</Row>
</Header>
)
}
}
export const style = {
position: 'fixed',
zIndex: 1,
width: '100%',
background: '#404041',
padding: 0,
height: 45,
}
export const logoStyle = {
height: 45,
}
import React from 'react'
import { Layout, Menu, Icon } from 'antd'
import './resources/css/sider.css'
import { style } from './resources/style/siderStyle'
const SubMenu = Menu.SubMenu
const { Sider } = Layout
export default class SiderComponent extends React.Component {
constructor(props) {
super(props)
this.state = { collapsed: false }
}
onCollapse = collapsed => {
this.setState({ collapsed })
}
render() {
return (
<Sider
collapsible
collapsed={this.state.collapsed}
onCollapse={this.onCollapse}
className="main-meenu"
style={style}>
<Menu theme="dark" defaultSelectedKeys={['1']} mode="inline">
<Menu.Item key="1">
<Icon type="pie-chart" />
<span>Option 1</span>
</Menu.Item>
<Menu.Item key="2">
<Icon type="desktop" />
<span>Option 2</span>
</Menu.Item>
<SubMenu
key="sub1"
title={
<span>
<Icon type="user" />
<span>User</span>
</span>
}>
<Menu.Item key="3">Tom</Menu.Item>
<Menu.Item key="4">Bill</Menu.Item>
<Menu.Item key="5">Alex</Menu.Item>
</SubMenu>
<SubMenu
key="sub2"
title={
<span>
<Icon type="team" />
<span>Team</span>
</span>
}>
<Menu.Item key="6">Team 1</Menu.Item>
<Menu.Item key="8">Team 2</Menu.Item>
</SubMenu>
<Menu.Item key="9">
<Icon type="file" />
<span>File</span>
</Menu.Item>
</Menu>
</Sider>
)
}
}
.main-menu {
margin-top: 46px;
}
\ No newline at end of file
export const style = {
marginTop: 41
}
\ No newline at end of file
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!