summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2022-05-08 15:58:33 +0200
committerGeorg Pfuetzenreuter2022-05-08 15:58:33 +0200
commit33de7a6800ba2447bf040bd25167e677a723bf2f (patch)
treee08c8db749ab58bf61bf14fd16729c1626a52c80
parentb48fe2fd1086892b439454ad3843705baf34b58b (diff)
downloadpubsh-web-33de7a6800ba2447bf040bd25167e677a723bf2f.tar.gz
pubsh-web-33de7a6800ba2447bf040bd25167e677a723bf2f.tar.bz2
pubsh-web-33de7a6800ba2447bf040bd25167e677a723bf2f.zip
Cleanup user frontend
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
-rw-r--r--src/main/java/net/libertacasa/pubsh/web/WebApplication.java4
-rw-r--r--src/main/resources/templates/admin.html33
-rw-r--r--src/main/resources/templates/portal.html10
3 files changed, 20 insertions, 27 deletions
diff --git a/src/main/java/net/libertacasa/pubsh/web/WebApplication.java b/src/main/java/net/libertacasa/pubsh/web/WebApplication.java
index c9cbe07..e04aa48 100644
--- a/src/main/java/net/libertacasa/pubsh/web/WebApplication.java
+++ b/src/main/java/net/libertacasa/pubsh/web/WebApplication.java
@@ -159,7 +159,7 @@ public class WebApplication {
Docker.deleteContainer(id);
- return("redirect:/portal");
+ return("redirect:/admin");
}
@DeleteMapping("/frontend/image/delete/{id}")
@@ -184,7 +184,7 @@ public class WebApplication {
redirectAttributes.addFlashAttribute("message", returnmessage);
}
- return("redirect:/portal");
+ return("redirect:/admin");
}
@PostMapping(path="/frontend/container/add",consumes=MediaType.APPLICATION_FORM_URLENCODED_VALUE)
diff --git a/src/main/resources/templates/admin.html b/src/main/resources/templates/admin.html
index 5a84a5a..88ef9e4 100644
--- a/src/main/resources/templates/admin.html
+++ b/src/main/resources/templates/admin.html
@@ -8,6 +8,19 @@
<h1>
Hello, <span th:text="${username}"></span>.
</h1>
+ <h2>Generate new shell:</h2>
+ <p>Warning! Shells created from the administration panel are not covered by the cleanup logic!</p>
+ <form th:object="${osChoice}" th:id="request_pseudoform" action="#" th:action="@{'/frontend/container/add'}" th:method="post" th:os="${osChoice}" th:onsubmit="return confirm('You are about to generate a shell with the OS ' + this.getAttribute('osoption') + ' - please be patient after you confirm, as the generation may take a short while.');">
+ <select class="form-control" th:object="${osChoice}" name="osChoice">
+ <option value="">Select operating system ...</option>
+ <option
+ th:each="osoption : ${availableOs}"
+ th:value="${osoption}"
+ th:attr="value=${osoption}"
+ th:text="${osoption}"></option>
+ </select>
+ <button class="btn btn-primary" th:id="request_submission" th:type="submit">Generate</button>
+ </form>
<div th:if="${attribute01 != null}" th:text="${attribute01}"></div>
<h2>Available images:</h2>
<table>
@@ -27,23 +40,6 @@
<td th:text="${image.created}" />
</tr>
</table>
-
- <h2>Generate new throw-away shell:</h2>
- <form th:object="${osChoice}" th:id="request_pseudoform" action="#" th:action="@{'/frontend/container/add'}" th:method="post" th:os="${osChoice}" th:onsubmit="return confirm('You are about to generate a shell with the OS ' + this.getAttribute('osoption') + ' - please be patient after you confirm, as the generation may take a short while.');">
- <select class="form-control" th:object="${osChoice}" name="osChoice">
- <option value="">Select operating system ...</option>
- <option
- th:each="osoption : ${availableOs}"
- th:value="${osoption}"
- th:attr="value=${osoption}"
- th:text="${osoption}"></option>
- </select>
- <button class="btn btn-primary" th:id="request_submission" th:type="submit">Generate</button>
- </form>
-
-
-
-
<h2>Existing containers:</h2>
<table>
<tr th:each="container: ${docker_containers}">
@@ -74,9 +70,6 @@
</tr>
</table>
-
-
-
<p></p>
<a href="/logout">Logout</a>
</div>
diff --git a/src/main/resources/templates/portal.html b/src/main/resources/templates/portal.html
index 33934c3..a9319a4 100644
--- a/src/main/resources/templates/portal.html
+++ b/src/main/resources/templates/portal.html
@@ -22,7 +22,7 @@
</form>
<div th:if="${attribute01 != null}" th:text="${attribute01}"></div>
- <h3>Available images:</h3>
+ <!-- h3>Available images:</h3>
<table th:if="${docker_images!=null and !docker_images.empty}">
<tr th:each="image: ${docker_images}" th:if="${image.repoTags[0] != '<none>:<none>'}">
<td>
@@ -40,14 +40,14 @@
<td th:text="${image.created}" />
</tr>
</table>
- <div th:if="${docker_images.empty}"><p>None yet!</p></div>
+ <div th:if="${docker_images.empty}"><p>None yet!</p></div-->
- <h3>Existing containers:</h3>
+ <h3>Existing shells:</h3>
<table th:if="${docker_containers!=null and !docker_containers.empty}">
<tr th:each="container: ${docker_containers}">
<td th:text="${container.names[0]}" />
- <td th:text="${container.image}" />
- <td th:text="${container.id}" />
+ <!-- td th:text="${container.image}" / -->
+ <!-- td th:text="${container.id}" / -->
<td th:text="${container.status}" />
<td>
<form id="deletion_pseudoform" action="#" th:action="@{'/frontend/shell/delete/{id}'(id=${container.id})}" th:method="delete" th:containerid="${container.id}" th:containerShaSum="${container.imageId}" th:onsubmit="return confirm('Do you really want to delete the container with ID ' + this.getAttribute('containerid') + ' which is attached to the image with checksum ' + this.getAttribute('containerShaSum') + ' ?');">