diff --git a/public/js/admin_bundle.js b/public/js/admin_bundle.js index e6a0ba2..96f7f81 100644 --- a/public/js/admin_bundle.js +++ b/public/js/admin_bundle.js @@ -92615,7 +92615,7 @@ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); -__webpack_require__(8); +var _semanticUiReact = __webpack_require__(8); var _actions = __webpack_require__(22); @@ -92642,15 +92642,16 @@ var TimezoneForm = function (_React$Component) { } return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = TimezoneForm.__proto__ || Object.getPrototypeOf(TimezoneForm)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - zone: [], - zoneset: '' + 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({ - zone: json.data.record || [] + zones: json.data.record || [] }); }); }, _this.getZoneSet = function () { @@ -92658,8 +92659,10 @@ var TimezoneForm = function (_React$Component) { 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({ - zoneset: json.data.record[0].value || '' + zone: tz[0] || '', + loc: tz[1] || '' }); }); }, _temp), _possibleConstructorReturn(_this, _ret); @@ -92674,7 +92677,16 @@ var TimezoneForm = function (_React$Component) { }, { key: 'render', value: function render() { - return null; + 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 }) + ) + ); } }]); diff --git a/src/components/AdminPage/SystemInfo/TimezoneForm.js b/src/components/AdminPage/SystemInfo/TimezoneForm.js index 452d27e..58d5590 100644 --- a/src/components/AdminPage/SystemInfo/TimezoneForm.js +++ b/src/components/AdminPage/SystemInfo/TimezoneForm.js @@ -1,11 +1,12 @@ import React from 'react'; -import {} from 'semantic-ui-react'; +import {Form, Input, Button} from 'semantic-ui-react'; import {getRequest} from '../../../actions'; class TimezoneForm extends React.Component { state = { - zone: [], - zoneset: '' + zones: [], + zone: '', + loc: '' } componentDidMount(){ @@ -19,7 +20,7 @@ class TimezoneForm extends React.Component { .then(json => { if(json.status != 1) return this.props.showDialog(json.message); this.setState({ - zone: json.data.record || [] + zones: json.data.record || [] }) }) } @@ -29,15 +30,23 @@ class TimezoneForm extends React.Component { .then(response=>response.json()) .then(json => { if(json.status != 1) return this.props.showDialog(json.message); + let tz = (json.data.record[0].value || '').split('/'); this.setState({ - zoneset: json.data.record[0].value || '' - }) + zone: tz[0] || '', + loc: tz[1] || '' + }); }) } render(){ return ( - null +