Every service meant to be public work now on port 80 #205

Merged
bema merged 12 commits from bema/fix/unify_ports_on_master into master 2023-05-23 08:59:11 +02:00
Showing only changes of commit e8b84ef1e8 - Show all commits

View File

@@ -76,7 +76,7 @@ function clearDataField() {
*/ */
function fillDefaultXML(element) { function fillDefaultXML(element) {
if (element.classList.contains("active")) { if (element.classList.contains("active")) {
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; const serverAddress = window.location.protocol + "//" + window.location.hostname;
clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here"); clearDefaultContent(document.getElementById("xmlArea"), "Insert XML here");
fetch(serverAddress + "/assets/samples/sampleXml.xml") fetch(serverAddress + "/assets/samples/sampleXml.xml")
.then(response => response.text()) .then(response => response.text())
@@ -100,7 +100,7 @@ function fillDefaultXML(element) {
* @returns {void} * @returns {void}
*/ */
function fillDefaultXSD(){ function fillDefaultXSD(){
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; const serverAddress = window.location.protocol + "//" + window.location.hostname;
fetch(serverAddress + "/assets/samples/sampleXSD.xsd") fetch(serverAddress + "/assets/samples/sampleXSD.xsd")
.then( response => response.text() ) .then( response => response.text() )
.then( (XSDSchema) => { .then( (XSDSchema) => {
@@ -126,7 +126,7 @@ function fillDefaultXSD(){
* @returns {void} * @returns {void}
*/ */
function fillDefaultXSLT() { function fillDefaultXSLT() {
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086"; const serverAddress = window.location.protocol + "//" + window.location.hostname;
fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt") fetch(serverAddress + "/assets/samples/XSLTTemplate.xslt")
.then( response => response.text() ) .then( response => response.text() )
.then( (XSTLTemplate) => { .then( (XSTLTemplate) => {
@@ -277,9 +277,9 @@ function performRequest(endpoint, checkXML, checkTransform) {
var xmlData = document.getElementById(sourceId).innerText.trim(); var xmlData = document.getElementById(sourceId).innerText.trim();
var transformData = document.getElementById(transformId).innerText.trim(); var transformData = document.getElementById(transformId).innerText.trim();
var port = 8081; var backend = "java";
if (getProcessor() == "libxml") { if (getProcessor() == "libxml") {
port = 8082; backend = "libxml";
} }
var empty = false; var empty = false;
@@ -293,7 +293,7 @@ function performRequest(endpoint, checkXML, checkTransform) {
empty = true; empty = true;
} }
if (!empty) { if (!empty) {
restRequest(port, endpoint, xmlData, transformData).then(function (result) { restRequest(backend, endpoint, xmlData, transformData).then(function (result) {
document.getElementById("resultArea").innerText = result.result; document.getElementById("resultArea").innerText = result.result;
highlightSyntax("resultArea"); highlightSyntax("resultArea");
document.getElementById("procinfo").innerText = ' Computed using ' + result.processor; document.getElementById("procinfo").innerText = ' Computed using ' + result.processor;
@@ -380,10 +380,9 @@ function performFormatRequest(endpoint, checkXML, sourceId, targetId) {
* @param {any} transformData data used to transform given XML * @param {any} transformData data used to transform given XML
* @returns {Promise<any>} * @returns {Promise<any>}
*/ */
async function restRequest(port, endpoint, xmlData, transformData) { async function restRequest(backend, endpoint, xmlData, transformData) {
const escapeChar = "specialEscapeChar";
const addr = window.location.protocol + "//" + window.location.hostname + ":" + port + "/" + endpoint; const addr = window.location.protocol + "//" + window.location.hostname + "/" + backend + "/" + endpoint;
if (defaultStrings.includes(xmlData)) { if (defaultStrings.includes(xmlData)) {
xmlData = "<empty/>"; xmlData = "<empty/>";