修复定时删除日志

This commit is contained in:
whyour
2022-02-19 17:36:49 +08:00
parent cf5f1b6f25
commit 7d6e1d3e3d
9 changed files with 146 additions and 96 deletions
+4 -2
View File
@@ -1,8 +1,10 @@
.container {
display: flex;
justify-content: center;
align-items: center;
padding: 50px 130px;
flex-wrap: wrap;
max-width: 800px;
margin: 20px auto;
.right {
display: flex;
justify-content: center;
+18 -10
View File
@@ -12,6 +12,7 @@ import {
Modal,
message,
Typography,
Input,
} from 'antd';
import config from '@/utils/config';
import { PageContainer } from '@ant-design/pro-layout';
@@ -273,8 +274,10 @@ const Setting = ({
request
.get(`${config.apiPrefix}system/log/remove`)
.then((data: any) => {
setLogRemoveFrequency(data.data.frequency);
form.setFieldsValue({ frequency: data.data.frequency });
if (data.data.info) {
const { frequency } = data.data.info;
setLogRemoveFrequency(frequency);
}
})
.catch((error: any) => {
console.log(error);
@@ -367,14 +370,19 @@ const Setting = ({
name="frequency"
tooltip="每x天自动删除x天以前的日志"
>
<InputNumber
addonBefore="每"
addonAfter=""
style={{ width: 150 }}
min={0}
onBlur={updateRemoveLogFrequency}
onChange={(value) => setLogRemoveFrequency(value)}
/>
<Input.Group compact>
<InputNumber
addonBefore=""
addonAfter="天"
style={{ width: 150 }}
min={0}
value={logRemoveFrequency}
onChange={(value) => setLogRemoveFrequency(value)}
/>
<Button type="primary" onClick={updateRemoveLogFrequency}>
</Button>
</Input.Group>
</Form.Item>
<Form.Item label="检查更新" name="update">
<CheckUpdate socketMessage={socketMessage} />