refactor: simplify log retrieval by removing level parameter and relying on server-side filtering #4293
This commit is contained in:
@@ -412,8 +412,8 @@ export async function gc() {
|
||||
return invoke<void>("clash_gc");
|
||||
}
|
||||
|
||||
export async function getClashLogs(level?: string) {
|
||||
return invoke<any>("get_clash_logs", { level });
|
||||
export async function getClashLogs() {
|
||||
return invoke<any>("get_clash_logs");
|
||||
}
|
||||
|
||||
export async function startLogsMonitoring(level?: string) {
|
||||
|
||||
@@ -44,8 +44,9 @@ export const fetchLogsViaIPC = async (
|
||||
logLevel: LogLevel = "info",
|
||||
): Promise<ILogItem[]> => {
|
||||
try {
|
||||
const level = logLevel === "all" ? undefined : logLevel;
|
||||
const response = await getClashLogs(level);
|
||||
// Server-side filtering handles the level via /logs?level={level}
|
||||
// We just fetch all cached logs regardless of the logLevel parameter
|
||||
const response = await getClashLogs();
|
||||
|
||||
// The response should be in the format expected by the frontend
|
||||
// Transform the logs to match the expected format
|
||||
|
||||
Reference in New Issue
Block a user