Added default tool
This commit is contained in:
		| @@ -1,9 +1,12 @@ | |||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { ref } from 'vue'; | import { onMounted, ref } from 'vue'; | ||||||
| import XmlTool from './components/XmlTool.vue' | import XmlTool from './components/XmlTool.vue' | ||||||
|  |  | ||||||
| const activeToolBox = ref('') | const activeToolBox = ref('') | ||||||
|  |  | ||||||
|  | onMounted(() => { | ||||||
|  |   activeToolBox.value = "xml"; | ||||||
|  | }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| <script setup lang="ts"> | <script setup lang="ts"> | ||||||
| import { ref, watch } from 'vue'; | import { onMounted, ref, watch } from 'vue'; | ||||||
|  |  | ||||||
| const xml = ref(''); | const xml = ref(''); | ||||||
| const transform = ref(''); | const transform = ref(''); | ||||||
| @@ -10,17 +10,17 @@ const activeXmlTool = ref('') | |||||||
|  |  | ||||||
| async function submit() { | async function submit() { | ||||||
|   const url = document.location.protocol + "//" + document.location.hostname + "/java/" + activeXmlTool.value; |   const url = document.location.protocol + "//" + document.location.hostname + "/java/" + activeXmlTool.value; | ||||||
|   var jsonData = JSON.stringify({ |   var requestBody = JSON.stringify({ | ||||||
|     "data": xml.value, |     "data": xml.value, | ||||||
|     "process": transform.value, |     "process": transform.value, | ||||||
|     "processor": "xalan", |     "processor": "xalan", | ||||||
|     "version": "3.0" |     "version": "3.0" | ||||||
|   }); |   }); | ||||||
|   var requestData = { |  | ||||||
|     body: jsonData, |   var request = new Request(url, { | ||||||
|  |     body: requestBody, | ||||||
|     method: "POST" |     method: "POST" | ||||||
|   }; |   }); | ||||||
|   var request = new Request(url, requestData); |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   var responseBody = await fetch(request).then(async response => { |   var responseBody = await fetch(request).then(async response => { | ||||||
| @@ -43,6 +43,10 @@ watch(activeXmlTool, (tool) => { | |||||||
|    |    | ||||||
|     transform.value = ""; |     transform.value = ""; | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | onMounted(() => { | ||||||
|  |   activeXmlTool.value = "xpath"; | ||||||
|  | }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
| <template> | <template> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user