- finishing etrack

- new buttons for main page
- swagger
This commit is contained in:
Szakalakamaka
2020-09-22 10:05:11 +02:00
parent 9f3f2161cb
commit db625b650b
68 changed files with 1736 additions and 494 deletions

View File

@@ -10,30 +10,31 @@
</head>
<body>
<hr>
<section class="page-section" id="main-section" >
<section class="page-section" id="main-section">
<div class="container">
<div class="row">
<div class="column" >
<div class="column">
<br>In order to set mockup response please fill the form below:
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<table>
<input type="text" th:field="*{clientUUID}" th:placeholder="*{clientUUID}" hidden/>
<table>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<input type="text" th:field="*{clientUUID}" hidden/>
<tr>
<td>Mocked response id:</td>
<td><input type="text" th:field="*{mockedResponseId}"/></td>
<td><input type="text" th:field="*{mockedResponseId}" placeholder="1"/></td>
<td th:if="${#fields.hasErrors('mockedResponseId')}" th:errors="*{mockedResponseId}">Id
Error
</td>
</tr>
<tr>
<td>Mocked response body:</td>
<td><textarea rows="4" cols="30" th:field="*{messageBody}"></textarea></td>
<td><textarea rows="4" cols="30" th:field="*{messageBody}"
placeholder="Your message body"></textarea></td>
<td th:if="${#fields.hasErrors('messageBody')}" th:errors="*{messageBody}">Body Error</td>
</tr>
<tr>
<td>Mocked response http code status:</td>
<td><input type="text" th:field="*{httpStatus}"></td>
<td><input type="text" th:field="*{httpStatus}" placeholder="200"></td>
<td th:if="${#fields.hasErrors('httpStatus')}" th:errors="*{httpStatus}">HttpStatus Error
</td>
</tr>
@@ -54,7 +55,7 @@
<td><input type="text" name="value" th:value="${entry.key}" disabled="disabled"/></td>
<td>
<input type="text" name="value" th:field="*{httpHeaders[__${entry.key}__]}"/>
<button type="submit" name="removeHeader" th:value="${entry.key}" >
<button type="submit" name="removeHeader" th:value="${entry.key}">
<img src="/img/icons8-cancel-64.png" style="width: 20px;"/>
</button>
</td>
@@ -68,47 +69,65 @@
</select></td>
</tr>
<tr>
<td><input type="submit" value="Save mocked response"/></td>
<td><input type="submit" value="Save my message"/></td>
<td>
<button type="submit" name="newMessage" th:value="*{clientUUID}">
<img src="/img/update-button.png" style="width: 20px;"/>
</button>
</td>
</tr>
</table>
</form>
</form>
</table>
<table>
<tr>
<td>
<p th:if="${mockSaved}">Mock has been saved</p>
<form action="#" th:action="@{/etrack/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}"
method="get">
<p><input type="submit" value="History"/></p>
</form>
</td>
<td>
<form action="#" th:action="@{/home/getMockedResponse}" th:object="${mockedMessageDto}"
method="get">
<input type="text" th:field="*{clientUUID}" hidden/>
<input type="text" th:field="*{mockedResponseId}" hidden/>
<p th:if="${mockSaved}"><input type="submit" value="Test your mock"/></p>
<p th:if="${canTest}"><input type="submit" value="Test your mock"/></p>
</form>
</td>
</tr>
</table>
<p th:if="${mockSaved}">Mock has been saved</p>
</div>
<div class="column">
<br>
<form th:action="@{/home/__${mockedMessageDto.clientUUID}__}" method="post" id="dupa" >
<table>
<thead>
<tr>
<th class="tr-pageable">#</th>
<th class="tr-pageable">MessageId</th>
<th class="tr-pageable">Media Type</th>
<th class="tr-pageable">Http Status</th>
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
<form action="#" th:action="@{/home/__${mockedMessageDto.clientUUID}__}"
th:object="${mockedMessageDto}" method="post">
<table>
<thead>
<tr>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-0">#</p>
</th>
<th class="tr-pageable">
<p class="btn-sort active" id="btn-sort-1">MessageId</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-2">Media Type</p>
</th>
<th class="tr-pageable">
<p class="btn-sort" id="btn-sort-3">Http Status</p>
</th>
</tr>
</thead>
<input type="text" th:field="*{clientUUID}" hidden/>
<tbody id="table-body">
</tbody>
</table>
</form>
<div class="container ">
<div id="pagination-wrapper"></div>
</div>
</div>
</div>
</div>
</div>
@@ -118,45 +137,28 @@
<hr>
<div>
<br>In order to set or get responses through curl or http tools you can use urls below.
<br>When you set your response simply set headers and media type of your request that you expect to get in the
response from the next step.
<br>http://<a th:text="@{__${localhost}__}">localhost</a>:8097/klaus/v1/delete/<a
th:text="${mockedMessageDto.clientUUID}">clientUUID should be here</a>/{mockedResponseId}
<br>http://<a th:text="@{__${localhost}__}">localhost</a>:8097/klaus/v1/set/ <a
th:text="${mockedMessageDto.clientUUID}">clientUUID should be here</a>/{mockedResponseId}?httpStatus={httpStatus}
<br>http://<a th:text="@{__${localhost}__}">localhost</a>:8097/klaus/v1/get/<a
th:text="${mockedMessageDto.clientUUID}">clientUUID should be here</a>/{mockedResponseId}
<br>http://<a th:text="@{__${localhost}__}">localhost</a>:8097/klaus/v1/getAll/<a
th:text="${mockedMessageDto.clientUUID}">clientUUID should be here</a>
<br>If you are keen to use the mocking service with bigger amount of messages or automate the process by inserting high amount of random messages please consider using the tools below:
<br><a href="http://[[${localhost}]]:8097/swagger-ui.html">http://[[${localhost}]]:8097/swagger-ui.html</a>
<br>
<br>http://[[${localhost}]]:8097/klaus/v1/delete/[[${mockedMessageDto.clientUUID}]]/{mockedResponseId}
<br>http://[[${localhost}]]:8097/klaus/v1/set/[[${mockedMessageDto.clientUUID}]]/{mockedResponseId}?httpStatus={httpStatus}
<br>http://[[${localhost}]]:8097/klaus/v1/get/[[${mockedMessageDto.clientUUID}]]/{mockedResponseId}
<br>http://[[${localhost}]]:8097/klaus/v1/getAll/[[${mockedMessageDto.clientUUID}]]
</div>
<hr>
<div>
<br>To see your activity history use the form below
<form action="#" th:action="@{/eventsForm}" th:object="${eventRequestDto}" method="post">
<input type="text" th:name="clientUUID" th:value="${mockedMessageDto.clientUUID}" hidden/>
<br><label>Mocked response id:</label><br>
<input type="text" th:name="mockedResponseId" th:id="mockedResponseId" th:placeholder="all"/>
<td th:if="${#fields.hasErrors('mockedResponseId')}" th:errors="*{mockedResponseId}">mockedResponseId error</td>
<br><label>Date from:</label><br>
<input type="datetime-local" th:field="*{localDateTimeFrom}"/>
<td th:if="${#fields.hasErrors('localDateTimeFrom')}" th:errors="*{localDateTimeFrom}">localDateTimeFrom Error</td>
<br><label>Date to:</label><br>
<input type="datetime-local" th:field="*{localDateTimeTo}"/>
<td th:if="${#fields.hasErrors('localDateTimeTo')}" th:errors="*{localDateTimeTo}">localDateTimeTo Error</td>
<div th:if="${#fields.hasAnyErrors()}">
<p th:each="err : ${#fields.allErrors()}" th:text="${err}">...</p>
</div>
<input type="submit" value="See my history"/>
</form>
</div>
<hr>
</div>
</div>
<script type="text/javascript" th:inline="javascript">
var mockedMessageDtoList = /*[[${mockedMessageDtoList}]]*/;
var listForPagination = /*[[${mockedMessageDtoList}]]*/;
</script>
<script src="/js/paggination.js"></script>
</body>
</html>