From a9443381462efe13855db6fa0efecf5916a0d728 Mon Sep 17 00:00:00 2001 From: Adam Bem Date: Tue, 13 Jun 2023 14:29:48 +0200 Subject: [PATCH] Added placeholder for formatter --- new-frontend/src/App.vue | 61 ++++++------------------- new-frontend/src/components/XmlTool.vue | 22 ++++----- 2 files changed, 24 insertions(+), 59 deletions(-) diff --git a/new-frontend/src/App.vue b/new-frontend/src/App.vue index b219463..7e5953d 100644 --- a/new-frontend/src/App.vue +++ b/new-frontend/src/App.vue @@ -1,57 +1,22 @@ diff --git a/new-frontend/src/components/XmlTool.vue b/new-frontend/src/components/XmlTool.vue index e6ccc83..5c86135 100644 --- a/new-frontend/src/components/XmlTool.vue +++ b/new-frontend/src/components/XmlTool.vue @@ -6,23 +6,21 @@ const transform = ref(''); const transformPlaceholder = ref('') const result = ref('') -const tool = ref('') +const activeXmlTool = ref('') async function submit() { - const url = document.location.protocol + "//" + document.location.hostname + "/java/" + tool.value; + const url = document.location.protocol + "//" + document.location.hostname + "/java/" + activeXmlTool.value; var jsonData = JSON.stringify({ "data": xml.value, "process": transform.value, "processor": "xalan", "version": "3.0" }); - var init = { - headers: new Headers({ - }), + var requestData = { body: jsonData, method: "POST" }; - var request = new Request(url, init); + var request = new Request(url, requestData); var responseBody = await fetch(request).then(async response => { @@ -33,7 +31,7 @@ async function submit() { result.value = responseBody.result; } -watch(tool, (tool) => { +watch(activeXmlTool, (tool) => { if (tool == "xpath") transformPlaceholder.value = "XPath"; if (tool == "xsd") @@ -42,21 +40,23 @@ watch(tool, (tool) => { transformPlaceholder.value = "XSLT"; if (tool == "xquery") transformPlaceholder.value = "XQuery"; + + transform.value = ""; })