From cbec25cd6b5fe37f3010ab163b1bca61a743c457 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 8 May 2022 04:21:35 +0200 Subject: User -> portal, Admin -> admin Signed-off-by: Georg Pfuetzenreuter --- .../net/libertacasa/pubsh/web/SecurityConfig.java | 1 + .../net/libertacasa/pubsh/web/WebApplication.java | 8 +- src/main/resources/templates/admin.html | 85 ++++++++++++++++++++++ src/main/resources/templates/portal.html | 25 +------ src/main/resources/templates/user.html | 62 ---------------- 5 files changed, 91 insertions(+), 90 deletions(-) create mode 100644 src/main/resources/templates/admin.html delete mode 100644 src/main/resources/templates/user.html diff --git a/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java b/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java index 53f83ab..14b6dcb 100644 --- a/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java +++ b/src/main/java/net/libertacasa/pubsh/web/SecurityConfig.java @@ -36,6 +36,7 @@ public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter { http .authorizeRequests() .antMatchers("/portal").hasAuthority("devel-user") + .antMatchers("/admin").hasAuthority("devel-admins") .anyRequest().permitAll(); } } diff --git a/src/main/java/net/libertacasa/pubsh/web/WebApplication.java b/src/main/java/net/libertacasa/pubsh/web/WebApplication.java index d4094f6..ad9ed9b 100644 --- a/src/main/java/net/libertacasa/pubsh/web/WebApplication.java +++ b/src/main/java/net/libertacasa/pubsh/web/WebApplication.java @@ -45,7 +45,7 @@ public class WebApplication { } - @GetMapping("/portal") + @GetMapping("/admin") public String portal(Model model) throws pubshError { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); @@ -101,10 +101,10 @@ public class WebApplication { model.addAttribute("availableOs", availableOs); //model.addAttribute("osChoice", new String()); - return("portal"); + return("admin"); } - @GetMapping("/user") + @GetMapping("/portal") public String user(Model model) throws pubshError { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); @@ -146,7 +146,7 @@ public class WebApplication { model.addAttribute("docker_containers", containers); model.addAttribute("availableOs", availableOs); - return("user"); + return("portal"); } @DeleteMapping("/frontend/container/delete/{id}") diff --git a/src/main/resources/templates/admin.html b/src/main/resources/templates/admin.html new file mode 100644 index 0000000..d2f1847 --- /dev/null +++ b/src/main/resources/templates/admin.html @@ -0,0 +1,85 @@ + + + + + +
+
+

+ Hello, . +

+
+

Available images:

+ + + + +
+ + + + +
+ +
+ +
+
+
+
+ +

Generate new throw-away shell:

+
+ + +
+ + + + +

Existing containers:

+ + + + + + +
+ + + + + +
+ + +
+
+ + + + +

+ Logout +
+ + + diff --git a/src/main/resources/templates/portal.html b/src/main/resources/templates/portal.html index d2f1847..a5473ee 100644 --- a/src/main/resources/templates/portal.html +++ b/src/main/resources/templates/portal.html @@ -40,10 +40,7 @@ - - - - +

Existing containers:

@@ -51,35 +48,15 @@ - -
-
-
- - - -

Logout - diff --git a/src/main/resources/templates/user.html b/src/main/resources/templates/user.html deleted file mode 100644 index a5473ee..0000000 --- a/src/main/resources/templates/user.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - -
-
-

- Hello, . -

-
-

Available images:

- - - - -
- - - - -
- -
- -
-
-
-
- -

Generate new throw-away shell:

-
- - -
- -

Existing containers:

- - - - -
- - - - -
- -
-
-

- Logout -
- - -- cgit v1.2.3