Merge pull request 'bema/func/dynamic-hosts' (#8) from bema/func/dynamic-hosts into master
Reviewed-on: R11/release11-tools-web#8
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -7,3 +7,5 @@
 | 
				
			|||||||
.vscode
 | 
					.vscode
 | 
				
			||||||
nbactions.xml
 | 
					nbactions.xml
 | 
				
			||||||
target/
 | 
					target/
 | 
				
			||||||
 | 
					__pycache__
 | 
				
			||||||
 | 
					venv
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@
 | 
				
			|||||||
    <!-- <link rel="stylesheet" href="css/common.css" type="text/css"> -->
 | 
					    <!-- <link rel="stylesheet" href="css/common.css" type="text/css"> -->
 | 
				
			||||||
    <link rel="stylesheet" href="http://localhost:8086/assets/css/mock-service/common.css" type="text/css">
 | 
					    <link rel="stylesheet" href="http://localhost:8086/assets/css/mock-service/common.css" type="text/css">
 | 
				
			||||||
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 | 
					    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
 | 
				
			||||||
 | 
					    <script src="../js/dyn_host.js"></script>
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
    <div class="container">
 | 
					    <div class="container">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,11 @@
 | 
				
			|||||||
 | 
					$(document).ready( function() {
 | 
				
			||||||
 | 
					    console.log("Here")
 | 
				
			||||||
 | 
					    let links = document.getElementsByTagName("link")
 | 
				
			||||||
 | 
					    for (let i = 0; i < links.length; i++) {
 | 
				
			||||||
 | 
					        let oldStr = links[i].href.split("/")
 | 
				
			||||||
 | 
					        let endpoint = oldStr.slice(3).join("/")
 | 
				
			||||||
 | 
					        links[i].href = window.location.protocol + "//" + window.location.hostname + ":8086/" + endpoint
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
							
								
								
									
										8
									
								
								Frontend/assets/scripts/dyn_host.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								Frontend/assets/scripts/dyn_host.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					$(document).ready( function() {
 | 
				
			||||||
 | 
					    document.getElementsByName("iframe")[0].src =
 | 
				
			||||||
 | 
					        window.location.protocol + "//" + window.location.hostname + ":8097";
 | 
				
			||||||
 | 
					    document.getElementById("rest-mock").href =
 | 
				
			||||||
 | 
					        window.location.protocol + "//" + window.location.hostname + ":8097";
 | 
				
			||||||
 | 
					    console.log("DONE")
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
@@ -106,7 +106,7 @@ function performRequest(text, checkXML, checkTransform){
 | 
				
			|||||||
async function restRequest(text) {
 | 
					async function restRequest(text) {
 | 
				
			||||||
    const escapeChar = "specialEscapeChar";
 | 
					    const escapeChar = "specialEscapeChar";
 | 
				
			||||||
    // const addr = "http://localhost:8081/" + text;
 | 
					    // const addr = "http://localhost:8081/" + text;
 | 
				
			||||||
    const addr = "http://tools.zipper.release11.com" + text;
 | 
					    const addr = window.location.protocol + "//" + window.location.hostname + ":8081/" + text;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    var xmlData = document.getElementById("xmlArea").value.trim();
 | 
					    var xmlData = document.getElementById("xmlArea").value.trim();
 | 
				
			||||||
    var transformData = document.getElementById("transformArea").value.trim();
 | 
					    var transformData = document.getElementById("transformArea").value.trim();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,8 +4,12 @@
 | 
				
			|||||||
<head>
 | 
					<head>
 | 
				
			||||||
    <meta charset="UTF-8">
 | 
					    <meta charset="UTF-8">
 | 
				
			||||||
    <link rel="stylesheet" href="assets/css/frame.css">
 | 
					    <link rel="stylesheet" href="assets/css/frame.css">
 | 
				
			||||||
 | 
					    <script src="assets/scripts/common/jquery-3.6.0.slim.min.js"></script>
 | 
				
			||||||
 | 
					    <script src="assets/scripts/dyn_host.js"></script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <!-- <link rel="stylesheet" href="common.css"> -->
 | 
					    <!-- <link rel="stylesheet" href="common.css"> -->
 | 
				
			||||||
    <link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">  
 | 
					    <link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
</head>
 | 
					</head>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<body>
 | 
					<body>
 | 
				
			||||||
@@ -16,16 +20,20 @@
 | 
				
			|||||||
    <div id="content">
 | 
					    <div id="content">
 | 
				
			||||||
        <div id="toolList">
 | 
					        <div id="toolList">
 | 
				
			||||||
            <ul id="toolList">
 | 
					            <ul id="toolList">
 | 
				
			||||||
                <li id="toolListRow"><a href="http://tools.zipper.release11.com:8097/" target="iframe">REST Mock</a></li>
 | 
					                <li id="toolListRow" class="dynamic"><a id="rest-mock" href="http://tools.zipper.release11.com:8097/" target="iframe">REST Mock</a></li>
 | 
				
			||||||
                <li id="toolListRow"><a href="./tools/xpath.html" target="iframe">XPath</a></li>
 | 
					                <li id="toolListRow"><a href="./tools/xpath.html" target="iframe">XPath</a></li>
 | 
				
			||||||
                <li id="toolListRow"><a href="./tools/xslt.html" target="iframe">XSLT</a></li>
 | 
					                <li id="toolListRow"><a href="./tools/xslt.html" target="iframe">XSLT</a></li>
 | 
				
			||||||
                <li id="toolListRow"><a href="./tools/xsd.html" target="iframe">XSD</a></li>
 | 
					                <li id="toolListRow"><a href="./tools/xsd.html" target="iframe">XSD</a></li>
 | 
				
			||||||
            </ul>
 | 
					            </ul>
 | 
				
			||||||
            <div id="copyright">Copyright © 2023<br><a href="http://release11.com/">Release11 Sp. z. o. o.</a></div>
 | 
					            <div id="copyright">Copyright © 2023<br><a href="http://release11.com/">Release11 Sp. z. o. o.</a></div>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        <iframe id="frame" name="iframe" src="http://localhost:8097/" frameborder="0"></iframe>
 | 
					        <iframe id="frame" name="iframe" src="http://tools.zipper.release11.com:8097/" frameborder="0"></iframe>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <script>
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    </script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user