fix(frontend): log refetch

This commit is contained in:
2025-12-12 20:31:35 +08:00
parent 51a482de7f
commit 982a9e5457

View File

@@ -27,12 +27,16 @@ const RequestLogs: Component = () => {
return logsApi.list(filters);
},
);
const [allLogs] = createResource(async () => {
const [allLogs, { refetch: refetchAllLogs }] = createResource(async () => {
return await logsApi.list();
});
const methods = createMemo(() => {
return allLogs.loading ? [] : [...new Set(allLogs()!.map((log) => log.method))];
});
const refetch = () => {
refetchLogs();
refetchAllLogs();
};
const handleLogClick = (log: RequestLogType) => {
setSelectedLog(log);
@@ -58,7 +62,7 @@ const RequestLogs: Component = () => {
</span>
</Show>
</h2>
<Button onClick={() => refetchLogs()} variant="secondary">
<Button onClick={() => refetch()} variant="secondary">
Refresh
</Button>
</div>