From 57a37b047f7b743b433057ea58232e565df936b2 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 5 Apr 2017 11:26:30 +0800 Subject: [PATCH] add timezone setting --- includes/language/zh.json | 2 + public/js/admin_bundle.js | 591 ++++++++++-------- public/js/index_bundle.js | 11 +- route/api/system.js | 21 + .../AdminPage/SystemInfo/TimezoneForm.js | 77 ++- 5 files changed, 438 insertions(+), 264 deletions(-) diff --git a/includes/language/zh.json b/includes/language/zh.json index eba0b00..af5afdc 100644 --- a/includes/language/zh.json +++ b/includes/language/zh.json @@ -57,6 +57,8 @@ "ERR0055": "Func Code 輸入錯誤", "ERR0056": "LeOne數量已達上限", "ERR0057": "連動資料輸入錯誤", + "ERR0058": "timezone輸入錯誤", + "ERR0059": "timezone設定失敗", "ERR7000": "命令執行失敗", diff --git a/public/js/admin_bundle.js b/public/js/admin_bundle.js index 96f7f81..43f51c8 100644 --- a/public/js/admin_bundle.js +++ b/public/js/admin_bundle.js @@ -63,7 +63,7 @@ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1137); +/******/ return __webpack_require__(__webpack_require__.s = 1138); /******/ }) /************************************************************************/ /******/ ([ @@ -2083,7 +2083,7 @@ function loadLocale(name) { module && module.exports) { try { oldLocale = globalLocale._abbr; - __webpack_require__(1113)("./" + name); + __webpack_require__(1114)("./" + name); // because defineLocale currently also sets the global locale, we // want to undo that for lazy loaded locales getSetGlobalLocale(oldLocale); @@ -19887,7 +19887,7 @@ var locationsAreEqual = exports.locationsAreEqual = function locationsAreEqual(a var assign = __webpack_require__(1016), moment = __webpack_require__(5), React = __webpack_require__(0), - CalendarContainer = __webpack_require__(1115) + CalendarContainer = __webpack_require__(1116) ; var TYPES = React.PropTypes; @@ -20608,21 +20608,21 @@ function _resetWarned() { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Router__ = __webpack_require__(1124); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Router__ = __webpack_require__(1125); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_0__Router__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Link__ = __webpack_require__(1017); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return __WEBPACK_IMPORTED_MODULE_1__Link__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__IndexLink__ = __webpack_require__(1120); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__IndexLink__ = __webpack_require__(1121); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "IndexLink", function() { return __WEBPACK_IMPORTED_MODULE_2__IndexLink__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__withRouter__ = __webpack_require__(1135); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__withRouter__ = __webpack_require__(1136); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_3__withRouter__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__IndexRedirect__ = __webpack_require__(1121); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__IndexRedirect__ = __webpack_require__(1122); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "IndexRedirect", function() { return __WEBPACK_IMPORTED_MODULE_4__IndexRedirect__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__IndexRoute__ = __webpack_require__(1122); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__IndexRoute__ = __webpack_require__(1123); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "IndexRoute", function() { return __WEBPACK_IMPORTED_MODULE_5__IndexRoute__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__Redirect__ = __webpack_require__(1019); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_6__Redirect__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(1123); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__Route__ = __webpack_require__(1124); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_7__Route__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__RouteUtils__ = __webpack_require__(149); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createRoutes", function() { return __WEBPACK_IMPORTED_MODULE_8__RouteUtils__["a"]; }); @@ -20631,17 +20631,17 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__PropTypes__ = __webpack_require__(814); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "locationShape", function() { return __WEBPACK_IMPORTED_MODULE_10__PropTypes__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "routerShape", function() { return __WEBPACK_IMPORTED_MODULE_10__PropTypes__["b"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__match__ = __webpack_require__(1133); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__match__ = __webpack_require__(1134); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "match", function() { return __WEBPACK_IMPORTED_MODULE_11__match__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__useRouterHistory__ = __webpack_require__(1024); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "useRouterHistory", function() { return __WEBPACK_IMPORTED_MODULE_12__useRouterHistory__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__PatternUtils__ = __webpack_require__(246); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "formatPattern", function() { return __WEBPACK_IMPORTED_MODULE_13__PatternUtils__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__applyRouterMiddleware__ = __webpack_require__(1126); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__applyRouterMiddleware__ = __webpack_require__(1127); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyRouterMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_14__applyRouterMiddleware__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__browserHistory__ = __webpack_require__(1127); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__browserHistory__ = __webpack_require__(1128); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "browserHistory", function() { return __WEBPACK_IMPORTED_MODULE_15__browserHistory__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__hashHistory__ = __webpack_require__(1131); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__hashHistory__ = __webpack_require__(1132); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "hashHistory", function() { return __WEBPACK_IMPORTED_MODULE_16__hashHistory__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__createMemoryHistory__ = __webpack_require__(1021); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createMemoryHistory", function() { return __WEBPACK_IMPORTED_MODULE_17__createMemoryHistory__["a"]; }); @@ -37208,7 +37208,7 @@ var canUseDOM = exports.canUseDOM = !!(typeof window !== 'undefined' && window.d exports.__esModule = true; -var _AsyncUtils = __webpack_require__(1107); +var _AsyncUtils = __webpack_require__(1108); var _PathUtils = __webpack_require__(148); @@ -56500,7 +56500,7 @@ var locationShape = shape({ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_invariant__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getRouteParams__ = __webpack_require__(1130); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__getRouteParams__ = __webpack_require__(1131); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__ContextUtils__ = __webpack_require__(813); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__RouteUtils__ = __webpack_require__(149); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -68958,7 +68958,7 @@ exports.__esModule = true; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; -var _queryString = __webpack_require__(1114); +var _queryString = __webpack_require__(1115); var _runTransitionHook = __webpack_require__(539); @@ -79766,7 +79766,7 @@ function assignRouterState(router, _ref) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_history_lib_useQueries___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_history_lib_useQueries__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_history_lib_useBasename__ = __webpack_require__(906); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_history_lib_useBasename___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_history_lib_useBasename__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_lib_createMemoryHistory__ = __webpack_require__(1112); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_lib_createMemoryHistory__ = __webpack_require__(1113); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_history_lib_createMemoryHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_history_lib_createMemoryHistory__); /* harmony export (immutable) */ __webpack_exports__["a"] = createMemoryHistory; @@ -79807,11 +79807,11 @@ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.do "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__routerWarning__ = __webpack_require__(247); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__computeChangedRoutes__ = __webpack_require__(1128); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__TransitionUtils__ = __webpack_require__(1125); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isActive__ = __webpack_require__(1132); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__getComponents__ = __webpack_require__(1129); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__matchRoutes__ = __webpack_require__(1134); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__computeChangedRoutes__ = __webpack_require__(1129); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__TransitionUtils__ = __webpack_require__(1126); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__isActive__ = __webpack_require__(1133); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__getComponents__ = __webpack_require__(1130); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__matchRoutes__ = __webpack_require__(1135); /* harmony export (immutable) */ __webpack_exports__["a"] = createTransitionManager; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -80103,67 +80103,67 @@ var _react2 = _interopRequireDefault(_react); var _reactRouter = __webpack_require__(248); -var _AdminPage = __webpack_require__(1104); +var _AdminPage = __webpack_require__(1105); var _AdminPage2 = _interopRequireDefault(_AdminPage); -var _SystemInfo = __webpack_require__(1100); +var _SystemInfo = __webpack_require__(1101); var _SystemInfo2 = _interopRequireDefault(_SystemInfo); -var _UserList = __webpack_require__(1101); +var _UserList = __webpack_require__(1102); var _UserList2 = _interopRequireDefault(_UserList); -var _DIO = __webpack_require__(1090); +var _DIO = __webpack_require__(1091); var _DIO2 = _interopRequireDefault(_DIO); -var _Log = __webpack_require__(1095); +var _Log = __webpack_require__(1096); var _Log2 = _interopRequireDefault(_Log); -var _LeOne = __webpack_require__(1094); +var _LeOne = __webpack_require__(1095); var _LeOne2 = _interopRequireDefault(_LeOne); -var _IOGroup = __webpack_require__(1092); +var _IOGroup = __webpack_require__(1093); var _IOGroup2 = _interopRequireDefault(_IOGroup); -var _IOCmd = __webpack_require__(1091); +var _IOCmd = __webpack_require__(1092); var _IOCmd2 = _interopRequireDefault(_IOCmd); -var _Schedule = __webpack_require__(1099); +var _Schedule = __webpack_require__(1100); var _Schedule2 = _interopRequireDefault(_Schedule); -var _Modbus = __webpack_require__(1096); +var _Modbus = __webpack_require__(1097); var _Modbus2 = _interopRequireDefault(_Modbus); -var _ModbusCmd = __webpack_require__(1097); +var _ModbusCmd = __webpack_require__(1098); var _ModbusCmd2 = _interopRequireDefault(_ModbusCmd); -var _ModbusLog = __webpack_require__(1098); +var _ModbusLog = __webpack_require__(1099); var _ModbusLog2 = _interopRequireDefault(_ModbusLog); -var _ActionLink = __webpack_require__(1088); +var _ActionLink = __webpack_require__(1089); var _ActionLink2 = _interopRequireDefault(_ActionLink); -var _ActionLinkAdd = __webpack_require__(1089); +var _ActionLinkAdd = __webpack_require__(1090); var _ActionLinkAdd2 = _interopRequireDefault(_ActionLinkAdd); -var _IPCam = __webpack_require__(1093); +var _IPCam = __webpack_require__(1094); var _IPCam2 = _interopRequireDefault(_IPCam); -var _Wristband = __webpack_require__(1103); +var _Wristband = __webpack_require__(1104); var _Wristband2 = _interopRequireDefault(_Wristband); @@ -87153,6 +87153,191 @@ exports.default = TimeForm; "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _semanticUiReact = __webpack_require__(8); + +var _actions = __webpack_require__(22); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TimezoneForm = function (_React$Component) { + _inherits(TimezoneForm, _React$Component); + + function TimezoneForm() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, TimezoneForm); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TimezoneForm.__proto__ || Object.getPrototypeOf(TimezoneForm)).call.apply(_ref, [this].concat(args))), _this), _this.state = { + zones: [], + zone: '', + loc: '', + selZone: null, + selLoc: null + }, _this.getZones = function () { + fetch('/api/system/gettimezonelist', (0, _actions.getRequest)()).then(function (response) { + return response.json(); + }).then(function (json) { + if (json.status != 1) return _this.props.showDialog(json.message); + _this.setState({ + zones: json.data.record || [] + }); + }); + }, _this.getZoneSet = function () { + fetch('/api/system/gettimezoneset', (0, _actions.getRequest)()).then(function (response) { + return response.json(); + }).then(function (json) { + if (json.status != 1) return _this.props.showDialog(json.message); + var tz = (json.data.record[0].value || '').split('/'); + _this.setState({ + zone: tz[0] || '', + loc: tz[1] || '' + }); + }); + }, _this.zonesChange = function (data) { + _this.setState({ + selZone: data == '' ? null : data + }); + }, _this.handleSubmit = function () { + if (_this.state.selZone == null || _this.state.selLoc == null) return _this.props.showDialog('請選擇區域與城市'); + var zone = _this.state.zones[_this.state.selZone].name; + var loc = _this.state.zones[_this.state.selZone].location[_this.state.selLoc]; + + fetch('/api/system/settimezone', (0, _actions.getRequest)({ timezone: zone + '/' + loc })).then(function (response) { + return response.json(); + }).then(function (json) { + if (json.status != 1) return _this.props.showDialog(json.message); + _this.setState({ + selZone: null, + selLoc: null + }, function () { + _this.getZoneSet(); + }); + }); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + _createClass(TimezoneForm, [{ + key: 'componentDidMount', + value: function componentDidMount() { + this.getZones(); + this.getZoneSet(); + } + }, { + key: 'render', + value: function render() { + var _this2 = this; + + return _react2.default.createElement( + _semanticUiReact.Form, + { onSubmit: function onSubmit(e, d) { + e.preventDefault(); + _this2.handleSubmit(); + }, serializer: function serializer(e) { + return {}; + } }, + _react2.default.createElement( + _semanticUiReact.Form.Field, + { inline: true }, + _react2.default.createElement( + 'label', + null, + '\u7CFB\u7D71Timezone' + ), + _react2.default.createElement(_semanticUiReact.Label, { content: '' + this.state.zone + (this.state.zone.length > 0 ? '/' : '') + this.state.loc, basic: true }) + ), + _react2.default.createElement( + _semanticUiReact.Form.Group, + { inline: true }, + _react2.default.createElement( + _semanticUiReact.Form.Field, + null, + _react2.default.createElement( + 'label', + null, + '\u8A2D\u5B9ATimezone' + ), + _react2.default.createElement( + 'select', + { value: this.state.selZone == null ? '' : this.state.selZone, onChange: function onChange(e) { + _this2.zonesChange(e.target.value); + } }, + _react2.default.createElement( + 'option', + { value: '' }, + '\u9078\u64C7\u5340\u57DF' + ), + this.state.zones.map(function (t, idx) { + return _react2.default.createElement( + 'option', + { key: idx, value: idx }, + t.name + ); + }) + ) + ), + this.state.selZone == null ? null : _react2.default.createElement( + _semanticUiReact.Form.Field, + null, + _react2.default.createElement( + 'select', + { value: this.state.selLoc == null ? '' : this.state.selLoc, + onChange: function onChange(e) { + _this2.setState({ selLoc: e.target.value == '' ? null : e.target.value }); + } }, + _react2.default.createElement( + 'option', + { value: '' }, + '\u9078\u64C7\u57CE\u5E02' + ), + this.state.zones[this.state.selZone].location.map(function (t, idx) { + return _react2.default.createElement( + 'option', + { key: idx, value: idx }, + t + ); + }) + ) + ) + ), + _react2.default.createElement(_semanticUiReact.Button, { type: 'submit', fluid: true, content: '\u66F4\u65B0Timezone' }) + ); + } + }]); + + return TimezoneForm; +}(_react2.default.Component); + +exports.default = TimezoneForm; + +/***/ }), +/* 1077 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); @@ -87179,7 +87364,7 @@ var _TimeForm = __webpack_require__(1075); var _TimeForm2 = _interopRequireDefault(_TimeForm); -var _TimezoneForm = __webpack_require__(1139); +var _TimezoneForm = __webpack_require__(1076); var _TimezoneForm2 = _interopRequireDefault(_TimezoneForm); @@ -87286,7 +87471,7 @@ var SysInfo = function (_React$Component) { exports.default = SysInfo; /***/ }), -/* 1077 */ +/* 1078 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87344,7 +87529,7 @@ var ListItem = function ListItem(_ref) { exports.default = ListItem; /***/ }), -/* 1078 */ +/* 1079 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87437,7 +87622,7 @@ var UModal = function UModal(_ref) { exports.default = UModal; /***/ }), -/* 1079 */ +/* 1080 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87455,13 +87640,13 @@ var _react2 = _interopRequireDefault(_react); var _semanticUiReact = __webpack_require__(8); -var _ListItem = __webpack_require__(1077); +var _ListItem = __webpack_require__(1078); var _ListItem2 = _interopRequireDefault(_ListItem); var _actions = __webpack_require__(22); -var _UserModal = __webpack_require__(1078); +var _UserModal = __webpack_require__(1079); var _UserModal2 = _interopRequireDefault(_UserModal); @@ -87598,7 +87783,7 @@ var UList = function (_React$Component) { exports.default = UList; /***/ }), -/* 1080 */ +/* 1081 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87677,7 +87862,7 @@ var ListItem = function ListItem(_ref) { exports.default = ListItem; /***/ }), -/* 1081 */ +/* 1082 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87697,7 +87882,7 @@ var _semanticUiReact = __webpack_require__(8); var _actions = __webpack_require__(22); -var _ListItem = __webpack_require__(1080); +var _ListItem = __webpack_require__(1081); var _ListItem2 = _interopRequireDefault(_ListItem); @@ -87861,7 +88046,7 @@ var LocStatus = function (_React$Component) { exports.default = LocStatus; /***/ }), -/* 1082 */ +/* 1083 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -87879,7 +88064,7 @@ var _react2 = _interopRequireDefault(_react); var _semanticUiReact = __webpack_require__(8); -var _LocStatus = __webpack_require__(1102); +var _LocStatus = __webpack_require__(1103); var _LocStatus2 = _interopRequireDefault(_LocStatus); @@ -87976,7 +88161,7 @@ var WristbandPage = function (_React$Component) { exports.default = WristbandPage; /***/ }), -/* 1083 */ +/* 1084 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88026,7 +88211,7 @@ var AlertItem = function AlertItem(_ref) { exports.default = AlertItem; /***/ }), -/* 1084 */ +/* 1085 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88048,7 +88233,7 @@ var _actions = __webpack_require__(22); var _tools = __webpack_require__(147); -var _AlertItem = __webpack_require__(1083); +var _AlertItem = __webpack_require__(1084); var _AlertItem2 = _interopRequireDefault(_AlertItem); @@ -88202,8 +88387,8 @@ var DashBoardUnit = function (_React$Component) { exports.default = DashBoardUnit; /***/ }), -/* 1085 */, -/* 1086 */ +/* 1086 */, +/* 1087 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88238,7 +88423,7 @@ var MItem = function MItem(_ref) { exports.default = MItem; /***/ }), -/* 1087 */ +/* 1088 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88256,7 +88441,7 @@ var _semanticUiReact = __webpack_require__(8); var _reactRouter = __webpack_require__(248); -var _Item = __webpack_require__(1086); +var _Item = __webpack_require__(1087); var _Item2 = _interopRequireDefault(_Item); @@ -88367,7 +88552,7 @@ var MainMenu = function MainMenu(_ref) { exports.default = MainMenu; /***/ }), -/* 1088 */ +/* 1089 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88425,7 +88610,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_ActionLink2.default); /***/ }), -/* 1089 */ +/* 1090 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88467,7 +88652,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_ActionLinkAdd2.default); /***/ }), -/* 1090 */ +/* 1091 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88520,7 +88705,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_DIO2.default); /***/ }), -/* 1091 */ +/* 1092 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88578,7 +88763,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_IOCmd2.default); /***/ }), -/* 1092 */ +/* 1093 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88651,7 +88836,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_IOGroup2.default); /***/ }), -/* 1093 */ +/* 1094 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88693,7 +88878,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_IPCam2.default); /***/ }), -/* 1094 */ +/* 1095 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88765,7 +88950,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_LeOne2.default); /***/ }), -/* 1095 */ +/* 1096 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88809,7 +88994,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Log2.default); /***/ }), -/* 1096 */ +/* 1097 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88886,7 +89071,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Modbus2.default); /***/ }), -/* 1097 */ +/* 1098 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88928,7 +89113,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_ModbusCmd2.default); /***/ }), -/* 1098 */ +/* 1099 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -88981,7 +89166,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_ModbusLog2.default); /***/ }), -/* 1099 */ +/* 1100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89057,39 +89242,6 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Schedule2.default); -/***/ }), -/* 1100 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _reactRedux = __webpack_require__(25); - -var _SystemInfo = __webpack_require__(1076); - -var _SystemInfo2 = _interopRequireDefault(_SystemInfo); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var mapStateToProps = function mapStateToProps(state) { - return { - i18n: state.i18n, - network: 'network' in state.sysinfo ? state.sysinfo.network : {}, - time: 'time' in state.sysinfo ? state.sysinfo.time : 0 - }; -}; - -exports.default = (0, _reactRedux.connect)(mapStateToProps)(_SystemInfo2.default); - /***/ }), /* 1101 */ /***/ (function(module, exports, __webpack_require__) { @@ -89107,7 +89259,40 @@ var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(25); -var _UserList = __webpack_require__(1079); +var _SystemInfo = __webpack_require__(1077); + +var _SystemInfo2 = _interopRequireDefault(_SystemInfo); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var mapStateToProps = function mapStateToProps(state) { + return { + i18n: state.i18n, + network: 'network' in state.sysinfo ? state.sysinfo.network : {}, + time: 'time' in state.sysinfo ? state.sysinfo.time : 0 + }; +}; + +exports.default = (0, _reactRedux.connect)(mapStateToProps)(_SystemInfo2.default); + +/***/ }), +/* 1102 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _react = __webpack_require__(0); + +var _react2 = _interopRequireDefault(_react); + +var _reactRedux = __webpack_require__(25); + +var _UserList = __webpack_require__(1080); var _UserList2 = _interopRequireDefault(_UserList); @@ -89148,7 +89333,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_UserList2.default); /***/ }), -/* 1102 */ +/* 1103 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89162,7 +89347,7 @@ var _reactRedux = __webpack_require__(25); var _actions = __webpack_require__(22); -var _LocStatus = __webpack_require__(1081); +var _LocStatus = __webpack_require__(1082); var _LocStatus2 = _interopRequireDefault(_LocStatus); @@ -89190,7 +89375,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_LocStatus2.default); /***/ }), -/* 1103 */ +/* 1104 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89204,7 +89389,7 @@ var _reactRedux = __webpack_require__(25); var _actions = __webpack_require__(22); -var _Wristband = __webpack_require__(1082); +var _Wristband = __webpack_require__(1083); var _Wristband2 = _interopRequireDefault(_Wristband); @@ -89232,7 +89417,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_Wristband2.default); /***/ }), -/* 1104 */ +/* 1105 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89254,7 +89439,7 @@ var _reactDatetime = __webpack_require__(245); var _reactDatetime2 = _interopRequireDefault(_reactDatetime); -var _MenuControl = __webpack_require__(1106); +var _MenuControl = __webpack_require__(1107); var _MenuControl2 = _interopRequireDefault(_MenuControl); @@ -89266,7 +89451,7 @@ var _DialogControl = __webpack_require__(460); var _DialogControl2 = _interopRequireDefault(_DialogControl); -var _DashBoard = __webpack_require__(1105); +var _DashBoard = __webpack_require__(1106); var _DashBoard2 = _interopRequireDefault(_DashBoard); @@ -89340,7 +89525,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AdmPage); /***/ }), -/* 1105 */ +/* 1106 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89354,7 +89539,7 @@ var _reactRedux = __webpack_require__(25); var _actions = __webpack_require__(22); -var _DashBoard = __webpack_require__(1084); +var _DashBoard = __webpack_require__(1085); var _DashBoard2 = _interopRequireDefault(_DashBoard); @@ -89385,7 +89570,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_DashBoard2.default); /***/ }), -/* 1106 */ +/* 1107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89397,7 +89582,7 @@ Object.defineProperty(exports, "__esModule", { var _reactRedux = __webpack_require__(25); -var _MainMenu = __webpack_require__(1087); +var _MainMenu = __webpack_require__(1088); var _MainMenu2 = _interopRequireDefault(_MainMenu); @@ -89437,7 +89622,7 @@ var mapDispatchToProps = function mapDispatchToProps(dispatch, ownProps) { exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_MainMenu2.default); /***/ }), -/* 1107 */ +/* 1108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89499,7 +89684,7 @@ var loopAsync = exports.loopAsync = function loopAsync(turns, work, callback) { }; /***/ }), -/* 1108 */ +/* 1109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89641,7 +89826,7 @@ var replaceLocation = exports.replaceLocation = function replaceLocation(locatio }; /***/ }), -/* 1109 */ +/* 1110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89684,7 +89869,7 @@ var replaceLocation = exports.replaceLocation = function replaceLocation(locatio }; /***/ }), -/* 1110 */ +/* 1111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89704,7 +89889,7 @@ var _BrowserProtocol = __webpack_require__(536); var BrowserProtocol = _interopRequireWildcard(_BrowserProtocol); -var _RefreshProtocol = __webpack_require__(1109); +var _RefreshProtocol = __webpack_require__(1110); var RefreshProtocol = _interopRequireWildcard(_RefreshProtocol); @@ -89783,7 +89968,7 @@ var createBrowserHistory = function createBrowserHistory() { exports.default = createBrowserHistory; /***/ }), -/* 1111 */ +/* 1112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -89805,7 +89990,7 @@ var _ExecutionEnvironment = __webpack_require__(537); var _DOMUtils = __webpack_require__(453); -var _HashProtocol = __webpack_require__(1108); +var _HashProtocol = __webpack_require__(1109); var HashProtocol = _interopRequireWildcard(_HashProtocol); @@ -89936,7 +90121,7 @@ var createHashHistory = function createHashHistory() { exports.default = createHashHistory; /***/ }), -/* 1112 */ +/* 1113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90082,7 +90267,7 @@ var createMemoryHistory = function createMemoryHistory() { exports.default = createMemoryHistory; /***/ }), -/* 1113 */ +/* 1114 */ /***/ (function(module, exports, __webpack_require__) { var map = { @@ -90317,16 +90502,16 @@ webpackContext.keys = function webpackContextKeys() { }; webpackContext.resolve = webpackContextResolve; module.exports = webpackContext; -webpackContext.id = 1113; +webpackContext.id = 1114; /***/ }), -/* 1114 */ +/* 1115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var strictUriEncode = __webpack_require__(1136); +var strictUriEncode = __webpack_require__(1137); var objectAssign = __webpack_require__(16); function encoderForArrayFormat(opts) { @@ -90531,14 +90716,14 @@ exports.stringify = function (obj, opts) { /***/ }), -/* 1115 */ +/* 1116 */ /***/ (function(module, exports, __webpack_require__) { var React = __webpack_require__(0), - DaysView = __webpack_require__(1116), - MonthsView = __webpack_require__(1117), - YearsView = __webpack_require__(1119), - TimeView = __webpack_require__(1118) + DaysView = __webpack_require__(1117), + MonthsView = __webpack_require__(1118), + YearsView = __webpack_require__(1120), + TimeView = __webpack_require__(1119) ; var CalendarContainer = React.createClass({ @@ -90558,7 +90743,7 @@ module.exports = CalendarContainer; /***/ }), -/* 1116 */ +/* 1117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90709,7 +90894,7 @@ module.exports = DateTimePickerDays; /***/ }), -/* 1117 */ +/* 1118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -90823,7 +91008,7 @@ module.exports = DateTimePickerMonths; /***/ }), -/* 1118 */ +/* 1119 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91058,7 +91243,7 @@ module.exports = DateTimePickerTime; /***/ }), -/* 1119 */ +/* 1120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -91170,7 +91355,7 @@ module.exports = DateTimePickerYears; /***/ }), -/* 1120 */ +/* 1121 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91195,7 +91380,7 @@ var IndexLink = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({ /* harmony default export */ __webpack_exports__["a"] = IndexLink; /***/ }), -/* 1121 */ +/* 1122 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91253,7 +91438,7 @@ var IndexRedirect = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({ /* harmony default export */ __webpack_exports__["a"] = IndexRedirect; /***/ }), -/* 1122 */ +/* 1123 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91310,7 +91495,7 @@ var IndexRoute = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({ /* harmony default export */ __webpack_exports__["a"] = IndexRoute; /***/ }), -/* 1123 */ +/* 1124 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91366,7 +91551,7 @@ var Route = __WEBPACK_IMPORTED_MODULE_0_react___default.a.createClass({ /* harmony default export */ __webpack_exports__["a"] = Route; /***/ }), -/* 1124 */ +/* 1125 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91534,7 +91719,7 @@ var Router = __WEBPACK_IMPORTED_MODULE_1_react___default.a.createClass({ /* harmony default export */ __webpack_exports__["a"] = Router; /***/ }), -/* 1125 */ +/* 1126 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91692,7 +91877,7 @@ function runLeaveHooks(routes, prevState) { } /***/ }), -/* 1126 */ +/* 1127 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91743,11 +91928,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument }; /***/ }), -/* 1127 */ +/* 1128 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_history_lib_createBrowserHistory__ = __webpack_require__(1110); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_history_lib_createBrowserHistory__ = __webpack_require__(1111); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_history_lib_createBrowserHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_history_lib_createBrowserHistory__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createRouterHistory__ = __webpack_require__(1022); @@ -91755,7 +91940,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument /* harmony default export */ __webpack_exports__["a"] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__createRouterHistory__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_0_history_lib_createBrowserHistory___default.a); /***/ }), -/* 1128 */ +/* 1129 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91834,7 +92019,7 @@ function computeChangedRoutes(prevState, nextState) { /* harmony default export */ __webpack_exports__["a"] = computeChangedRoutes; /***/ }), -/* 1129 */ +/* 1130 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91876,7 +92061,7 @@ function getComponents(nextState, callback) { /* harmony default export */ __webpack_exports__["a"] = getComponents; /***/ }), -/* 1130 */ +/* 1131 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -91904,11 +92089,11 @@ function getRouteParams(route, params) { /* harmony default export */ __webpack_exports__["a"] = getRouteParams; /***/ }), -/* 1131 */ +/* 1132 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_history_lib_createHashHistory__ = __webpack_require__(1111); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_history_lib_createHashHistory__ = __webpack_require__(1112); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_history_lib_createHashHistory___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_history_lib_createHashHistory__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__createRouterHistory__ = __webpack_require__(1022); @@ -91916,7 +92101,7 @@ function getRouteParams(route, params) { /* harmony default export */ __webpack_exports__["a"] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__createRouterHistory__["a" /* default */])(__WEBPACK_IMPORTED_MODULE_0_history_lib_createHashHistory___default.a); /***/ }), -/* 1132 */ +/* 1133 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -92069,7 +92254,7 @@ function isActive(_ref, indexOnly, currentLocation, routes, params) { } /***/ }), -/* 1133 */ +/* 1134 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -92138,7 +92323,7 @@ function match(_ref, callback) { /* harmony default export */ __webpack_exports__["a"] = match; /***/ }), -/* 1134 */ +/* 1135 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -92398,7 +92583,7 @@ function matchRoutes(routes, location, callback, remainingPathname) { } /***/ }), -/* 1135 */ +/* 1136 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -92470,7 +92655,7 @@ function withRouter(WrappedComponent, options) { } /***/ }), -/* 1136 */ +/* 1137 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -92483,7 +92668,7 @@ module.exports = function (str) { /***/ }), -/* 1137 */ +/* 1138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -92597,103 +92782,5 @@ var PageRoot = function (_React$Component) { _reactDom2.default.render(_react2.default.createElement(PageRoot, null), document.getElementById('app')); -/***/ }), -/* 1138 */, -/* 1139 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = __webpack_require__(0); - -var _react2 = _interopRequireDefault(_react); - -var _semanticUiReact = __webpack_require__(8); - -var _actions = __webpack_require__(22); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var TimezoneForm = function (_React$Component) { - _inherits(TimezoneForm, _React$Component); - - function TimezoneForm() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, TimezoneForm); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TimezoneForm.__proto__ || Object.getPrototypeOf(TimezoneForm)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - zones: [], - zone: '', - loc: '' - }, _this.getZones = function () { - fetch('/api/system/gettimezonelist', (0, _actions.getRequest)()).then(function (response) { - return response.json(); - }).then(function (json) { - if (json.status != 1) return _this.props.showDialog(json.message); - _this.setState({ - zones: json.data.record || [] - }); - }); - }, _this.getZoneSet = function () { - fetch('/api/system/gettimezoneset', (0, _actions.getRequest)()).then(function (response) { - return response.json(); - }).then(function (json) { - if (json.status != 1) return _this.props.showDialog(json.message); - var tz = (json.data.record[0].value || '').split('/'); - _this.setState({ - zone: tz[0] || '', - loc: tz[1] || '' - }); - }); - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(TimezoneForm, [{ - key: 'componentDidMount', - value: function componentDidMount() { - this.getZones(); - this.getZoneSet(); - } - }, { - key: 'render', - value: function render() { - return _react2.default.createElement( - _semanticUiReact.Form, - null, - _react2.default.createElement( - _semanticUiReact.Form.Field, - null, - _react2.default.createElement(_semanticUiReact.Input, { label: '\u7CFB\u7D71Timezone', - value: '' + this.state.zone + (this.state.zone.length > 0 ? '/' : '') + this.state.loc }) - ) - ); - } - }]); - - return TimezoneForm; -}(_react2.default.Component); - -exports.default = TimezoneForm; - /***/ }) /******/ ]); \ No newline at end of file diff --git a/public/js/index_bundle.js b/public/js/index_bundle.js index a77b4de..03cb988 100644 --- a/public/js/index_bundle.js +++ b/public/js/index_bundle.js @@ -63,7 +63,7 @@ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1138); +/******/ return __webpack_require__(__webpack_require__.s = 1139); /******/ }) /************************************************************************/ /******/ ([ @@ -62129,7 +62129,7 @@ var _i18next2 = _interopRequireDefault(_i18next); var _semanticUiReact = __webpack_require__(8); -var _Form = __webpack_require__(1085); +var _Form = __webpack_require__(1086); var _Form2 = _interopRequireDefault(_Form); @@ -62321,7 +62321,8 @@ exports.default = (0, _reactRedux.connect)()(Root); /* 1082 */, /* 1083 */, /* 1084 */, -/* 1085 */ +/* 1085 */, +/* 1086 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -62377,7 +62378,6 @@ var loginForm = function loginForm(_ref) { exports.default = loginForm; /***/ }), -/* 1086 */, /* 1087 */, /* 1088 */, /* 1089 */, @@ -62429,7 +62429,8 @@ exports.default = loginForm; /* 1135 */, /* 1136 */, /* 1137 */, -/* 1138 */ +/* 1138 */, +/* 1139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; diff --git a/route/api/system.js b/route/api/system.js index 42f9611..1aa902e 100644 --- a/route/api/system.js +++ b/route/api/system.js @@ -461,6 +461,27 @@ router return n(); }); }) + .post('/settimezone', (req,res,n) => { + if(!tool.checkPermission(req)) return n('ERR9000'); + let arr = req.body; + if(!arr.data) return n('ERR0000'); + if(!arr.data.timezone) return n('ERR0058'); + + let cmd = `timedatectl set-timezone ${arr.data.timezone}`; + exec(cmd, (err, stdout, stderr) => { + if(err) return rt.err(res,err, n, 'ERR0059'); + + let query = "update ??.?? set `value` = ? where `type` = ?"; + let param = [config.db.db1, 'system', arr.data.timezone, 'timezone']; + res.db.query(query, param, (err, row) => { + if(err ) return rt.err(res, err, n, 'ERR8002'); + res.api_res = { + record: [] + } + n(); + }) + }) + }) .all('*', rt.send); module.exports = router; \ No newline at end of file diff --git a/src/components/AdminPage/SystemInfo/TimezoneForm.js b/src/components/AdminPage/SystemInfo/TimezoneForm.js index 58d5590..30a363b 100644 --- a/src/components/AdminPage/SystemInfo/TimezoneForm.js +++ b/src/components/AdminPage/SystemInfo/TimezoneForm.js @@ -1,12 +1,14 @@ import React from 'react'; -import {Form, Input, Button} from 'semantic-ui-react'; +import {Form, Input, Button, Label, Message} from 'semantic-ui-react'; import {getRequest} from '../../../actions'; class TimezoneForm extends React.Component { state = { zones: [], zone: '', - loc: '' + loc: '', + selZone: null, + selLoc: null } componentDidMount(){ @@ -38,14 +40,75 @@ class TimezoneForm extends React.Component { }) } + zonesChange = (data) => { + this.setState({ + selZone: data == '' ? null : data + }) + } + + handleSubmit = () => { + if(this.state.selZone == null || this.state.selLoc == null ) return this.props.showDialog('請選擇區域與城市'); + let zone = this.state.zones[this.state.selZone].name; + let loc = this.state.zones[this.state.selZone].location[this.state.selLoc]; + + fetch('/api/system/settimezone', getRequest({timezone: `${zone}/${loc}`})) + .then(response=>response.json()) + .then(json => { + if(json.status != 1) return this.props.showDialog(json.message); + this.setState({ + selZone: null, + selLoc: null + }, () => { + this.getZoneSet(); + }) + }) + } + render(){ return ( -
- - 0 ? '/' : ''}${this.state.loc}`} /> + { + e.preventDefault(); + this.handleSubmit(); + }} serializer={e=>{ + return {}; + }}> + + {/* 0 ? '/' : ''}${this.state.loc}`} + disabled />*/} + + - + + + + + + { + this.state.selZone == null ? null : + ( + + + + ) + } + +