Implemented red frame on parsing error in Parsers

This commit is contained in:
2023-11-09 08:34:28 +01:00
parent e0bb96e6ae
commit a8f8c6d5f5
2 changed files with 13 additions and 5 deletions

View File

@@ -23,6 +23,8 @@ var versionsForCurrentEngine = ref([""]);
const engine = ref('');
const version = ref('');
const errorOccurred = ref(false);
onMounted(() => {
changeAvailableEngines();
@@ -111,16 +113,18 @@ function prepareRequestBody():string {
async function fetchRequest(request: Request):Promise<JSON> {
var responseBody = await fetch(request)
.then(response => response.json())
.then((body) => body);
return responseBody;
.then((body) => body)
return responseBody
}
function updateOutputField(data: any) {
result.value = data.result;
result.value = data.result
errorOccurred.value = data.status == "ERR"
}
function clear() {
result.value = "";
result.value = ""
errorOccurred.value = false
}
function emitVersionChange() {
@@ -148,7 +152,7 @@ function isVersionSelectionAvailable() {
<button class="tool-button" @click="process">Process</button>
</div>
</div>
<div class="overflow-scroll h-full w-full">
<div class="overflow-scroll h-full w-full rounded-2xl" :class="{'text-field-error' : errorOccurred}">
<CodeEditor :code="result" :config="{disabled:true,language:tool}"></CodeEditor>
</div>