Analyse logs without storing them on mclo.gs (#3196)
Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
parent
e368e35e74
commit
a4e024c690
@ -237,24 +237,11 @@ interface ErrorData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const inspectingError = ref<ErrorData | null>(null);
|
const inspectingError = ref<ErrorData | null>(null);
|
||||||
const mcError = ref<any>(null);
|
|
||||||
|
|
||||||
const inspectError = async () => {
|
const inspectError = async () => {
|
||||||
const log = await props.server.fs?.downloadFile("logs/latest.log");
|
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
|
// @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",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
@ -269,7 +256,6 @@ const inspectError = async () => {
|
|||||||
|
|
||||||
const clearError = () => {
|
const clearError = () => {
|
||||||
inspectingError.value = null;
|
inspectingError.value = null;
|
||||||
mcError.value = null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user