mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-19 00:46:37 +08:00
refactor: 运营设置-数据刷新
This commit is contained in:
parent
b283365ebc
commit
98c347e048
@ -1,5 +1,4 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Divider, Form, Grid, Header } from 'semantic-ui-react';
|
|
||||||
import { Card, Spin } from '@douyinfe/semi-ui';
|
import { Card, Spin } from '@douyinfe/semi-ui';
|
||||||
import SettingsGeneral from '../pages/Setting/Operation/SettingsGeneral.js';
|
import SettingsGeneral from '../pages/Setting/Operation/SettingsGeneral.js';
|
||||||
import SettingsDrawing from '../pages/Setting/Operation/SettingsDrawing.js';
|
import SettingsDrawing from '../pages/Setting/Operation/SettingsDrawing.js';
|
||||||
@ -10,13 +9,7 @@ import SettingsMonitoring from '../pages/Setting/Operation/SettingsMonitoring.js
|
|||||||
import SettingsCreditLimit from '../pages/Setting/Operation/SettingsCreditLimit.js';
|
import SettingsCreditLimit from '../pages/Setting/Operation/SettingsCreditLimit.js';
|
||||||
import SettingsMagnification from '../pages/Setting/Operation/SettingsMagnification.js';
|
import SettingsMagnification from '../pages/Setting/Operation/SettingsMagnification.js';
|
||||||
|
|
||||||
import {
|
import { API, showError, showSuccess } from '../helpers';
|
||||||
API,
|
|
||||||
showError,
|
|
||||||
showSuccess,
|
|
||||||
timestamp2string,
|
|
||||||
verifyJSON,
|
|
||||||
} from '../helpers';
|
|
||||||
|
|
||||||
const OperationSetting = () => {
|
const OperationSetting = () => {
|
||||||
let [inputs, setInputs] = useState({
|
let [inputs, setInputs] = useState({
|
||||||
@ -101,7 +94,7 @@ const OperationSetting = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getOptions();
|
onRefresh();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -109,35 +102,35 @@ const OperationSetting = () => {
|
|||||||
<Spin spinning={loading} size='large'>
|
<Spin spinning={loading} size='large'>
|
||||||
{/* 通用设置 */}
|
{/* 通用设置 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsGeneral options={inputs} />
|
<SettingsGeneral options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
{/* 绘图设置 */}
|
{/* 绘图设置 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsDrawing options={inputs} />
|
<SettingsDrawing options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
{/* 屏蔽词过滤设置 */}
|
{/* 屏蔽词过滤设置 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsSensitiveWords options={inputs} />
|
<SettingsSensitiveWords options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
{/* 日志设置 */}
|
{/* 日志设置 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsLog options={inputs} />
|
<SettingsLog options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
{/* 数据看板 */}
|
{/* 数据看板 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsDataDashboard options={inputs} />
|
<SettingsDataDashboard options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
{/* 监控设置 */}
|
{/* 监控设置 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsMonitoring options={inputs} />
|
<SettingsMonitoring options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
{/* 额度设置 */}
|
{/* 额度设置 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsCreditLimit options={inputs} />
|
<SettingsCreditLimit options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
{/* 倍率设置 */}
|
{/* 倍率设置 */}
|
||||||
<Card style={{ marginTop: '10px' }}>
|
<Card style={{ marginTop: '10px' }}>
|
||||||
<SettingsMagnification options={inputs} />
|
<SettingsMagnification options={inputs} refresh={onRefresh} />
|
||||||
</Card>
|
</Card>
|
||||||
</Spin>
|
</Spin>
|
||||||
</>
|
</>
|
||||||
|
@ -49,7 +49,7 @@ export default function SettingsCreditLimit(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ export default function DataDashboard(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ export default function SettingsDrawing(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export default function GeneralSettings(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,9 +16,6 @@ export default function SettingsLog(props) {
|
|||||||
LogConsumeEnabled: false,
|
LogConsumeEnabled: false,
|
||||||
historyTimestamp: dayjs().subtract(1, 'month').toDate(),
|
historyTimestamp: dayjs().subtract(1, 'month').toDate(),
|
||||||
});
|
});
|
||||||
// const [historyTimestamp, setHistoryTimestamp] = useState(
|
|
||||||
// dayjs().subtract(1, 'month').toDate(),
|
|
||||||
// );
|
|
||||||
const refForm = useRef();
|
const refForm = useRef();
|
||||||
const [inputsRow, setInputsRow] = useState(inputs);
|
const [inputsRow, setInputsRow] = useState(inputs);
|
||||||
|
|
||||||
@ -55,7 +52,7 @@ export default function SettingsLog(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
async function onCleanHistoryLog() {
|
async function onCleanHistoryLog() {
|
||||||
|
@ -52,7 +52,7 @@ export default function SettingsMagnification(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showError('请检查输入');
|
showError('请检查输入');
|
||||||
|
@ -49,7 +49,7 @@ export default function SettingsMonitoring(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ export default function SettingsSensitiveWords(props) {
|
|||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setInputsRow(structuredClone(inputs));
|
props.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user