Analyse logs without storing them on mclo.gs (#3196)

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Julian Vennen 2025-01-28 21:53:39 -05:00 committed by GitHub
parent e368e35e74
commit a4e024c690
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -237,24 +237,11 @@ interface ErrorData {
}
const inspectingError = ref<ErrorData | null>(null);
const mcError = ref<any>(null);
const inspectError = async () => {
const log = await props.server.fs?.downloadFile("logs/latest.log");
const response = (await $fetch("https://api.mclo.gs/1/log", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
body: new URLSearchParams({
content: log,
}),
})) as any;
mcError.value = response;
// @ts-ignore
const analysis = (await $fetch(`https://api.mclo.gs/1/insights/${response.id}`, {
const analysis = (await $fetch(`https://api.mclo.gs/1/analyse`, {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
@ -269,7 +256,6 @@ const inspectError = async () => {
const clearError = () => {
inspectingError.value = null;
mcError.value = null;
};
watch(