fix debug log loading

This commit is contained in:
wh1te909
2021-11-09 01:06:11 +00:00
parent 9338f4115e
commit c3c2763ff0
3 changed files with 17 additions and 9 deletions

View File

@@ -320,7 +320,9 @@ export default {
try {
const result = await fetchAgentTasks(selectedAgent.value);
tasks.value = result.filter(task => task.sync_status !== "pendingdeletion");
} catch {}
} catch (e) {
console.error(e);
}
loading.value = false;
}

View File

@@ -60,7 +60,7 @@
</template>
<template v-slot:top-row>
<q-tr v-if="debugLog.length === 1000">
<q-tr v-if="Array.isArray(debugLog) && debugLog.length === 1000">
<q-td colspan="100%">
<q-icon name="warning" color="warning" />
Results are limited to 1000 rows.
@@ -141,13 +141,17 @@ export default {
async function getDebugLog() {
loading.value = true;
const data = {
logLevelFilter: logLevelFilter.value,
};
if (agentFilter.value) data["agentFilter"] = agentFilter.value;
if (logTypeFilter.value) data["logTypeFilter"] = logTypeFilter.value;
try {
const data = {
logLevelFilter: logLevelFilter.value,
};
if (agentFilter.value) data["agentFilter"] = agentFilter.value;
if (logTypeFilter.value) data["logTypeFilter"] = logTypeFilter.value;
debugLog.value = await fetchDebugLog(data);
debugLog.value = await fetchDebugLog(data);
} catch (e) {
console.error(e);
}
loading.value = false;
}

View File

@@ -156,7 +156,9 @@ export default {
actions.value = props.agent
? await fetchAgentPendingActions(props.agent.agent_id)
: await fetchPendingActions();
} catch {}
} catch (e) {
console.error(e);
}
loading.value = false;
}