#12 App widgets
This commit is contained in:
@@ -8,6 +8,7 @@ import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Controller
|
||||
public class DashboardController {
|
||||
@@ -20,6 +21,7 @@ public class DashboardController {
|
||||
@GetMapping("/dashboard")
|
||||
public String start(Model model, HttpServletRequest httpServletRequest, String sortOrder) {
|
||||
model.addAttribute("apps", this.appRegistry.getAll());
|
||||
model.addAttribute("widgets", this.appRegistry.getAll().stream().flatMap(a -> a.getWidgets().stream()).collect(Collectors.toList()));
|
||||
this.webContainerSharedConfig.addDefaults(model);
|
||||
|
||||
return "dashboard/index";
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
nbscloud.dashboard.greeting=Welcome to nbscloud
|
||||
|
||||
nbscloud.dashboard.index.title=nbscloud\: dashboard
|
||||
@@ -0,0 +1,3 @@
|
||||
nbscloud.dashboard.greeting=Willkommen bei nbscloud
|
||||
|
||||
nbscloud.dashboard.index.title=nbscloud\: \u00DCbersicht
|
||||
@@ -1,3 +1,35 @@
|
||||
#content-container {
|
||||
padding-top: 2em;
|
||||
}
|
||||
|
||||
#widgets-container {
|
||||
padding: 2em;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
align-content: space-between;
|
||||
row-gap: 2em;
|
||||
column-gap: 2em;
|
||||
}
|
||||
|
||||
.widget {
|
||||
flex-grow: 1;
|
||||
background-color: #1d2121;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.widget-heading {
|
||||
|
||||
}
|
||||
|
||||
.greeting {
|
||||
display: block;
|
||||
font-size: 1.5em;
|
||||
margin-top: 0.83em;
|
||||
margin-bottom: 0.83em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
@@ -14,7 +14,14 @@
|
||||
<div id="main-container">
|
||||
<div th:replace="includes/header :: header"/>
|
||||
<div id="content-container">
|
||||
Welcome to nbscloud
|
||||
<div id="greetings-container">
|
||||
<p class="greeting" th:text="#{nbscloud.dashboard.greeting}" />
|
||||
</div>
|
||||
<div id="widgets-container">
|
||||
<th:block th:each="widget : ${widgets}">
|
||||
<th:block th:utext="${#servletContext.getRequestDispatcher('/' + widget.path).include(#request,#response)}"/>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
<div th:replace="includes/footer :: footer"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user