系统设置增加时区设置

This commit is contained in:
whyour
2025-02-27 00:45:21 +08:00
parent 64fcbff715
commit af3e358a6a
10 changed files with 556 additions and 5 deletions
+10
View File
@@ -32,3 +32,13 @@
display: flex;
gap: 40px;
}
.ql-container-wrapper.ql-setting-container {
.ant-tabs-tabpane > div {
padding-left: 2px;
}
.ant-tabs-tabpane > .ant-form {
padding-left: 2px;
}
}
+31
View File
@@ -23,10 +23,12 @@ import Countdown from 'antd/lib/statistic/Countdown';
import useProgress from './progress';
import pick from 'lodash/pick';
import { disableBody } from '@/utils';
import { TIMEZONES } from '@/utils/const';
const dataMap = {
'log-remove-frequency': 'logRemoveFrequency',
'cron-concurrency': 'cronConcurrency',
timezone: 'timezone',
};
const Other = ({
@@ -37,6 +39,7 @@ const Other = ({
const [systemConfig, setSystemConfig] = useState<{
logRemoveFrequency?: number | null;
cronConcurrency?: number | null;
timezone?: string | null;
}>();
const [form] = Form.useForm();
const [exportLoading, setExportLoading] = useState(false);
@@ -252,6 +255,34 @@ const Other = ({
</Button>
</Input.Group>
</Form.Item>
<Form.Item label={intl.get('时区')} name="timezone">
<Input.Group compact>
<Select
value={systemConfig?.timezone}
style={{ width: 180 }}
onChange={(value) => {
setSystemConfig({ ...systemConfig, timezone: value });
}}
options={TIMEZONES.map((timezone) => ({
value: timezone,
label: timezone,
}))}
showSearch
filterOption={(input, option) =>
option?.value?.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
/>
<Button
type="primary"
onClick={() => {
updateSystemConfig('timezone');
}}
style={{ width: 84 }}
>
{intl.get('确认')}
</Button>
</Input.Group>
</Form.Item>
<Form.Item label={intl.get('语言')} name="lang">
<Select
defaultValue={localStorage.getItem('lang') || ''}