Added green highlight to parsers

This commit is contained in:
2023-11-16 08:40:28 +01:00
parent 00786bf157
commit f411797041
2 changed files with 19 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ const engine = ref('');
const version = ref('');
const errorOccurred = ref(false);
const successOccurred = ref(false);
onMounted(() => {
@@ -119,12 +120,14 @@ async function fetchRequest(request: Request):Promise<JSON> {
function updateOutputField(data: any) {
result.value = data.result
errorOccurred.value = data.status == "ERR"
errorOccurred.value = data.status != "OK"
successOccurred.value = data.status == "OK"
}
function clear() {
result.value = ""
errorOccurred.value = false
successOccurred.value = false
}
function emitVersionChange() {
@@ -135,6 +138,16 @@ function isVersionSelectionAvailable() {
return !(props.tool == "xsd");
}
function highlightField() {
if (errorOccurred.value) {
return "text-field-error";
}
if (successOccurred.value) {
return "text-field-success";
}
return "";
}
</script>
<template>
@@ -152,7 +165,7 @@ function isVersionSelectionAvailable() {
<button class="tool-button" @click="process">Process</button>
</div>
</div>
<div class="overflow-auto h-full w-full rounded-2xl" :class="{'text-field-error' : errorOccurred}">
<div class="overflow-auto h-full w-full rounded-2xl" :class="highlightField()">
<CodeEditor :code="result" :config="{disabled:true,language:tool}"></CodeEditor>
</div>

View File

@@ -30,4 +30,8 @@
.text-field-error {
@apply shadow-[0px_0px_10px_0px_rgba(255,0,0,1)];
}
.text-field-success {
@apply shadow-[0px_0px_10px_0px_rgba(0,255,0,1)];
}