diff --git a/src/components/AdminPage/SystemInfo/TimezoneForm.js b/src/components/AdminPage/SystemInfo/TimezoneForm.js new file mode 100644 index 0000000..452d27e --- /dev/null +++ b/src/components/AdminPage/SystemInfo/TimezoneForm.js @@ -0,0 +1,45 @@ +import React from 'react'; +import {} from 'semantic-ui-react'; +import {getRequest} from '../../../actions'; + +class TimezoneForm extends React.Component { + state = { + zone: [], + zoneset: '' + } + + componentDidMount(){ + this.getZones(); + this.getZoneSet(); + } + + getZones = () => { + fetch('/api/system/gettimezonelist', getRequest()) + .then(response=>response.json()) + .then(json => { + if(json.status != 1) return this.props.showDialog(json.message); + this.setState({ + zone: json.data.record || [] + }) + }) + } + + getZoneSet = () => { + fetch('/api/system/gettimezoneset', getRequest()) + .then(response=>response.json()) + .then(json => { + if(json.status != 1) return this.props.showDialog(json.message); + this.setState({ + zoneset: json.data.record[0].value || '' + }) + }) + } + + render(){ + return ( + null + ) + } +} + +export default TimezoneForm; \ No newline at end of file