MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / onCleanHistoryLog

Function onCleanHistoryLog

web/src/pages/Setting/Operation/SettingsLog.js:61–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59 });
60 }
61 async function onCleanHistoryLog() {
62 try {
63 setLoadingCleanHistoryLog(true);
64 if (!inputs.historyTimestamp) throw new Error(t('请选择日志记录时间'));
65 const res = await API.delete(
66 `/api/log/?target_timestamp=${Date.parse(inputs.historyTimestamp) / 1000}`,
67 );
68 const { success, message, data } = res.data;
69 if (success) {
70 showSuccess(`${data} ${t('条日志已清理!')}`);
71 return;
72 } else {
73 throw new Error(t('日志清理失败:') + message);
74 }
75 } catch (error) {
76 showError(error.message);
77 } finally {
78 setLoadingCleanHistoryLog(false);
79 }
80 }
81
82 useEffect(() => {
83 const currentInputs = {};

Callers

nothing calls this directly

Calls 3

showSuccessFunction · 0.90
showErrorFunction · 0.90
tFunction · 0.70

Tested by

no test coverage detected