From 37d854334dd73889e075b8032bd47d7de07599ec Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 27 Mar 2017 14:53:34 +0800 Subject: [PATCH] add ipcam file --- route/api/ipcam.js | 26 +++++++++++++++++++++++++ src/components/AdminPage/IPCam/index.js | 14 +++++++++++++ src/containers/AdminPage/IPCam.js | 18 +++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 route/api/ipcam.js create mode 100644 src/components/AdminPage/IPCam/index.js create mode 100644 src/containers/AdminPage/IPCam.js diff --git a/route/api/ipcam.js b/route/api/ipcam.js new file mode 100644 index 0000000..9ba44dd --- /dev/null +++ b/route/api/ipcam.js @@ -0,0 +1,26 @@ +const express = require('express'); +const router = express.Router(); +const rt = require('../ResTool'); +const config = require('../../config.json'); +const fs = require('fs'); +const mysql = require('../../libs/mysql_cls'); +const tool = require('../../includes/apiTool'); +const exec = require('child_process').exec; +const so = require('../../includes/storeObject'); +const crypt = require('../../libs/crypto'); + +router + .get('/', (req, res, n) => { + // res.db = new mysql(); + // res.db.user = config.db.user; + // res.db.password = config.db.pass; + // res.db.host = config.db.host; + // res.db.port = config.db.port; + // res.db.database = config.db.db1; + // res.db.connect(); + + res.send({ name: 'WebIO IPCam API' }); + }) + .all('*', rt.send); + +module.exports = router; \ No newline at end of file diff --git a/src/components/AdminPage/IPCam/index.js b/src/components/AdminPage/IPCam/index.js new file mode 100644 index 0000000..3ac834d --- /dev/null +++ b/src/components/AdminPage/IPCam/index.js @@ -0,0 +1,14 @@ +import React from 'react'; +import {} from 'semantic-ui-react'; + +class IPCamPage extends React.Component{ + + render(){ + + return ( + null + ) + } +} + +export default IPCamPage; \ No newline at end of file diff --git a/src/containers/AdminPage/IPCam.js b/src/containers/AdminPage/IPCam.js new file mode 100644 index 0000000..154327f --- /dev/null +++ b/src/containers/AdminPage/IPCam.js @@ -0,0 +1,18 @@ +import {connect} from 'react-redux'; +import {add_dialog_msg, toggle_loading} from '../../actions'; +import IPCamPage from '../../components/AdminPage/IPCam'; + +const mapStateToProps = (state) => ({ + i18n: state.i18n +}); + +const mapDispatchToProps = (dispatch, ownProps) => ({ + showDialog: (msg) => { + dispatch(add_dialog_msg(msg)); + }, + toggleLoading: (flag = false) => { + dispatch(toggle_loading(flag)); + } +}) + +export default connect(mapStateToProps, mapDispatchToProps)(IPCamPage); \ No newline at end of file