Fixed bug with choosing ports
This commit is contained in:
		| @@ -102,6 +102,11 @@ function performRequest(endpoint, checkXML, checkTransform){ | ||||
|     var xmlData = document.getElementById(sourceId).value.trim(); | ||||
|     var transformData = document.getElementById(targetId).value.trim(); | ||||
|      | ||||
|     var port = 8081 | ||||
|     if (getProcessor() == "libxml") { | ||||
|         port = 8082 | ||||
|     } | ||||
|  | ||||
|     var empty = false; | ||||
|     if (defaultStrings.includes(xmlData) && checkXML) { | ||||
|             document.getElementById(sourceId).style.backgroundColor = color_red; | ||||
| @@ -113,7 +118,7 @@ function performRequest(endpoint, checkXML, checkTransform){ | ||||
|         empty = true; | ||||
|     } | ||||
|     if (!empty) { | ||||
|         restRequest(endpoint, xmlData, transformData).then(function(result) { | ||||
|         restRequest(port, endpoint, xmlData, transformData).then(function(result) { | ||||
|             document.getElementById("resultArea").value = result.result; | ||||
|             document.getElementById("procinfo").innerText = ' Computed using '.concat(" ", result.processor); | ||||
|             if (result.status = "OK") { | ||||
| @@ -131,6 +136,7 @@ function performRequest(endpoint, checkXML, checkTransform){ | ||||
| } | ||||
|  | ||||
| function performFormatRequest(endpoint, checkXML, sourceId, targetId){ | ||||
|     const port = 8082; | ||||
|     var xmlData = document.getElementById(sourceId).value.trim(); | ||||
|      | ||||
|     var empty = false; | ||||
| @@ -141,7 +147,7 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId){ | ||||
|     } | ||||
|  | ||||
|     if (!empty) { | ||||
|         restRequest(endpoint, xmlData, "").then(function(result) { | ||||
|         restRequest(port, endpoint, xmlData, "").then(function(result) { | ||||
|             document.getElementById(targetId).value = result.result; | ||||
|              | ||||
|         }); | ||||
| @@ -154,13 +160,10 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId){ | ||||
|  | ||||
|  | ||||
| //Form REST request, send and return received data | ||||
| async function restRequest(endpoint, xmlData, transformData) { | ||||
| async function restRequest(port, endpoint, xmlData, transformData) { | ||||
|     const escapeChar = "specialEscapeChar"; | ||||
|     var port = ":8081/" | ||||
|     if (getProcessor() == "libxml") { | ||||
|         port = ":8082/" | ||||
|     } | ||||
|     const addr = window.location.protocol + "//" + window.location.hostname + port + endpoint; | ||||
|      | ||||
|     const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint; | ||||
|  | ||||
|     if(defaultStrings.includes(xmlData)){ | ||||
|         xmlData = "<empty/>"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user