Moved frontend of REST Mock to frontend container (solves #168)

Co-authored-by: Adam Bem <adam.bem@zoho.eu>
Reviewed-on: #186
Reviewed-by: Mikolaj Widla <widlam@noreply.example.com>
This commit is contained in:
2023-05-12 10:06:19 +02:00
parent 34038a2ce9
commit dc3df79fc1
26 changed files with 21 additions and 84 deletions

View File

@@ -1,27 +0,0 @@
package com.r11.tools.controller;
import lombok.SneakyThrows;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* Class responsible for returning homepage html
* @author Gabriel Modzelewski
*/
@Controller
@RequestMapping("/")
public class MainController {
/**
* Default path to get the homepage
* @return the view of homepage
*/
@SneakyThrows
@GetMapping
public ModelAndView showHome(){
ModelAndView mov = new ModelAndView();
mov.setViewName("html/mock");
return mov;
}
}

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -42,7 +42,7 @@ function init() {
tools.set("xslt", "tools/xslt.html");
tools.set("xmlform", "tools/xmlFormatter.html");
tools.set("jsonform", "tools/jsonFormatter.html");
tools.set("mock", getMockHost());
tools.set("mock", "tools/mock.html");
changeActiveTools('XML');
loadLastPage();

View File

@@ -4,7 +4,7 @@ var json = {};
var jsonIndex = 0;
var lastId = 1;
var htable_row = 0;
var host = getDomain();
var host = window.location.protocol + "//" + window.location.hostname + ":8097";
var dataModified = false;
const addMessageName = 'addMessage';
const loadMessageName = 'changeMessage';

View File

@@ -65,28 +65,6 @@ function clearDataField() {
}
/**
* The `escapeHTML` function is used to escape special characters in an HTML element's innerHTML property.
* This is done to prevent these characters from being interpreted as HTML tags or attributes,
* which could potentially cause security vulnerabilities or unintended behavior.
*
* @function
* @name escapeHTML
* @kind function
* @param {any} element
* @returns {void}
*/
function escapeHTML(elementID) {
document.getElementById(elementID).innerHTML = document.getElementById(elementID).innerHTML
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;");
}
/**
* It fills the XML area with a sample XML.
*
@@ -111,6 +89,16 @@ function fillDefaultXML(element) {
}
}
/**
* It fills the XSD area with a sample XSD and XML area with matching XML.
*
* @function
* @name fillDefaultXSD
* @kind function
* @param {any} element
* @returns {void}
*/
function fillDefaultXSD(){
const serverAddress = window.location.protocol + "//" + window.location.hostname + ":8086";
fetch(serverAddress + "/assets/samples/sampleXSD.xsd")

View File

@@ -5,7 +5,6 @@
<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/frame.js"></script>
<!-- <link rel="stylesheet" href="common.css"> -->
<link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">
<!-- Meta tags for SEO and SEM -->
<title>Release11 Web Tools</title>

View File

@@ -3,12 +3,10 @@
<head>
<title>R11 MockedServices</title>
<meta charset="utf-8">
<link rel="stylesheet" href="../css/fontello.css" type="text/css">
<link rel="stylesheet" href="../css/main.css" type="text/css">
<!-- <link rel="stylesheet" href="css/common.css" type="text/css"> -->
<link rel="stylesheet" href="../css/common.css" type="text/css">
<link rel="stylesheet" href="../assets/css/tools/mock/fontello.css" type="text/css">
<link rel="stylesheet" href="../assets/css/tools/mock/main.css" type="text/css">
<link rel="stylesheet" href="../assets/css/tools/mock/common.css" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- <script src="../js/dyn_host.js"></script> -->
</head>
<body>
<div class="container">
@@ -155,14 +153,6 @@
</tr>
</thead>
<tbody>
<!-- <tr class="even">
<td>2021-01-01T10:57:26</td>
<td>Client request</td>
</tr>
<tr>
<td>2021-01-01T10:57:26</td>
<td>Client request</td>
</tr> -->
</tbody>
</table>
</div>
@@ -179,19 +169,6 @@
</div>
<!-- tile list -->
<div id="listItems">
<!-- <div class="tile">
<div class="content">
<div class="display-space-between">
<div class="centered-vertically">
<p>Id: 2</p>
<p>Status: 200</p>
</div>
<div>
<button id="test1" class="modification-button btn-tile"><i class="icon-cancel"></i></button>
</div>
</div>
</div>
</div> -->
</div>
<div id="new-tile" class="max-width centered-content small-vertical-margin">
<button id="btn-newtile" class="modification-button btn-addtile"><i class="icon-plus"></i></button>
@@ -302,7 +279,7 @@
<div>Message saved<i class="r-exclamation"></i></div>
<button>&times;</button>
</div>
<div class="body">Your message has been successfuly saved.<br>You might view it under the link.</div>
<div class="body">Your message has been successfully saved.<br>You might view it under the link.</div>
</div>
<div id="modal-query" class="modal">
<div class="header">
@@ -317,10 +294,10 @@
<button>No</button>
</div>
</div>
<script type="text/javascript" src="../js/modal.js"></script>
<script type="text/javascript" src="../js/uianimation.js"></script>
<script type="text/javascript" src="../js/datatransfer.js"></script>
<script type="text/javascript" src="../js/historyloader.js"></script>
<script type="text/javascript" src="../js/fiddle.js"></script>
<script type="text/javascript" src="../assets/scripts/tools/mock/modal.js"></script>
<script type="text/javascript" src="../assets/scripts/tools/mock//uianimation.js"></script>
<script type="text/javascript" src="../assets/scripts/tools/mock/datatransfer.js"></script>
<script type="text/javascript" src="../assets/scripts/tools/mock/historyloader.js"></script>
<script type="text/javascript" src="../assets/scripts/tools/mock/fiddle.js"></script>
</body>
</html>