1
0

Basic implementation for files app

This commit is contained in:
2022-05-06 23:01:23 +02:00
parent 8abb6d0372
commit 5aa3c495ae
54 changed files with 2381 additions and 94 deletions

38
dashboard/pom.xml Normal file
View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>nbs-cloud-aggregator</artifactId>
<groupId>de.77zzcx7.nbs-cloud</groupId>
<version>1-SNAPSHOT</version>
</parent>
<groupId>de.77zzcx7.nbs-cloud</groupId>
<artifactId>dashboard</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>de.77zzcx7.nbs-cloud</groupId>
<artifactId>web-container-registry</artifactId>
</dependency>
<dependency>
<groupId>de.77zzcx7.nbs-cloud</groupId>
<artifactId>web-container-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,38 @@
package de.nbscloud.dashboard;
import de.nbscloud.webcontainer.registry.App;
import de.nbscloud.webcontainer.registry.AppRegistry;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class DashboardApp implements App, InitializingBean {
@Autowired
private AppRegistry appRegistry;
@Override
public String getId() {
return "dashboard";
}
@Override
public String getIcon() {
return null;
}
@Override
public String getStartPath() {
return this.getId();
}
@Override
public int getIndex() {
return 0;
}
@Override
public void afterPropertiesSet() throws Exception {
this.appRegistry.registerApp(this);
}
}

View File

@@ -0,0 +1,27 @@
package de.nbscloud.dashboard.controller;
import de.nbscloud.webcontainer.registry.AppRegistry;
import de.nbscloud.webcontainer.shared.config.WebContainerSharedConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpServletRequest;
@Controller
public class DashboardController {
@Autowired
private WebContainerSharedConfig webContainerSharedConfig;
@Autowired
private AppRegistry appRegistry;
@GetMapping("/dashboard")
public String start(Model model, HttpServletRequest httpServletRequest, String sortOrder) {
model.addAttribute("apps", this.appRegistry.getAll());
this.webContainerSharedConfig.addDefaults(model);
return "dashboard/index";
}
}

View File

@@ -0,0 +1,3 @@
#content-container {
padding-top: 2em;
}

View File

@@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="#{nbscloud.dashboard.index.title}"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link th:if="${darkMode}" rel="stylesheet" th:href="@{/css/darkModeColors.css}" />
<link th:if="${!darkMode}" rel="stylesheet" th:href="@{/css/lightModeColors.css}" />
<link rel="stylesheet" th:href="@{/css/main.css}" />
<link rel="stylesheet" th:href="@{/css/dashboard_main.css}" />
<link rel="shortcut icon" th:href="@{/favicon.ico}" />
</head>
<body>
<div id="main-container">
<div th:replace="includes/header :: header"/>
<div id="content-container">
Welcome to nbscloud
</div>
<div th:replace="includes/footer :: footer"/>
</div>
</body>
</html>