From da26344b26ff709105e7873618215fe69dc26096 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Thu, 17 Feb 2022 17:07:23 +0000
Subject: [PATCH 001/201] Java 17 2022 Update (#1)
* Docker instructions deleted.
* Introduced constants, fixed sonar issues, optimized imports.
* Updated libraries
* Fixed main storage name
* Update README.md
* Fixed some exception handling issues.
Revisited Java API layout.
Some fixes in JS.
* update artifact to 1.9.0
* ignore idea
* ignore target
* Update .gitignore
* bump libs and java 17
Co-authored-by: Rudolf Barbu
Co-authored-by: Rudolf Barbu <64309120+Rudolf-Barbu@users.noreply.github.com>
---
.gitignore | 5 +
Dockerfile | 26 -
README.md | 27 +-
pom.xml | 14 +-
setup.ini | 5 +
src/main/java/org/bsoftware/ward/Ward.java | 3 +-
.../ward/components/ServletComponent.java | 7 +-
.../ward/components/UtilitiesComponent.java | 26 +-
.../ward/controllers/ErrorController.java | 14 +-
.../ward/controllers/IndexController.java | 5 +-
.../ward/controllers/InfoController.java | 6 +-
.../ward/controllers/SetupController.java | 11 +-
.../ward/controllers/UptimeController.java | 39 ++
.../ward/controllers/UsageController.java | 5 +-
.../java/org/bsoftware/ward/dto/ErrorDto.java | 3 +-
.../java/org/bsoftware/ward/dto/InfoDto.java | 15 -
.../org/bsoftware/ward/dto/ProjectDto.java | 20 -
.../org/bsoftware/ward/dto/ResponseDto.java | 2 +-
.../java/org/bsoftware/ward/dto/SetupDto.java | 9 +-
...ApplicationAlreadyConfiguredException.java | 18 +
...=> ApplicationNotConfiguredException.java} | 4 +-
.../handlers/ControllerExceptionHandler.java | 31 +-
.../bsoftware/ward/services/ErrorService.java | 5 +-
.../bsoftware/ward/services/IndexService.java | 44 +-
.../bsoftware/ward/services/InfoService.java | 105 +---
.../bsoftware/ward/services/SetupService.java | 39 +-
.../ward/services/UptimeService.java | 32 ++
.../bsoftware/ward/services/UsageService.java | 7 +-
src/main/resources/static/css/dimensions.css | 467 +++++++++---------
src/main/resources/static/js/globals.js | 5 +
src/main/resources/static/js/index.js | 37 +-
src/main/resources/templates/index.html | 14 +-
32 files changed, 555 insertions(+), 495 deletions(-)
create mode 100644 .gitignore
delete mode 100644 Dockerfile
create mode 100644 setup.ini
create mode 100644 src/main/java/org/bsoftware/ward/controllers/UptimeController.java
delete mode 100644 src/main/java/org/bsoftware/ward/dto/ProjectDto.java
create mode 100644 src/main/java/org/bsoftware/ward/exceptions/ApplicationAlreadyConfiguredException.java
rename src/main/java/org/bsoftware/ward/exceptions/{ApplicationNotSetUpException.java => ApplicationNotConfiguredException.java} (73%)
create mode 100644 src/main/java/org/bsoftware/ward/services/UptimeService.java
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..309b8748
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+# Default ignored files
+.idea/
+target/
+*.iml
+.vscode/
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index c434afbb..00000000
--- a/Dockerfile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Base image with maven installed already
-FROM maven:3.6.3-jdk-8 as builder
-
-# Copy whole project inside docker
-COPY . .
-
-# Build project
-RUN mvn clean package
-
-
-# Base image containing OpenJDK 8, maintained by RedHat
-FROM openjdk:8-jre-alpine
-
-# Update apt repo and install sudo package
-RUN apk update && \
- apk add --no-cache dmidecode eudev && \
- rm -rf /var/cache/apk/*
-
-# Copy jar and pom from builder image to working directory
-COPY --from=builder target/*.jar /ward.jar
-COPY --from=builder pom.xml /pom.xml
-
-EXPOSE 4000
-
-# Run jar as sudo user on entry point
-ENTRYPOINT java -jar ward.jar
diff --git a/README.md b/README.md
index fe07555e..58cd8183 100644
--- a/README.md
+++ b/README.md
@@ -109,27 +109,20 @@ Ward works nice on all popular operating systems, because it uses [OSHI](https:/
---
### Installation
+
Create your own jar
- 1. Clone the project
- 2. Import project in your IDE as Maven project
- 3. mvn clean package
- 4. jar will be in the target folder
+ 1. Clone or dowload this github repository
+ 2. cd into directory with copy of this repository
+ 3. docker build -t ward/ward .
+ 4. docker run --rm -it --name ward -p 4000:4000 -p : --privileged ward
+ 5. Go to localhost:4000 in web browser, input the same application port
+ 6. If you get error after being redirected to application port try hitting refresh
Run jar file
- 1. Create you own jar as described above
- 2. Execute jar on Windows or Linux with administrative rights
- 3. Enter localhost:4000 and set up application
-
-
-
- Build for Docker
-
- 1. Clone the project
- 2. docker build --tag ward
- 3. docker run --rm -it --name ward -p 4000:4000 -p : --privileged ward
- 4. Go to localhost:4000 in web browser, input the same application port
- 5. If you get error after being redirected to application port try hitting refresh
+ • Create you own jar as described above
+ • Execute jar on Windows or Linux with administrative rights
+ • Enter localhost:4000 and set up application
diff --git a/pom.xml b/pom.xml
index 994affe0..8ea5b875 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,21 +4,21 @@
4.0.0org.b-softwareward
- 1.8.8
+ 2.0.0jarorg.springframework.bootspring-boot-starter-parent
- 2.4.0
+ 2.6.3
- 5.3.6
- 5.6.0
- 1.18.16
+ 6.1.2
+ 5.10.0
+ 1.18.220.5.4
@@ -65,6 +65,8 @@
+ ${project.basedir}/target
+ ${project.build.directory}/classesorg.springframework.boot
@@ -72,4 +74,4 @@
-
\ No newline at end of file
+
diff --git a/setup.ini b/setup.ini
new file mode 100644
index 00000000..c8702c95
--- /dev/null
+++ b/setup.ini
@@ -0,0 +1,5 @@
+[setup]
+serverName = antony
+theme = light
+port = 5000
+
diff --git a/src/main/java/org/bsoftware/ward/Ward.java b/src/main/java/org/bsoftware/ward/Ward.java
index 6c4360e9..7afd55f6 100644
--- a/src/main/java/org/bsoftware/ward/Ward.java
+++ b/src/main/java/org/bsoftware/ward/Ward.java
@@ -6,6 +6,7 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
+
import java.io.File;
/**
@@ -43,7 +44,7 @@ public class Ward extends SpringBootServletInitializer
*
* @param args Spring Boot application arguments
*/
- public static void main(String[] args)
+ public static void main(final String[] args)
{
isFirstLaunch = true;
configurableApplicationContext = SpringApplication.run(Ward.class, args);
diff --git a/src/main/java/org/bsoftware/ward/components/ServletComponent.java b/src/main/java/org/bsoftware/ward/components/ServletComponent.java
index bb28a6d7..e3e4af71 100644
--- a/src/main/java/org/bsoftware/ward/components/ServletComponent.java
+++ b/src/main/java/org/bsoftware/ward/components/ServletComponent.java
@@ -5,7 +5,7 @@
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.stereotype.Component;
-import java.io.File;
+
import java.io.IOException;
/**
@@ -29,14 +29,13 @@ public class ServletComponent implements WebServerFactoryCustomizer getInfo() throws Exception
+ public ResponseEntity getInfo() throws ApplicationNotConfiguredException
{
return new ResponseEntity<>(infoService.getInfo(), HttpStatus.OK);
}
diff --git a/src/main/java/org/bsoftware/ward/controllers/SetupController.java b/src/main/java/org/bsoftware/ward/controllers/SetupController.java
index dd3e7ac4..4ba0c736 100644
--- a/src/main/java/org/bsoftware/ward/controllers/SetupController.java
+++ b/src/main/java/org/bsoftware/ward/controllers/SetupController.java
@@ -1,12 +1,19 @@
package org.bsoftware.ward.controllers;
+import org.bsoftware.ward.dto.ResponseDto;
import org.bsoftware.ward.dto.SetupDto;
+import org.bsoftware.ward.exceptions.ApplicationAlreadyConfiguredException;
import org.bsoftware.ward.services.SetupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
import javax.validation.Valid;
+import java.io.IOException;
/**
* SetupController displays responses from rest API
@@ -32,7 +39,7 @@ public class SetupController
* @return ResponseEntity to servlet
*/
@PostMapping
- public ResponseEntity> postSetup(@RequestBody @Valid SetupDto setupDto) throws Exception
+ public ResponseEntity postSetup(@RequestBody @Valid final SetupDto setupDto) throws IOException, ApplicationAlreadyConfiguredException
{
return new ResponseEntity<>(setupService.postSetup(setupDto), HttpStatus.OK);
}
diff --git a/src/main/java/org/bsoftware/ward/controllers/UptimeController.java b/src/main/java/org/bsoftware/ward/controllers/UptimeController.java
new file mode 100644
index 00000000..e0539055
--- /dev/null
+++ b/src/main/java/org/bsoftware/ward/controllers/UptimeController.java
@@ -0,0 +1,39 @@
+package org.bsoftware.ward.controllers;
+
+import org.bsoftware.ward.dto.UptimeDto;
+import org.bsoftware.ward.services.UptimeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * SetupController displays responses from rest API
+ *
+ * @author Rudolf Barbu
+ * @version 1.0.0
+ */
+@RestController
+@RequestMapping(value = "/api/uptime")
+public class UptimeController
+{
+ /**
+ * Autowired UptimeService object
+ * Used for getting uptime information
+ */
+ @Autowired
+ private UptimeService uptimeService;
+
+ /**
+ * Get request to display uptime information
+ *
+ * @return ResponseEntity to servlet
+ */
+ @GetMapping
+ public ResponseEntity getUptime()
+ {
+ return new ResponseEntity<>(uptimeService.getUptime(), HttpStatus.OK);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/bsoftware/ward/controllers/UsageController.java b/src/main/java/org/bsoftware/ward/controllers/UsageController.java
index 3147dcac..a5cf2acf 100644
--- a/src/main/java/org/bsoftware/ward/controllers/UsageController.java
+++ b/src/main/java/org/bsoftware/ward/controllers/UsageController.java
@@ -1,6 +1,7 @@
package org.bsoftware.ward.controllers;
-import org.bsoftware.ward.exceptions.ApplicationNotSetUpException;
+import org.bsoftware.ward.dto.UsageDto;
+import org.bsoftware.ward.exceptions.ApplicationNotConfiguredException;
import org.bsoftware.ward.services.UsageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
@@ -32,7 +33,7 @@ public class UsageController
* @return ResponseEntity to servlet
*/
@GetMapping
- public ResponseEntity> getUsage() throws ApplicationNotSetUpException
+ public ResponseEntity getUsage() throws ApplicationNotConfiguredException
{
return new ResponseEntity<>(usageService.getUsage(), HttpStatus.OK);
}
diff --git a/src/main/java/org/bsoftware/ward/dto/ErrorDto.java b/src/main/java/org/bsoftware/ward/dto/ErrorDto.java
index b8c3f1e4..693e65bf 100644
--- a/src/main/java/org/bsoftware/ward/dto/ErrorDto.java
+++ b/src/main/java/org/bsoftware/ward/dto/ErrorDto.java
@@ -1,6 +1,7 @@
package org.bsoftware.ward.dto;
import lombok.Getter;
+
import java.time.LocalDateTime;
/**
@@ -32,7 +33,7 @@ public final class ErrorDto
*
* @param exception thrown exception
*/
- public ErrorDto(Exception exception)
+ public ErrorDto(final Exception exception)
{
this.errMessage = exception.getMessage();
this.exceptionName = exception.getClass().getName();
diff --git a/src/main/java/org/bsoftware/ward/dto/InfoDto.java b/src/main/java/org/bsoftware/ward/dto/InfoDto.java
index 791ded84..50ad7949 100644
--- a/src/main/java/org/bsoftware/ward/dto/InfoDto.java
+++ b/src/main/java/org/bsoftware/ward/dto/InfoDto.java
@@ -27,19 +27,4 @@ public class InfoDto
* Storage info dto field
*/
private StorageDto storage;
-
- /**
- * Uptime info dto field
- */
- private UptimeDto uptime;
-
- /**
- * Setup info dto field
- */
- private SetupDto setup;
-
- /**
- * Maven info dto field
- */
- private ProjectDto project;
}
\ No newline at end of file
diff --git a/src/main/java/org/bsoftware/ward/dto/ProjectDto.java b/src/main/java/org/bsoftware/ward/dto/ProjectDto.java
deleted file mode 100644
index c024417a..00000000
--- a/src/main/java/org/bsoftware/ward/dto/ProjectDto.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.bsoftware.ward.dto;
-
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * MavenDto is a values container for presenting maven fields information
- *
- * @author Rudolf Barbu
- * @version 1.0.0
- */
-@Getter
-@Setter
-public class ProjectDto
-{
- /**
- * Project version field
- */
- private String version;
-}
\ No newline at end of file
diff --git a/src/main/java/org/bsoftware/ward/dto/ResponseDto.java b/src/main/java/org/bsoftware/ward/dto/ResponseDto.java
index 3f27c5c1..d4af1dc5 100644
--- a/src/main/java/org/bsoftware/ward/dto/ResponseDto.java
+++ b/src/main/java/org/bsoftware/ward/dto/ResponseDto.java
@@ -21,7 +21,7 @@ public final class ResponseDto
*
* @param message message to display
*/
- public ResponseDto(String message)
+ public ResponseDto(final String message)
{
this.message = message;
}
diff --git a/src/main/java/org/bsoftware/ward/dto/SetupDto.java b/src/main/java/org/bsoftware/ward/dto/SetupDto.java
index e638dc29..0b5915e7 100644
--- a/src/main/java/org/bsoftware/ward/dto/SetupDto.java
+++ b/src/main/java/org/bsoftware/ward/dto/SetupDto.java
@@ -1,10 +1,14 @@
package org.bsoftware.ward.dto;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
-import javax.validation.constraints.*;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
/**
* SetupDto is a values container for setup data
@@ -14,7 +18,6 @@
*/
@Getter
@Setter
-@JsonIgnoreProperties(value = {"theme", "port"}, allowSetters = true)
public class SetupDto
{
/**
diff --git a/src/main/java/org/bsoftware/ward/exceptions/ApplicationAlreadyConfiguredException.java b/src/main/java/org/bsoftware/ward/exceptions/ApplicationAlreadyConfiguredException.java
new file mode 100644
index 00000000..274a42f1
--- /dev/null
+++ b/src/main/java/org/bsoftware/ward/exceptions/ApplicationAlreadyConfiguredException.java
@@ -0,0 +1,18 @@
+package org.bsoftware.ward.exceptions;
+
+/**
+ * ApplicationAlreadyConfiguredException indicates that user tried to access api, when application is already configured
+ *
+ * @author Rudolf Barbu
+ * @version 1.0.0
+ */
+public class ApplicationAlreadyConfiguredException extends Exception
+{
+ /**
+ * Call super class with exception message
+ */
+ public ApplicationAlreadyConfiguredException()
+ {
+ super("Application already configured");
+ }
+}
diff --git a/src/main/java/org/bsoftware/ward/exceptions/ApplicationNotSetUpException.java b/src/main/java/org/bsoftware/ward/exceptions/ApplicationNotConfiguredException.java
similarity index 73%
rename from src/main/java/org/bsoftware/ward/exceptions/ApplicationNotSetUpException.java
rename to src/main/java/org/bsoftware/ward/exceptions/ApplicationNotConfiguredException.java
index 41c7bd1e..70cb4bc8 100644
--- a/src/main/java/org/bsoftware/ward/exceptions/ApplicationNotSetUpException.java
+++ b/src/main/java/org/bsoftware/ward/exceptions/ApplicationNotConfiguredException.java
@@ -6,12 +6,12 @@
* @author Rudolf Barbu
* @version 1.0.0
*/
-public final class ApplicationNotSetUpException extends Exception
+public final class ApplicationNotConfiguredException extends Exception
{
/**
* Call super class with exception message
*/
- public ApplicationNotSetUpException()
+ public ApplicationNotConfiguredException()
{
super("Set up application first");
}
diff --git a/src/main/java/org/bsoftware/ward/handlers/ControllerExceptionHandler.java b/src/main/java/org/bsoftware/ward/handlers/ControllerExceptionHandler.java
index 76650ca6..b6ed9bb5 100644
--- a/src/main/java/org/bsoftware/ward/handlers/ControllerExceptionHandler.java
+++ b/src/main/java/org/bsoftware/ward/handlers/ControllerExceptionHandler.java
@@ -2,17 +2,21 @@
import org.bsoftware.ward.components.UtilitiesComponent;
import org.bsoftware.ward.dto.ErrorDto;
-import org.bsoftware.ward.exceptions.ApplicationNotSetUpException;
+import org.bsoftware.ward.exceptions.ApplicationAlreadyConfiguredException;
+import org.bsoftware.ward.exceptions.ApplicationNotConfiguredException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
+import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.ui.Model;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
+
import java.io.IOException;
/**
@@ -33,35 +37,36 @@ public class ControllerExceptionHandler
private UtilitiesComponent utilitiesComponent;
/**
- * Handles ApplicationNotSetUpException, then it thrown
+ * Handles exceptions with BAD_REQUEST status, then they thrown
*/
@ResponseBody
- @ExceptionHandler(value = ApplicationNotSetUpException.class)
- public ResponseEntity> applicationNotSetUpExceptionHandler(ApplicationNotSetUpException applicationNotSetUpException)
+ @ExceptionHandler(value = {ApplicationNotConfiguredException.class, ApplicationAlreadyConfiguredException.class})
+ public ResponseEntity applicationNotSetUpExceptionHandler(final Exception exception)
{
- return new ResponseEntity<>(new ErrorDto(applicationNotSetUpException), HttpStatus.BAD_REQUEST);
+ return new ResponseEntity<>(new ErrorDto(exception), HttpStatus.BAD_REQUEST);
}
/**
- * Handles MethodArgumentNotValidException, then it thrown
+ * Handles exceptions with UNPROCESSABLE_ENTITY status, then they thrown
*/
@ResponseBody
- @ExceptionHandler(value = MethodArgumentNotValidException.class)
- public ResponseEntity> methodArgumentNotValidExceptionHandler(MethodArgumentNotValidException methodArgumentNotValidException)
+ @ExceptionHandler(value = {MethodArgumentNotValidException.class, HttpMessageNotReadableException.class})
+ public ResponseEntity methodArgumentNotValidExceptionHandler(final Exception exception)
{
- return new ResponseEntity<>(new ErrorDto(methodArgumentNotValidException), HttpStatus.UNPROCESSABLE_ENTITY);
+ return new ResponseEntity<>(new ErrorDto(exception), HttpStatus.UNPROCESSABLE_ENTITY);
}
/**
- * Handles all other servlet exceptions, which were not handled by others handlers
+ * Handles MethodArgumentNotValidException, then it thrown
+ * Also handles all other servlet exceptions, which were not handled by others handlers
*
* @throws IOException if ini file is unreachable
*/
@ExceptionHandler(value = Exception.class)
- public String exceptionHandler(Model model) throws IOException
+ public String exceptionHandler(final Exception exception, final Model model) throws IOException
{
- model.addAttribute("theme", utilitiesComponent.getThemeName());
+ model.addAttribute("theme", utilitiesComponent.getFromIniFile("theme"));
- return "error/500";
+ return (exception instanceof HttpRequestMethodNotSupportedException) ? "error/404" : "error/500";
}
}
\ No newline at end of file
diff --git a/src/main/java/org/bsoftware/ward/services/ErrorService.java b/src/main/java/org/bsoftware/ward/services/ErrorService.java
index adbb80d0..45b700d6 100644
--- a/src/main/java/org/bsoftware/ward/services/ErrorService.java
+++ b/src/main/java/org/bsoftware/ward/services/ErrorService.java
@@ -5,6 +5,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
+
import java.io.IOException;
/**
@@ -30,14 +31,14 @@ public class ErrorService
* @return template name
* @throws IOException if ini file is unreachable
*/
- public String getError(Model model) throws IOException
+ public String getError(final Model model) throws IOException
{
if (Ward.isFirstLaunch())
{
return "setup";
}
- model.addAttribute("theme", utilitiesComponent.getThemeName());
+ model.addAttribute("theme", utilitiesComponent.getFromIniFile("theme"));
return "error/404";
}
}
\ No newline at end of file
diff --git a/src/main/java/org/bsoftware/ward/services/IndexService.java b/src/main/java/org/bsoftware/ward/services/IndexService.java
index adeaa1b3..1a10ae6e 100644
--- a/src/main/java/org/bsoftware/ward/services/IndexService.java
+++ b/src/main/java/org/bsoftware/ward/services/IndexService.java
@@ -2,10 +2,15 @@
import org.bsoftware.ward.Ward;
import org.bsoftware.ward.components.UtilitiesComponent;
+import org.bsoftware.ward.exceptions.ApplicationNotConfiguredException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
/**
* IndexService displays index page of Ward application
*
@@ -22,6 +27,13 @@ public class IndexService
@Autowired
private InfoService infoService;
+ /**
+ * Autowired UptimeService object
+ * Used for getting uptime for html template
+ */
+ @Autowired
+ private UptimeService uptimeService;
+
/**
* Autowired UtilitiesComponent object
* Used for various utility functions
@@ -29,21 +41,49 @@ public class IndexService
@Autowired
private UtilitiesComponent utilitiesComponent;
+ /**
+ * Gets project version information
+ *
+ * @return MavenDto with filled field
+ * @throws IOException if file does not exists
+ */
+ private String getVersion() throws IOException
+ {
+ Properties properties = new Properties();
+ InputStream inputStream = getClass().getResourceAsStream("/META-INF/maven/org.b-software/ward/pom.properties");
+
+ if (inputStream != null)
+ {
+ properties.load(inputStream);
+ String version = properties.getProperty("version");
+
+ return "Ward: v" + version;
+ }
+ else
+ {
+ return "Developer mode";
+ }
+ }
+
/**
* Fills model and returns template name
*
* @param model strings container
* @return template name
*/
- public String getIndex(Model model) throws Exception
+ public String getIndex(final Model model) throws IOException, ApplicationNotConfiguredException
{
if (Ward.isFirstLaunch())
{
return "setup";
}
+ model.addAttribute("theme", utilitiesComponent.getFromIniFile("theme"));
+ model.addAttribute("serverName", utilitiesComponent.getFromIniFile("serverName"));
+
model.addAttribute("info", infoService.getInfo());
- model.addAttribute("theme", utilitiesComponent.getThemeName());
+ model.addAttribute("uptime", uptimeService.getUptime());
+ model.addAttribute("version", getVersion());
return "index";
}
diff --git a/src/main/java/org/bsoftware/ward/services/InfoService.java b/src/main/java/org/bsoftware/ward/services/InfoService.java
index c1e59778..c4291d7c 100644
--- a/src/main/java/org/bsoftware/ward/services/InfoService.java
+++ b/src/main/java/org/bsoftware/ward/services/InfoService.java
@@ -2,17 +2,25 @@
import org.bsoftware.ward.Ward;
import org.bsoftware.ward.components.UtilitiesComponent;
-import org.bsoftware.ward.dto.*;
-import org.bsoftware.ward.exceptions.ApplicationNotSetUpException;
+import org.bsoftware.ward.dto.InfoDto;
+import org.bsoftware.ward.dto.MachineDto;
+import org.bsoftware.ward.dto.ProcessorDto;
+import org.bsoftware.ward.dto.StorageDto;
+import org.bsoftware.ward.exceptions.ApplicationNotConfiguredException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import oshi.SystemInfo;
-import oshi.hardware.*;
+import oshi.hardware.CentralProcessor;
+import oshi.hardware.GlobalMemory;
+import oshi.hardware.HWDiskStore;
+import oshi.hardware.PhysicalMemory;
import oshi.software.os.OperatingSystem;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Optional;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
/**
* InfoService provides various information about machine, such as processor name, core count, Ram amount, etc.
@@ -43,7 +51,7 @@ public class InfoService
* @param hertzArray raw frequency array values in hertz for each logical processor
* @return String with formatted frequency and postfix
*/
- private String getConvertedFrequency(long[] hertzArray)
+ private String getConvertedFrequency(final long[] hertzArray)
{
long totalFrequency = Arrays.stream(hertzArray).sum();
long hertz = totalFrequency / hertzArray.length;
@@ -64,7 +72,7 @@ private String getConvertedFrequency(long[] hertzArray)
* @param bits raw capacity value in bits
* @return String with formatted capacity and postfix
*/
- private String getConvertedCapacity(long bits)
+ private String getConvertedCapacity(final long bits)
{
if ((bits / 1.049E+6) > 999)
{
@@ -105,8 +113,8 @@ private ProcessorDto getProcessor()
processorDto.setCoreCount(coreCount + ((coreCount > 1) ? " Cores" : " Core"));
processorDto.setClockSpeed(getConvertedFrequency(centralProcessor.getCurrentFreq()));
- String BitDepthPrefix = centralProcessor.getProcessorIdentifier().isCpu64bit() ? "64" : "32";
- processorDto.setBitDepth(BitDepthPrefix + "-bit");
+ String bitDepthPrefix = centralProcessor.getProcessorIdentifier().isCpu64bit() ? "64" : "32";
+ processorDto.setBitDepth(bitDepthPrefix + "-bit");
return processorDto;
}
@@ -159,10 +167,11 @@ private StorageDto getStorage()
if (hwDiskStoreOptional.isPresent())
{
String mainStorage = hwDiskStoreOptional.get().getModel();
+ Matcher matcher = Pattern.compile("\\(.{1,15} .{1,15} .{1,15}\\)").matcher(mainStorage);
- if (mainStorage.contains("(Standard disk drives)"))
+ if (matcher.find())
{
- mainStorage = mainStorage.substring(0, mainStorage.indexOf("(Standard disk drives)") - 1);
+ mainStorage = mainStorage.substring(0, matcher.start() - 1);
}
storageDto.setMainStorage(mainStorage.trim());
@@ -183,75 +192,12 @@ private StorageDto getStorage()
return storageDto;
}
- /**
- * Gets uptime information
- *
- * @return UptimeDto with filled fields
- */
- @SuppressWarnings(value = "IntegerDivisionInFloatingPointContext")
- private UptimeDto getUptime()
- {
- UptimeDto uptimeDto = new UptimeDto();
-
- long uptimeInSeconds = systemInfo.getOperatingSystem().getSystemUptime();
-
- uptimeDto.setDays(String.format("%02d", (int) Math.floor(uptimeInSeconds / 86400)));
- uptimeDto.setHours(String.format("%02d", (int) Math.floor((uptimeInSeconds % 86400) / 3600)));
- uptimeDto.setMinutes(String.format("%02d", (int) Math.floor((uptimeInSeconds / 60) % 60)));
- uptimeDto.setSeconds(String.format("%02d", (int) Math.floor(uptimeInSeconds % 60)));
-
- return uptimeDto;
- }
-
- /**
- * Gets server name information
- *
- * @return SetupDto with filled field
- * @throws IOException if file does not exists
- */
- private SetupDto getSetup() throws IOException
- {
- SetupDto setupDto = new SetupDto();
- File file = new File(Ward.SETUP_FILE_PATH);
-
- setupDto.setServerName(utilitiesComponent.getFromIniFile(file, "setup", "serverName"));
-
- return setupDto;
- }
-
- /**
- * Gets project version information
- *
- * @return MavenDto with filled field
- * @throws IOException if file does not exists
- */
- private ProjectDto getProject() throws IOException
- {
- ProjectDto projectDto = new ProjectDto();
- Properties properties = new Properties();
- InputStream inputStream = getClass().getResourceAsStream("/META-INF/maven/org.b-software/ward/pom.properties");
-
- if (inputStream != null)
- {
- properties.load(inputStream);
- String version = properties.getProperty("version");
-
- projectDto.setVersion("Ward: v" + version);
- }
- else
- {
- projectDto.setVersion("Developer mode");
- }
-
- return projectDto;
- }
-
/**
* Used to deliver dto to corresponding controller
*
* @return InfoDto filled with server info
*/
- public InfoDto getInfo() throws Exception
+ public InfoDto getInfo() throws ApplicationNotConfiguredException
{
if (!Ward.isFirstLaunch())
{
@@ -260,15 +206,12 @@ public InfoDto getInfo() throws Exception
infoDto.setProcessor(getProcessor());
infoDto.setMachine(getMachine());
infoDto.setStorage(getStorage());
- infoDto.setUptime(getUptime());
- infoDto.setSetup(getSetup());
- infoDto.setProject(getProject());
return infoDto;
}
else
{
- throw new ApplicationNotSetUpException();
+ throw new ApplicationNotConfiguredException();
}
}
}
\ No newline at end of file
diff --git a/src/main/java/org/bsoftware/ward/services/SetupService.java b/src/main/java/org/bsoftware/ward/services/SetupService.java
index 4015ae43..3835243e 100644
--- a/src/main/java/org/bsoftware/ward/services/SetupService.java
+++ b/src/main/java/org/bsoftware/ward/services/SetupService.java
@@ -3,8 +3,10 @@
import org.bsoftware.ward.Ward;
import org.bsoftware.ward.dto.ResponseDto;
import org.bsoftware.ward.dto.SetupDto;
+import org.bsoftware.ward.exceptions.ApplicationAlreadyConfiguredException;
import org.ini4j.Ini;
import org.springframework.stereotype.Service;
+
import java.io.File;
import java.io.IOException;
@@ -17,22 +19,22 @@
@Service
public class SetupService
{
+ /**
+ * Constant, that providing setup section name
+ */
+ private static final String SECTION_NAME = "setup";
+
/**
* Puts new data in ini file
*
* @param file ini file
- * @param sectionName section in ini file
* @param optionName option in section
* @throws IOException if file does not exists
*/
- @SuppressWarnings(value = {"ResultOfMethodCallIgnored", "SameParameterValue"})
- private void putInIniFile(File file, String sectionName, String optionName, String value) throws IOException
+ private void putInIniFile(final File file, final String optionName, final String value) throws IOException
{
- file.createNewFile();
Ini ini = new Ini(file);
-
- ini.put(sectionName, optionName, value);
-
+ ini.put(SECTION_NAME, optionName, value);
ini.store();
}
@@ -41,19 +43,30 @@ private void putInIniFile(File file, String sectionName, String optionName, Stri
*
* @param setupDto user settings data
* @return ResponseEntityWrapperAsset filled with ResponseDto
- * @throws Exception IoException if file is fot found, and cant be created
+ * @throws IOException IoException if file is fot found, and cant be created
*/
- public ResponseDto postSetup(SetupDto setupDto) throws Exception
+ public ResponseDto postSetup(final SetupDto setupDto) throws IOException, ApplicationAlreadyConfiguredException
{
if (Ward.isFirstLaunch())
{
File file = new File(Ward.SETUP_FILE_PATH);
- putInIniFile(file, "setup", "serverName", setupDto.getServerName());
- putInIniFile(file, "setup", "theme", setupDto.getTheme());
- putInIniFile(file, "setup", "port", setupDto.getPort());
+ if (file.createNewFile())
+ {
+ putInIniFile(file, "serverName", setupDto.getServerName());
+ putInIniFile(file, "theme", setupDto.getTheme());
+ putInIniFile(file, "port", setupDto.getPort());
- Ward.restart();
+ Ward.restart();
+ }
+ else
+ {
+ throw new IOException();
+ }
+ }
+ else
+ {
+ throw new ApplicationAlreadyConfiguredException();
}
return new ResponseDto("Settings saved correctly");
diff --git a/src/main/java/org/bsoftware/ward/services/UptimeService.java b/src/main/java/org/bsoftware/ward/services/UptimeService.java
new file mode 100644
index 00000000..d5d57a2f
--- /dev/null
+++ b/src/main/java/org/bsoftware/ward/services/UptimeService.java
@@ -0,0 +1,32 @@
+package org.bsoftware.ward.services;
+
+import org.bsoftware.ward.dto.UptimeDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import oshi.SystemInfo;
+
+@Service
+public class UptimeService
+{
+ @Autowired
+ private SystemInfo systemInfo;
+
+ /**
+ * Gets uptime information
+ *
+ * @return UptimeDto with filled fields
+ */
+ public UptimeDto getUptime()
+ {
+ UptimeDto uptimeDto = new UptimeDto();
+
+ long uptimeInSeconds = systemInfo.getOperatingSystem().getSystemUptime();
+
+ uptimeDto.setDays(String.format("%02d", (int) uptimeInSeconds / 86400));
+ uptimeDto.setHours(String.format("%02d", (int) (uptimeInSeconds % 86400) / 3600));
+ uptimeDto.setMinutes(String.format("%02d", (int) (uptimeInSeconds / 60) % 60));
+ uptimeDto.setSeconds(String.format("%02d", (int) uptimeInSeconds % 60));
+
+ return uptimeDto;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/bsoftware/ward/services/UsageService.java b/src/main/java/org/bsoftware/ward/services/UsageService.java
index 0457f386..90d42214 100644
--- a/src/main/java/org/bsoftware/ward/services/UsageService.java
+++ b/src/main/java/org/bsoftware/ward/services/UsageService.java
@@ -2,7 +2,7 @@
import org.bsoftware.ward.Ward;
import org.bsoftware.ward.dto.UsageDto;
-import org.bsoftware.ward.exceptions.ApplicationNotSetUpException;
+import org.bsoftware.ward.exceptions.ApplicationNotConfiguredException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import oshi.SystemInfo;
@@ -11,6 +11,7 @@
import oshi.software.os.FileSystem;
import oshi.software.os.OSFileStore;
import oshi.util.Util;
+
import java.util.Arrays;
/**
@@ -86,7 +87,7 @@ private int getStorage()
*
* @return ResponseEntityWrapperAsset filled with usageDto
*/
- public UsageDto getUsage() throws ApplicationNotSetUpException
+ public UsageDto getUsage() throws ApplicationNotConfiguredException
{
if (!Ward.isFirstLaunch())
{
@@ -100,7 +101,7 @@ public UsageDto getUsage() throws ApplicationNotSetUpException
}
else
{
- throw new ApplicationNotSetUpException();
+ throw new ApplicationNotConfiguredException();
}
}
}
\ No newline at end of file
diff --git a/src/main/resources/static/css/dimensions.css b/src/main/resources/static/css/dimensions.css
index 7384ab68..5a7cb714 100644
--- a/src/main/resources/static/css/dimensions.css
+++ b/src/main/resources/static/css/dimensions.css
@@ -12,253 +12,252 @@
By example: --height-body
*/
-:root
-{
- /* top */
- --top-logo: 2.188rem;
- --top-logo-description: 5.300rem;
- --top-clouds-first: 2.875rem;
- --top-clouds-second: 2.875rem;
- --top-main-settings-input: 0.125rem;
- --top-main-settings-underline: 0.313rem;
- --top-main-settings-select: 0.938rem;
- --top-label-additional-settings: 2.300rem;
- --top-additional-settings: 1.000rem;
- --top-theme-buttons-input: 1.938rem;
- --top-button-squares-grid: 0.222rem;
- --top-port: 2.750rem;
- --top-header: 1.500rem;
- --top-label-hw-info: 0.562rem;
- --top-card-body-squares-grid: 0.813rem;
- --top-info-label: 4.188rem;
- --top-inner-dot: 0.375rem;
- --top-detailed-hw-info-div: 1.168rem;
- --top-controls-img: 0.750rem;
- --top-announcement: 3.813rem;
- --top-contacts-label: 1.500rem;
- --top-contacts-description-first: 3.125rem;
- --top-contacts-description-second: 3.813rem;
- --top-contacts-links-a-img: 4.906rem;
- --top-uptime-rectangle-grid: 1.925rem;
- --top-chart-label: 1.500rem;
- --top-chart-triangle-grid: 0.500rem;
- --top-chart-rectangle-grid: 1.906rem;
- --top-chart-container: 3.375rem;
- --top-code: 1.813rem;
- --top-title: 3.500rem;
- --top-explanation: 6.688rem;
+:root {
+ /* top */
+ --top-logo: 2.188rem;
+ --top-logo-description: 5.3rem;
+ --top-clouds-first: 2.875rem;
+ --top-clouds-second: 2.875rem;
+ --top-main-settings-input: 0.125rem;
+ --top-main-settings-underline: 0.313rem;
+ --top-main-settings-select: 0.938rem;
+ --top-label-additional-settings: 2.3rem;
+ --top-additional-settings: 1rem;
+ --top-theme-buttons-input: 1.938rem;
+ --top-button-squares-grid: 0.222rem;
+ --top-port: 2.75rem;
+ --top-header: 1.5rem;
+ --top-label-hw-info: 0.562rem;
+ --top-card-body-squares-grid: 0.813rem;
+ --top-info-label: 4.188rem;
+ --top-inner-dot: 0.375rem;
+ --top-detailed-hw-info-div: 1.168rem;
+ --top-controls-img: 0.75rem;
+ --top-announcement: 3.813rem;
+ --top-contacts-label: 1.5rem;
+ --top-contacts-description-first: 3.125rem;
+ --top-contacts-description-second: 3.813rem;
+ --top-contacts-links-a-img: 4.906rem;
+ --top-uptime-rectangle-grid: 1.925rem;
+ --top-chart-label: 1.5rem;
+ --top-chart-triangle-grid: 0.5rem;
+ --top-chart-rectangle-grid: 1.906rem;
+ --top-chart-container: 3.375rem;
+ --top-code: 1.813rem;
+ --top-title: 3.5rem;
+ --top-explanation: 6.688rem;
- /* bottom */
- --bottom-form-squares-grid: 0.813rem;
- --bottom-submit: 1.125rem;
- --bottom-usage: 4.625rem;
- --bottom-hw-usage-div: 0.250rem;
- --bottom-card-footer-dots-grid-div: -0.750rem;
- --bottom-uptime-squares-grid: 0.813rem;
- --bottom-values-grid-div-p: 0.250rem;
- --bottom-project-version: 1.250rem;
- --bottom-error-div: 7.500rem;
- --bottom-advice: 0.563rem;
+ /* bottom */
+ --bottom-form-squares-grid: 0.813rem;
+ --bottom-submit: 1.125rem;
+ --bottom-usage: 4.625rem;
+ --bottom-hw-usage-div: 0.25rem;
+ --bottom-card-footer-dots-grid-div: -0.75rem;
+ --bottom-uptime-squares-grid: 0.813rem;
+ --bottom-values-grid-div-p: 0.25rem;
+ --bottom-project-version: 1.25rem;
+ --bottom-error-div: 7.5rem;
+ --bottom-advice: 0.563rem;
- /* left */
- --left-clouds-second: 12.875rem;
- --left-form-squares-grid: 9.250rem;
- --left-main-settings: 1.500rem;
- --left-button-squares-grid-first: 1.500rem;
- --left-button-squares-grid-second: 19.688rem;
- --left-theme-buttons-first: 1.500rem;
- --left-port: 1.500rem;
- --left-submit: 6.563rem;
- --left-header: 1.500rem;
- --left-label-hw-info: 4.375rem;
- --left-usage: 1.500rem;
- --card-footer-dots-grid-first: 2.906rem;
- --card-footer-dots-grid-second: 10.187rem;
- --card-footer-dots-grid-third: 17.468rem;
- --left-inner-dot: 0.375rem;
- --left-detailed-hw-info-first: 0.822rem;
- --left-detailed-hw-info-second: 8.104rem;
- --left-detailed-hw-info-third: 15.385rem;
- --left-dividers-first: 7.313rem;
- --left-dividers-second: 14.563rem;
- --left-controls-first: 0.750rem;
- --left-controls-second: 19.250rem;
- --left-contacts-links-a-first: 8.075rem;
- --left-contacts-links-a-second: 11.700rem;
- --left-uptime-squares-grid: 9.250rem;
- --left-uptime-rectangle-grid: 2.781rem;
- --left-chart-label: 1.500rem;
- --left-chart-triangle-grid-first: 34.375rem;
- --left-chart-triangle-grid-second: 38.250rem;
- --left-chart-triangle-grid-third: 42.125rem;
- --left-chart-rectangle-grid-first: 33.250rem;
- --left-chart-rectangle-grid-second: 37.125rem;
- --left-chart-rectangle-grid-third: 41.000rem;
- --left-chart-container: 1.500rem;
- --left-error-div: 13.250rem;
- --left-code: 1.813rem;
- --left-title: 1.813rem;
- --left-explanation: 1.813rem;
+ /* left */
+ --left-clouds-second: 12.875rem;
+ --left-form-squares-grid: 9.25rem;
+ --left-main-settings: 1.5rem;
+ --left-button-squares-grid-first: 1.5rem;
+ --left-button-squares-grid-second: 19.688rem;
+ --left-theme-buttons-first: 1.5rem;
+ --left-port: 1.5rem;
+ --left-submit: 6.563rem;
+ --left-header: 1.5rem;
+ --left-label-hw-info: 4.375rem;
+ --left-usage: 1.5rem;
+ --card-footer-dots-grid-first: 2.906rem;
+ --card-footer-dots-grid-second: 10.187rem;
+ --card-footer-dots-grid-third: 17.468rem;
+ --left-inner-dot: 0.375rem;
+ --left-detailed-hw-info-first: 0.822rem;
+ --left-detailed-hw-info-second: 8.104rem;
+ --left-detailed-hw-info-third: 15.385rem;
+ --left-dividers-first: 7.313rem;
+ --left-dividers-second: 14.563rem;
+ --left-controls-first: 0.75rem;
+ --left-controls-second: 19.25rem;
+ --left-contacts-links-a-first: 8.075rem;
+ --left-contacts-links-a-second: 11.7rem;
+ --left-uptime-squares-grid: 9.25rem;
+ --left-uptime-rectangle-grid: 2.781rem;
+ --left-chart-label: 1.5rem;
+ --left-chart-triangle-grid-first: 34.375rem;
+ --left-chart-triangle-grid-second: 38.25rem;
+ --left-chart-triangle-grid-third: 42.125rem;
+ --left-chart-rectangle-grid-first: 33.25rem;
+ --left-chart-rectangle-grid-second: 37.125rem;
+ --left-chart-rectangle-grid-third: 41rem;
+ --left-chart-container: 1.5rem;
+ --left-error-div: 13.25rem;
+ --left-code: 1.813rem;
+ --left-title: 1.813rem;
+ --left-explanation: 1.813rem;
- /* margin-right */
- --margin-right-form-squares-grid-div: 0.488rem;
- --margin-right-theme-buttons-first: 1.938rem;
- --margin-right-usage-value: 2.937rem;
- --margin-right-uptime-squares-grid-div: 0.488rem;
- --margin-right-values-grid-div: 0.125rem;
- --margin-right-labels-grid-div: 0.125rem;
+ /* margin-right */
+ --margin-right-form-squares-grid-div: 0.488rem;
+ --margin-right-theme-buttons-first: 1.938rem;
+ --margin-right-usage-value: 2.937rem;
+ --margin-right-uptime-squares-grid-div: 0.488rem;
+ --margin-right-values-grid-div: 0.125rem;
+ --margin-right-labels-grid-div: 0.125rem;
- /* margin-bottom */
- --margin-bottom-label-main-settings: 0.438rem;
- --margin-bottom-card: 1.875rem;
- --margin-bottom-card-body-squares-grid-div: 0.750rem;
- --margin-bottom-labels-grid-div: 0.313rem;
+ /* margin-bottom */
+ --margin-bottom-label-main-settings: 0.438rem;
+ --margin-bottom-card: 1.875rem;
+ --margin-bottom-card-body-squares-grid-div: 0.75rem;
+ --margin-bottom-labels-grid-div: 0.313rem;
- /* height */
- --height-body: 100%;
- --height-setup: 26.706rem;
- --height-setup-div: 26.706rem;
- --height-clouds: 8.281rem;
- --height-clouds-img: 5.438rem;
- --height-background: 8.281rem;
- --height-form: 18.425rem;
- --height-form-squares-grid-div: 0.625rem;
- --height-main-settings: 1.875rem;
- --height-main-settings-underline: 0.313rem;
- --height-main-settings-select: 1.875rem;
- --height-theme-buttons-input: 2.188rem;
- --height-button-squares-grid-div: 0.625rem;;
- --height-port: 3.125rem;
- --height-submit: 1.875rem;
- --height-index-xl: 35.031rem;
- --height-index-lg: 53.438rem;
- --height-index-md: 53.438rem;
- --height-hw-logo: 3.750rem;
- --height-usage: 5.313rem;
- --height-card-body-squares-grid-div: 0.625rem;
- --height-main-hw-info: 100%;
- --height-usage-value-span: 5.800rem;
- --height-usage-underline: 0.313rem;
- --height-footer: 3.125rem;
- --height-card-footer-dots-grid-div: 1.500rem;
- --height-inner-dot: 0.750rem;
- --height-detailed-hw-info-div: 1.063rem;
- --height-dividers-div: 3.125rem;
- --height-controls: 2.625rem;
- --height-controls-img: 1.875rem;
- --height-contacts-links-a-img: 2.125rem;
- --height-uptime: 8.270rem;
- --height-uptime-squares-grid-div: 0.625rem;
- --height-values-grid-div: 3.188rem;
- --height-labels-grid-div: 0.813rem;
- --height-chart-rectangle-grid-div: 0.625rem;
- --height-chart-container: 11.688rem;
- --height-error: 25.750rem;
- --height-error-img: 19.313rem;
- --height-error-div: 12.125rem;
+ /* height */
+ --height-body: 100%;
+ --height-setup: 26.706rem;
+ --height-setup-div: 26.706rem;
+ --height-clouds: 8.281rem;
+ --height-clouds-img: 5.438rem;
+ --height-background: 8.281rem;
+ --height-form: 18.425rem;
+ --height-form-squares-grid-div: 0.625rem;
+ --height-main-settings: 1.875rem;
+ --height-main-settings-underline: 0.313rem;
+ --height-main-settings-select: 1.875rem;
+ --height-theme-buttons-input: 2.188rem;
+ --height-button-squares-grid-div: 0.625rem;
+ --height-port: 3.125rem;
+ --height-submit: 1.875rem;
+ --height-index-xl: 35.031rem;
+ --height-index-lg: 53.438rem;
+ --height-index-md: 53.438rem;
+ --height-hw-logo: 3.75rem;
+ --height-usage: 5.313rem;
+ --height-card-body-squares-grid-div: 0.625rem;
+ --height-main-hw-info: 100%;
+ --height-usage-value-span: 5.8rem;
+ --height-usage-underline: 0.313rem;
+ --height-footer: 3.125rem;
+ --height-card-footer-dots-grid-div: 1.5rem;
+ --height-inner-dot: 0.75rem;
+ --height-detailed-hw-info-div: 1.063rem;
+ --height-dividers-div: 3.125rem;
+ --height-controls: 2.625rem;
+ --height-controls-img: 1.875rem;
+ --height-contacts-links-a-img: 2.125rem;
+ --height-uptime: 8.27rem;
+ --height-uptime-squares-grid-div: 0.625rem;
+ --height-values-grid-div: 3.188rem;
+ --height-labels-grid-div: 0.813rem;
+ --height-chart-rectangle-grid-div: 0.625rem;
+ --height-chart-container: 11.688rem;
+ --height-error: 25.75rem;
+ --height-error-img: 19.313rem;
+ --height-error-div: 12.125rem;
- /* max-height */
- --max-height-card: 16.562rem;
+ /* max-height */
+ --max-height-card: 16.562rem;
- /* min-height */
- --min-height-card: 16.562rem;
+ /* min-height */
+ --min-height-card: 16.562rem;
- /* width */
- --width-body: 100%;
- --width-dhtmlx-message-area 21.875rem;
- --width-setup-div: 21.875rem;
- --width-logo: 21.875rem;
- --width-logo-description: 21.875rem;
- --width-clouds: 21.875rem;
- --width-clouds-img: 4.375rem;
- --width-background: 21.875rem;
- --width-form: 21.875rem;
- --width-form-squares-grid-div: 0.625rem;
- --width-main-settings: 18.875rem;
- --width-main-settings-input: 18.875rem;
- --width-main-settings-underline: 18.875rem;
- --width-main-settings-select: 18.875rem;
- --width-theme-buttons-input: 9.063rem;
- --width-button-squares-grid-div: 0.625rem;
- --width-port: 18.875rem;
- --width-submit: 8.750rem;
- --width-hw-logo: 3.750rem;
- --width-usage: 18.875rem;
- --width-card-body-squares-grid-div: 0.625rem;
- --width-usage-value-span: 2.224rem;
- --width-info-label: 9.500rem;
- --width-usage-underline: 9.500rem;
- --width-footer: 100%;
- --width-card-footer-dots-grid-div: 1.500rem;
- --width-inner-dot: 0.750rem;
- --width-detailed-hw-info-div: 5.625rem;
- --width-dividers-div: 0.063rem;
- --width-controls: 100%;
- --width-controls-img: 1.875rem;
- --width-announcement: 21.875rem;
- --width-contacts-label: 21.875rem;
- --width-contacts-description-div: 21.875rem;
- --width-contacts-links-a-img: 2.125rem;
- --width-uptime: 100%;
- --width-uptime-squares-grid-div: 0.625rem;
- --width-values-grid-div: 3.750rem;
- --width-labels-grid-div: 3.750rem;
- --width-chart-rectangle-grid-div: 3.125rem;
- --width-chart-container: 42.625rem;
- --width-error-img: 19.313rem;
- --width-error-div: 23.875rem;
- --width-advice: 23.875rem;;
+ /* width */
+ --width-body: 100%;
+ --width-dhtmlx-message-area: 21.875rem;
+ --width-setup-div: 21.875rem;
+ --width-logo: 21.875rem;
+ --width-logo-description: 21.875rem;
+ --width-clouds: 21.875rem;
+ --width-clouds-img: 4.375rem;
+ --width-background: 21.875rem;
+ --width-form: 21.875rem;
+ --width-form-squares-grid-div: 0.625rem;
+ --width-main-settings: 18.875rem;
+ --width-main-settings-input: 18.875rem;
+ --width-main-settings-underline: 18.875rem;
+ --width-main-settings-select: 18.875rem;
+ --width-theme-buttons-input: 9.063rem;
+ --width-button-squares-grid-div: 0.625rem;
+ --width-port: 18.875rem;
+ --width-submit: 8.75rem;
+ --width-hw-logo: 3.75rem;
+ --width-usage: 18.875rem;
+ --width-card-body-squares-grid-div: 0.625rem;
+ --width-usage-value-span: 2.224rem;
+ --width-info-label: 9.5rem;
+ --width-usage-underline: 9.5rem;
+ --width-footer: 100%;
+ --width-card-footer-dots-grid-div: 1.5rem;
+ --width-inner-dot: 0.75rem;
+ --width-detailed-hw-info-div: 5.625rem;
+ --width-dividers-div: 0.063rem;
+ --width-controls: 100%;
+ --width-controls-img: 1.875rem;
+ --width-announcement: 21.875rem;
+ --width-contacts-label: 21.875rem;
+ --width-contacts-description-div: 21.875rem;
+ --width-contacts-links-a-img: 2.125rem;
+ --width-uptime: 100%;
+ --width-uptime-squares-grid-div: 0.625rem;
+ --width-values-grid-div: 3.75rem;
+ --width-labels-grid-div: 3.75rem;
+ --width-chart-rectangle-grid-div: 3.125rem;
+ --width-chart-container: 42.625rem;
+ --width-error-img: 19.313rem;
+ --width-error-div: 23.875rem;
+ --width-advice: 23.875rem;
- /* max-width */
- --max-width-setup: 71.250rem;
- --max-width-index-xl: 71.250rem;
- --max-width-index-lg: 47.500rem;
- --max-width-index-md: 23.750rem;
- --max-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.750rem;
- --max-width-col-lg-12-col-xl-8: 47.500rem;
+ /* max-width */
+ --max-width-setup: 71.25rem;
+ --max-width-index-xl: 71.25rem;
+ --max-width-index-lg: 47.5rem;
+ --max-width-index-md: 23.75rem;
+ --max-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.75rem;
+ --max-width-col-lg-12-col-xl-8: 47.5rem;
- /* min-width */
- --min-width-setup: 71.250rem;
- --min-width-index-xl: 71.250rem;
- --min-width-index-lg: 47.500rem;
- --min-width-index-md: 23.750rem;
- --min-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.750rem;
- --min-width-col-lg-12-col-xl-8: 47.500rem;
- --min-width-error: 71.250rem;
+ /* min-width */
+ --min-width-setup: 71.25rem;
+ --min-width-index-xl: 71.25rem;
+ --min-width-index-lg: 47.5rem;
+ --min-width-index-md: 23.75rem;
+ --min-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.75rem;
+ --min-width-col-lg-12-col-xl-8: 47.5rem;
+ --min-width-error: 71.25rem;
- /* border */
- --border-chart-container: 0.063rem;
+ /* border */
+ --border-chart-container: 0.063rem;
- /* border-width */
- --border-width-chart-triangle-grid-div: 0.438rem 0.438rem 0.000rem 0.438rem;
+ /* border-width */
+ --border-width-chart-triangle-grid-div: 0.438rem 0.438rem 0rem 0.438rem;
- /* border-radius */
- --border-radius-setup-div: 1.250rem;
- --border-radius-port: 0.000rem 0.000rem 0.625rem 0.625rem;
- --border-radius-card: 1.250rem;
- --border-radius-hw-logo: 50%;
- --border-radius-card-footer-dots-grid-div: 50%;
- --border-radius-inner-dot: 50%;
- --border-radius-error-img: 50%;
- --border-radius-controls-img: 50%;
- --border-radius-error-div: 1.250rem;
+ /* border-radius */
+ --border-radius-setup-div: 1.25rem;
+ --border-radius-port: 0rem 0rem 0.625rem 0.625rem;
+ --border-radius-card: 1.25rem;
+ --border-radius-hw-logo: 50%;
+ --border-radius-card-footer-dots-grid-div: 50%;
+ --border-radius-inner-dot: 50%;
+ --border-radius-error-img: 50%;
+ --border-radius-controls-img: 50%;
+ --border-radius-error-div: 1.25rem;
- /* letter-spacing */
- --letter-spacing-2px: 0.125rem;
- --letter-spacing-5px: 0.313rem;
- --letter-spacing-10px: 0.625rem;
+ /* letter-spacing */
+ --letter-spacing-2px: 0.125rem;
+ --letter-spacing-5px: 0.313rem;
+ --letter-spacing-10px: 0.625rem;
- /* transition */
- --transition-all: color 0.200s, background 0.200s, transform 0.070s, opacity 0.4s;
+ /* transition */
+ --transition-all: color 0.2s, background 0.2s, transform 0.07s, opacity 0.4s;
- /* transform */
- --transform-form-squares-grid-second: scale(1.3);
- --transform-theme-buttons-input-active: scale(0.9);
- --transform-submit-active: scale(0.9);
- --transform-controls-first-active: scale(0.9);
- --transform-controls-second-active: scale(0.9);
- --transform-contacts-links-a-first-active: scale(0.9);
- --transform-contacts-links-a-second-active: scale(0.9);
- --transform-uptime-squares-grid-second: scale(1.3);
- --transform-chart-rectangle-grid-div-active: scale(0.9);
-}
\ No newline at end of file
+ /* transform */
+ --transform-form-squares-grid-second: scale(1.3);
+ --transform-theme-buttons-input-active: scale(0.9);
+ --transform-submit-active: scale(0.9);
+ --transform-controls-first-active: scale(0.9);
+ --transform-controls-second-active: scale(0.9);
+ --transform-contacts-links-a-first-active: scale(0.9);
+ --transform-contacts-links-a-second-active: scale(0.9);
+ --transform-uptime-squares-grid-second: scale(1.3);
+ --transform-chart-rectangle-grid-div-active: scale(0.9);
+}
diff --git a/src/main/resources/static/js/globals.js b/src/main/resources/static/js/globals.js
index 45321042..a712c232 100644
--- a/src/main/resources/static/js/globals.js
+++ b/src/main/resources/static/js/globals.js
@@ -45,6 +45,11 @@ let usageXHR;
*/
let infoXHR;
+/**
+ * Used for sending uptime requests
+ */
+let uptimeXHR;
+
/**
* Used to hold values of processor usage
*/
diff --git a/src/main/resources/static/js/index.js b/src/main/resources/static/js/index.js
index d551dd40..b7d4814b 100644
--- a/src/main/resources/static/js/index.js
+++ b/src/main/resources/static/js/index.js
@@ -29,14 +29,10 @@ function indexInitialization()
usageXHR = new XMLHttpRequest();
infoXHR = new XMLHttpRequest();
+ uptimeXHR = new XMLHttpRequest();
sendUsageRequest();
- setInterval(function()
- {
- sendInfoRequest();
- }, 1000);
-
firstControl.addEventListener("click", function(event) {changePage(event.target || event.srcElement)});
secondControl.addEventListener("click", function(event) {changePage(event.target || event.srcElement)});
}
@@ -101,7 +97,7 @@ function sendUsageRequest()
labelsTick(response);
chartTick(response);
- sendUsageRequest();
+ sendInfoRequest();
}
}
@@ -125,10 +121,7 @@ function sendInfoRequest()
currentTotalStorage.innerHTML = response.storage.total;
currentDiskCount.innerHTML = response.storage.diskCount;
- days.innerHTML = response.uptime.days;
- hours.innerHTML = response.uptime.hours;
- minutes.innerHTML = response.uptime.minutes;
- seconds.innerHTML = response.uptime.seconds;
+ sendUptimeRequest();
}
}
@@ -136,6 +129,30 @@ function sendInfoRequest()
infoXHR.send();
}
+/**
+ * Sending ajax request to receive server uptime
+ */
+function sendUptimeRequest()
+{
+ infoXHR.onreadystatechange = function()
+ {
+ if ((this.readyState == 4) && (this.status == 200))
+ {
+ let response = JSON.parse(this.response);
+
+ days.innerHTML = response.days;
+ hours.innerHTML = response.hours;
+ minutes.innerHTML = response.minutes;
+ seconds.innerHTML = response.seconds;
+
+ sendUsageRequest()
+ }
+ }
+
+ infoXHR.open("GET", "/api/uptime");
+ infoXHR.send();
+}
+
/**
* Changes page
*
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index 46f66e7a..4c434443 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -1,8 +1,8 @@
-
+
-
+
@@ -224,10 +224,10 @@
-
-
-
-
+
+
+
+
DAYS
@@ -257,7 +257,7 @@
-
+
From 98b9d7ea0e98728315d6c2901ed833859369b0bc Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Thu, 17 Feb 2022 17:34:05 +0000
Subject: [PATCH 002/201] update readme and links
---
README.md | 26 ++++++++++++++++---------
pom.xml | 2 +-
src/main/resources/templates/index.html | 4 ++--
3 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 58cd8183..a21f28e5 100644
--- a/README.md
+++ b/README.md
@@ -112,17 +112,25 @@ Ward works nice on all popular operating systems, because it uses [OSHI](https:/
Create your own jar
- 1. Clone or dowload this github repository
- 2. cd into directory with copy of this repository
- 3. docker build -t ward/ward .
- 4. docker run --rm -it --name ward -p 4000:4000 -p : --privileged ward
- 5. Go to localhost:4000 in web browser, input the same application port
- 6. If you get error after being redirected to application port try hitting refresh
+ 1. Clone the project
+ 2. Import project in your IDE as Maven project
+ 3. mvn clean package
+ 4. jar will be in the target folder
Run jar file
- • Create you own jar as described above
- • Execute jar on Windows or Linux with administrative rights
- • Enter localhost:4000 and set up application
+ 1. Create you own jar as described above
+ 2. Execute jar on Windows or Linux with administrative rights
+ 3. Enter localhost:4000 and set up application
+
+
+
+ Build for Docker
+
+ 1. Clone the project
+ 2. docker build --tag ward
+ 3. docker run --rm -it --name ward -p 4000:4000 -p : --privileged ward
+ 4. Go to localhost:4000 in web browser, input the same application port
+ 5. If you get error after being redirected to application port try hitting refresh
diff --git a/pom.xml b/pom.xml
index 8ea5b875..71917fbb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
4.0.0
- org.b-software
+ dev.leonsward2.0.0jar
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index 4c434443..e3affab6 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -202,10 +202,10 @@
From 044e6078ccd4550075418c225b803962a9bcdc07 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Fri, 18 Feb 2022 22:11:50 +0000
Subject: [PATCH 012/201] 2.0.1
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 2e570d5b..ab950b81 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0dev.leonsward
- 2.0.0
+ 2.0.1jar
From 9a2064c566e94f75a04d755fd2a2aa2021393eb0 Mon Sep 17 00:00:00 2001
From: Adam
Date: Wed, 23 Feb 2022 18:11:37 -0500
Subject: [PATCH 013/201] Add Config section to readme (#2)
---
README.md | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/README.md b/README.md
index 64142f30..3cb22a5d 100644
--- a/README.md
+++ b/README.md
@@ -150,3 +150,28 @@ Ward works nice on all popular operating systems, because it uses [OSHI](https:/
3. docker run --rm -it --name ward -p 4000:4000 -p : --privileged ward
4. Go to localhost:4000 in web browser, input the same application port
5. If you get error after being redirected to application port try hitting refresh
+
+### Config
+
+If you want to change Ward's configuration, you can edit `setup.ini`. When using Docker, this file is located within the container at `/`. `setup.ini` is generated once you navigate to Ward's webpage and complete the initial setup. You can also make this file yourself before starting Ward and it will use your configuration.
+
+| Setting | Description | Default |
+|------------|------------------------------|---------|
+| serverName | Name shown in the interface. | |
+| theme | Either `light` or `dark`. | |
+| port | Port to listen on. | 4000 |
+
+For example:
+```ini
+[setup]
+serverName = my-server
+theme = dark
+port = 8200
+```
+
+If you're using Docker and you want to avoid the initial setup or have Ward listen on a different port right away, you could create a `setup.ini` on the host and copy it to the container:
+```bash
+docker cp setup.ini ward:/setup.ini
+```
+
+Then, just make sure you `docker restart ward`.
From 05e9c69e771a8492e4ecc7f029a2fcfab417c45a Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Thu, 10 Mar 2022 03:18:33 +0000
Subject: [PATCH 014/201] bump oshi
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ab950b81..ebd4e193 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
- 6.1.2
+ 6.1.35.10.01.18.220.5.4
From b583bbb66124c2133b65ef00f03fadabca3d3b0b Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Thu, 10 Mar 2022 03:25:31 +0000
Subject: [PATCH 015/201] 2.0.2
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ebd4e193..b90d9897 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0dev.leonsward
- 2.0.1
+ 2.0.2jar
From f9a153c5fd0d659361c8c7244d7767385ab0a3c2 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Sun, 20 Mar 2022 15:49:08 +0000
Subject: [PATCH 016/201] Env setup creation (#5)
* add env check
* Create Ward.run.xml
* enable one port and theme fixes
* fix edge case
* env setup
* remove unnecessary check
* update docs 2.1.0
---
.gitignore | 3 +-
.run/Ward.run.xml | 10 ++++
README.md | 19 +++----
pom.xml | 2 +-
setup.ini | 5 --
src/main/java/dev/leons/ward/Ward.java | 17 +++---
.../dev/leons/ward/services/SetupService.java | 54 +++++++++++++------
src/main/resources/static/css/themes.css | 6 +--
src/main/resources/static/js/setup.js | 12 -----
9 files changed, 70 insertions(+), 58 deletions(-)
create mode 100644 .run/Ward.run.xml
delete mode 100644 setup.ini
diff --git a/.gitignore b/.gitignore
index 309b8748..c3eff11e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,5 @@
.idea/
target/
*.iml
-.vscode/
\ No newline at end of file
+.vscode/
+setup.ini
diff --git a/.run/Ward.run.xml b/.run/Ward.run.xml
new file mode 100644
index 00000000..6a8b0954
--- /dev/null
+++ b/.run/Ward.run.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 3cb22a5d..38d6491f 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
## Docker
-* `docker run --restart unless-stopped -it -d --name ward -p 4000:4000 -p : --privileged antonyleons/ward`
+* `docker run --restart unless-stopped -it -d --name ward -p 4000:4000 -e WARD_PORT=4000 -e WARD_THEME=dark --privileged antonyleons/ward`
* Go to localhost:4000 in web browser, input the same application port
* If you get error after being redirected to application port try hitting refresh
@@ -153,14 +153,18 @@ Ward works nice on all popular operating systems, because it uses [OSHI](https:/
### Config
-If you want to change Ward's configuration, you can edit `setup.ini`. When using Docker, this file is located within the container at `/`. `setup.ini` is generated once you navigate to Ward's webpage and complete the initial setup. You can also make this file yourself before starting Ward and it will use your configuration.
+If you want to change Ward's configuration, you can edit `setup.ini`. When using Docker, use the environment variables `WARD_NAME`,`WARD_THEME`, `WARD_PORT` to automatically regenerate this file at startup. Using any environment variable listed will enable the defaults below and immediately start Ward without the GUI setup.
+
+
| Setting | Description | Default |
|------------|------------------------------|---------|
-| serverName | Name shown in the interface. | |
-| theme | Either `light` or `dark`. | |
+| serverName | Name shown in the interface. | Ward |
+| theme | Either `light` or `dark`. | light |
| port | Port to listen on. | 4000 |
+Environment variables take priority and will regenerate this file with your variables. If no environment variables are set, `setup.ini` is generated once you navigate to Ward's webpage and complete the initial setup. You can also make this file yourself before starting Ward, and place it in the same directory.
+
For example:
```ini
[setup]
@@ -168,10 +172,3 @@ serverName = my-server
theme = dark
port = 8200
```
-
-If you're using Docker and you want to avoid the initial setup or have Ward listen on a different port right away, you could create a `setup.ini` on the host and copy it to the container:
-```bash
-docker cp setup.ini ward:/setup.ini
-```
-
-Then, just make sure you `docker restart ward`.
diff --git a/pom.xml b/pom.xml
index b90d9897..82ee5c02 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0dev.leonsward
- 2.0.2
+ 2.1.0jar
diff --git a/setup.ini b/setup.ini
deleted file mode 100644
index 4d54f868..00000000
--- a/setup.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[setup]
-serverName = Ward
-theme = light
-port = 5000
-
diff --git a/src/main/java/dev/leons/ward/Ward.java b/src/main/java/dev/leons/ward/Ward.java
index 6f5b24e2..bcd5e2af 100644
--- a/src/main/java/dev/leons/ward/Ward.java
+++ b/src/main/java/dev/leons/ward/Ward.java
@@ -1,5 +1,6 @@
package dev.leons.ward;
+import dev.leons.ward.services.SetupService;
import lombok.Getter;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.SpringApplication;
@@ -16,8 +17,7 @@
* @version 1.0.4
*/
@SpringBootApplication
-public class Ward extends SpringBootServletInitializer
-{
+public class Ward extends SpringBootServletInitializer {
/**
* Constant for determine settings file name
*/
@@ -44,14 +44,16 @@ public class Ward extends SpringBootServletInitializer
*
* @param args Spring Boot application arguments
*/
- public static void main(final String[] args)
- {
+ public static void main(final String[] args) {
+
isFirstLaunch = true;
configurableApplicationContext = SpringApplication.run(Ward.class, args);
File setupFile = new File(Ward.SETUP_FILE_PATH);
- if (setupFile.exists())
- {
+
+ if (System.getenv("WARD_NAME") != null || (System.getenv("WARD_THEME") != null) || (System.getenv("WARD_PORT") != null)) {
+ SetupService.envSetup();
+ } else if (setupFile.exists()) {
restart();
}
}
@@ -59,8 +61,7 @@ public static void main(final String[] args)
/**
* Restarts application
*/
- public static void restart()
- {
+ public static void restart() {
isFirstLaunch = false;
ApplicationArguments args = configurableApplicationContext.getBean(ApplicationArguments.class);
diff --git a/src/main/java/dev/leons/ward/services/SetupService.java b/src/main/java/dev/leons/ward/services/SetupService.java
index 94944415..e865f4e9 100644
--- a/src/main/java/dev/leons/ward/services/SetupService.java
+++ b/src/main/java/dev/leons/ward/services/SetupService.java
@@ -17,8 +17,7 @@
* @version 1.0.2
*/
@Service
-public class SetupService
-{
+public class SetupService {
/**
* Constant, that providing setup section name
*/
@@ -27,12 +26,11 @@ public class SetupService
/**
* Puts new data in ini file
*
- * @param file ini file
+ * @param file ini file
* @param optionName option in section
* @throws IOException if file does not exists
*/
- private void putInIniFile(final File file, final String optionName, final String value) throws IOException
- {
+ private static void putInIniFile(final File file, final String optionName, final String value) throws IOException {
Ini ini = new Ini(file);
ini.put(SECTION_NAME, optionName, value);
ini.store();
@@ -45,30 +43,52 @@ private void putInIniFile(final File file, final String optionName, final String
* @return ResponseEntityWrapperAsset filled with ResponseDto
* @throws IOException IoException if file is fot found, and cant be created
*/
- public ResponseDto postSetup(final SetupDto setupDto) throws IOException, ApplicationAlreadyConfiguredException
- {
- if (Ward.isFirstLaunch())
- {
+ public ResponseDto postSetup(final SetupDto setupDto) throws IOException, ApplicationAlreadyConfiguredException {
+ if (Ward.isFirstLaunch()) {
File file = new File(Ward.SETUP_FILE_PATH);
- if (file.createNewFile())
- {
+ if (file.createNewFile()) {
putInIniFile(file, "serverName", setupDto.getServerName());
putInIniFile(file, "theme", setupDto.getTheme());
putInIniFile(file, "port", setupDto.getPort());
Ward.restart();
- }
- else
- {
+ } else {
throw new IOException();
}
- }
- else
- {
+ } else {
throw new ApplicationAlreadyConfiguredException();
}
return new ResponseDto("Settings saved correctly");
}
+
+ public static ResponseDto envSetup() {
+ if (Ward.isFirstLaunch()) {
+ try {
+ File file = new File(Ward.SETUP_FILE_PATH);
+ if (file.exists()) {
+ file.delete();
+ }
+ if (file.createNewFile()) {
+ String servername = (System.getenv("WARD_NAME") != null) ? System.getenv("WARD_NAME") : "Ward";
+ String theme = (System.getenv("WARD_THEME") != null) ? System.getenv("WARD_THEME").toLowerCase() : "light";
+ String port = (System.getenv("WARD_PORT") != null) ? System.getenv("WARD_PORT") : "4000";
+
+ putInIniFile(file, "serverName", servername);
+ putInIniFile(file, "theme", theme);
+ putInIniFile(file, "port", port);
+
+ Ward.restart();
+ } else {
+ throw new IOException();
+ }
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ return new ResponseDto("Settings saved correctly");
+ }
}
\ No newline at end of file
diff --git a/src/main/resources/static/css/themes.css b/src/main/resources/static/css/themes.css
index 513f6e9b..783b9242 100644
--- a/src/main/resources/static/css/themes.css
+++ b/src/main/resources/static/css/themes.css
@@ -107,12 +107,12 @@ html[theme = "dark"]
--color-logo: var(--white);
--color-logo-description: var(--white);
--color-label-main-settings: var(--white);
- --color-main-settings-input: var(--grey);
+ --color-main-settings-input: var(--white);
--color-main-settings-input-placeholder: var(--grey-light);
- --color-label-additional-settings: var(--grey-light);
+ --color-label-additional-settings: var(--white);
--color-theme-buttons-input: var(--grey);
--color-port: var(--white);
- --color-port-placeholder: var(--white);
+ --color-port-placeholder: var(--grey-light);
--color-submit: var(--white);
--color-hw-type: var(--white);
--color-hw-name: var(--white);
diff --git a/src/main/resources/static/js/setup.js b/src/main/resources/static/js/setup.js
index 0ebf7b13..4b2eae26 100644
--- a/src/main/resources/static/js/setup.js
+++ b/src/main/resources/static/js/setup.js
@@ -120,18 +120,6 @@ function sendSetupRequest()
"port": port.value
}
- if (port.value != 4000)
- {
setupXHR.send(JSON.stringify(data));
- }
- else
- {
- let message =
- {
- text: "Choose other port",
- type: ("")
- }
- dhtmlx.message(message);
- }
}
\ No newline at end of file
From 40c1ff41b125778f6489e78e38527cea54056fad Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Sun, 20 Mar 2022 16:07:25 +0000
Subject: [PATCH 017/201] Update README.md
---
README.md | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 38d6491f..99e14914 100644
--- a/README.md
+++ b/README.md
@@ -9,8 +9,7 @@
## Docker
* `docker run --restart unless-stopped -it -d --name ward -p 4000:4000 -e WARD_PORT=4000 -e WARD_THEME=dark --privileged antonyleons/ward`
-* Go to localhost:4000 in web browser, input the same application port
-* If you get error after being redirected to application port try hitting refresh
+* Go to localhost:4000 in web browser
## Java
From 122d0559e6afde8f22dbaf15b623888defdcb91d Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Sun, 20 Mar 2022 16:25:13 +0000
Subject: [PATCH 018/201] add demo page
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 99e14914..1faaac5d 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@
---
+## [Demo](https://status.leons.dev)
+
# Quick start
## Docker
From 697e89eace81c8353f4abb7f4ca2f401ed46a2ef Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Sun, 20 Mar 2022 16:28:35 +0000
Subject: [PATCH 019/201] fix errors in readme
---
README.md | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 1faaac5d..910c2f0d 100644
--- a/README.md
+++ b/README.md
@@ -148,16 +148,13 @@ Ward works nice on all popular operating systems, because it uses [OSHI](https:/
1. Clone the project
2. docker build --tag ward
- 3. docker run --rm -it --name ward -p 4000:4000 -p : --privileged ward
- 4. Go to localhost:4000 in web browser, input the same application port
- 5. If you get error after being redirected to application port try hitting refresh
+ 3. docker run --restart unless-stopped -it -d --name ward -p 4000:4000 -e WARD_PORT=4000 -e WARD_THEME=dark --privileged ward
+ 4. Go to localhost:4000 in web browser
### Config
If you want to change Ward's configuration, you can edit `setup.ini`. When using Docker, use the environment variables `WARD_NAME`,`WARD_THEME`, `WARD_PORT` to automatically regenerate this file at startup. Using any environment variable listed will enable the defaults below and immediately start Ward without the GUI setup.
-
-
| Setting | Description | Default |
|------------|------------------------------|---------|
| serverName | Name shown in the interface. | Ward |
@@ -167,6 +164,7 @@ If you want to change Ward's configuration, you can edit `setup.ini`. When using
Environment variables take priority and will regenerate this file with your variables. If no environment variables are set, `setup.ini` is generated once you navigate to Ward's webpage and complete the initial setup. You can also make this file yourself before starting Ward, and place it in the same directory.
For example:
+
```ini
[setup]
serverName = my-server
From e5098364843ab5f06c2e8fe4010d0668b0d92fe5 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Sun, 20 Mar 2022 17:52:26 +0000
Subject: [PATCH 020/201] add 999 day support
---
pom.xml | 2 +-
src/main/resources/static/css/dimensions.css | 464 +++++++++---------
src/main/resources/static/css/layout.css | 480 +++++++------------
3 files changed, 402 insertions(+), 544 deletions(-)
diff --git a/pom.xml b/pom.xml
index 82ee5c02..35bbf8d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0dev.leonsward
- 2.1.0
+ 2.1.1jar
diff --git a/src/main/resources/static/css/dimensions.css b/src/main/resources/static/css/dimensions.css
index 5a7cb714..b9cbbcea 100644
--- a/src/main/resources/static/css/dimensions.css
+++ b/src/main/resources/static/css/dimensions.css
@@ -13,251 +13,253 @@
*/
:root {
- /* top */
- --top-logo: 2.188rem;
- --top-logo-description: 5.3rem;
- --top-clouds-first: 2.875rem;
- --top-clouds-second: 2.875rem;
- --top-main-settings-input: 0.125rem;
- --top-main-settings-underline: 0.313rem;
- --top-main-settings-select: 0.938rem;
- --top-label-additional-settings: 2.3rem;
- --top-additional-settings: 1rem;
- --top-theme-buttons-input: 1.938rem;
- --top-button-squares-grid: 0.222rem;
- --top-port: 2.75rem;
- --top-header: 1.5rem;
- --top-label-hw-info: 0.562rem;
- --top-card-body-squares-grid: 0.813rem;
- --top-info-label: 4.188rem;
- --top-inner-dot: 0.375rem;
- --top-detailed-hw-info-div: 1.168rem;
- --top-controls-img: 0.75rem;
- --top-announcement: 3.813rem;
- --top-contacts-label: 1.5rem;
- --top-contacts-description-first: 3.125rem;
- --top-contacts-description-second: 3.813rem;
- --top-contacts-links-a-img: 4.906rem;
- --top-uptime-rectangle-grid: 1.925rem;
- --top-chart-label: 1.5rem;
- --top-chart-triangle-grid: 0.5rem;
- --top-chart-rectangle-grid: 1.906rem;
- --top-chart-container: 3.375rem;
- --top-code: 1.813rem;
- --top-title: 3.5rem;
- --top-explanation: 6.688rem;
+ /* top */
+ --top-logo: 2.188rem;
+ --top-logo-description: 5.3rem;
+ --top-clouds-first: 2.875rem;
+ --top-clouds-second: 2.875rem;
+ --top-main-settings-input: 0.125rem;
+ --top-main-settings-underline: 0.313rem;
+ --top-main-settings-select: 0.938rem;
+ --top-label-additional-settings: 2.3rem;
+ --top-additional-settings: 1rem;
+ --top-theme-buttons-input: 1.938rem;
+ --top-button-squares-grid: 0.222rem;
+ --top-port: 2.75rem;
+ --top-header: 1.5rem;
+ --top-label-hw-info: 0.562rem;
+ --top-card-body-squares-grid: 0.813rem;
+ --top-info-label: 4.188rem;
+ --top-inner-dot: 0.375rem;
+ --top-detailed-hw-info-div: 1.168rem;
+ --top-controls-img: 0.75rem;
+ --top-announcement: 3.813rem;
+ --top-contacts-label: 1.5rem;
+ --top-contacts-description-first: 3.125rem;
+ --top-contacts-description-second: 3.813rem;
+ --top-contacts-links-a-img: 4.906rem;
+ --top-uptime-rectangle-grid: 1.925rem;
+ --top-chart-label: 1.5rem;
+ --top-chart-triangle-grid: 0.5rem;
+ --top-chart-rectangle-grid: 1.906rem;
+ --top-chart-container: 3.375rem;
+ --top-code: 1.813rem;
+ --top-title: 3.5rem;
+ --top-explanation: 6.688rem;
- /* bottom */
- --bottom-form-squares-grid: 0.813rem;
- --bottom-submit: 1.125rem;
- --bottom-usage: 4.625rem;
- --bottom-hw-usage-div: 0.25rem;
- --bottom-card-footer-dots-grid-div: -0.75rem;
- --bottom-uptime-squares-grid: 0.813rem;
- --bottom-values-grid-div-p: 0.25rem;
- --bottom-project-version: 1.25rem;
- --bottom-error-div: 7.5rem;
- --bottom-advice: 0.563rem;
+ /* bottom */
+ --bottom-form-squares-grid: 0.813rem;
+ --bottom-submit: 1.125rem;
+ --bottom-usage: 4.625rem;
+ --bottom-hw-usage-div: 0.25rem;
+ --bottom-card-footer-dots-grid-div: -0.75rem;
+ --bottom-uptime-squares-grid: 0.813rem;
+ --bottom-values-grid-div-p: 0.25rem;
+ --bottom-project-version: 1.25rem;
+ --bottom-error-div: 7.5rem;
+ --bottom-advice: 0.563rem;
- /* left */
- --left-clouds-second: 12.875rem;
- --left-form-squares-grid: 9.25rem;
- --left-main-settings: 1.5rem;
- --left-button-squares-grid-first: 1.5rem;
- --left-button-squares-grid-second: 19.688rem;
- --left-theme-buttons-first: 1.5rem;
- --left-port: 1.5rem;
- --left-submit: 6.563rem;
- --left-header: 1.5rem;
- --left-label-hw-info: 4.375rem;
- --left-usage: 1.5rem;
- --card-footer-dots-grid-first: 2.906rem;
- --card-footer-dots-grid-second: 10.187rem;
- --card-footer-dots-grid-third: 17.468rem;
- --left-inner-dot: 0.375rem;
- --left-detailed-hw-info-first: 0.822rem;
- --left-detailed-hw-info-second: 8.104rem;
- --left-detailed-hw-info-third: 15.385rem;
- --left-dividers-first: 7.313rem;
- --left-dividers-second: 14.563rem;
- --left-controls-first: 0.75rem;
- --left-controls-second: 19.25rem;
- --left-contacts-links-a-first: 8.075rem;
- --left-contacts-links-a-second: 11.7rem;
- --left-uptime-squares-grid: 9.25rem;
- --left-uptime-rectangle-grid: 2.781rem;
- --left-chart-label: 1.5rem;
- --left-chart-triangle-grid-first: 34.375rem;
- --left-chart-triangle-grid-second: 38.25rem;
- --left-chart-triangle-grid-third: 42.125rem;
- --left-chart-rectangle-grid-first: 33.25rem;
- --left-chart-rectangle-grid-second: 37.125rem;
- --left-chart-rectangle-grid-third: 41rem;
- --left-chart-container: 1.5rem;
- --left-error-div: 13.25rem;
- --left-code: 1.813rem;
- --left-title: 1.813rem;
- --left-explanation: 1.813rem;
+ /* left */
+ --left-clouds-second: 12.875rem;
+ --left-form-squares-grid: 9.25rem;
+ --left-main-settings: 1.5rem;
+ --left-button-squares-grid-first: 1.5rem;
+ --left-button-squares-grid-second: 19.688rem;
+ --left-theme-buttons-first: 1.5rem;
+ --left-port: 1.5rem;
+ --left-submit: 6.563rem;
+ --left-header: 1.5rem;
+ --left-label-hw-info: 4.375rem;
+ --left-usage: 1.5rem;
+ --card-footer-dots-grid-first: 2.906rem;
+ --card-footer-dots-grid-second: 10.187rem;
+ --card-footer-dots-grid-third: 17.468rem;
+ --left-inner-dot: 0.375rem;
+ --left-detailed-hw-info-first: 0.822rem;
+ --left-detailed-hw-info-second: 8.104rem;
+ --left-detailed-hw-info-third: 15.385rem;
+ --left-dividers-first: 7.313rem;
+ --left-dividers-second: 14.563rem;
+ --left-controls-first: 0.75rem;
+ --left-controls-second: 19.25rem;
+ --left-contacts-links-a-first: 8.075rem;
+ --left-contacts-links-a-second: 11.7rem;
+ --left-uptime-squares-grid: 9.25rem;
+ --left-uptime-rectangle-grid: 2.23rem;
+ --left-chart-label: 1.5rem;
+ --left-chart-triangle-grid-first: 34.375rem;
+ --left-chart-triangle-grid-second: 38.25rem;
+ --left-chart-triangle-grid-third: 42.125rem;
+ --left-chart-rectangle-grid-first: 33.25rem;
+ --left-chart-rectangle-grid-second: 37.125rem;
+ --left-chart-rectangle-grid-third: 41rem;
+ --left-chart-container: 1.5rem;
+ --left-error-div: 13.25rem;
+ --left-code: 1.813rem;
+ --left-title: 1.813rem;
+ --left-explanation: 1.813rem;
- /* margin-right */
- --margin-right-form-squares-grid-div: 0.488rem;
- --margin-right-theme-buttons-first: 1.938rem;
- --margin-right-usage-value: 2.937rem;
- --margin-right-uptime-squares-grid-div: 0.488rem;
- --margin-right-values-grid-div: 0.125rem;
- --margin-right-labels-grid-div: 0.125rem;
+ /* margin-right */
+ --margin-right-form-squares-grid-div: 0.488rem;
+ --margin-right-theme-buttons-first: 1.938rem;
+ --margin-right-usage-value: 2.937rem;
+ --margin-right-uptime-squares-grid-div: 0.488rem;
+ --margin-right-values-grid-div: 0.125rem;
+ --margin-right-labels-grid-div: 0.125rem;
- /* margin-bottom */
- --margin-bottom-label-main-settings: 0.438rem;
- --margin-bottom-card: 1.875rem;
- --margin-bottom-card-body-squares-grid-div: 0.75rem;
- --margin-bottom-labels-grid-div: 0.313rem;
+ /* margin-bottom */
+ --margin-bottom-label-main-settings: 0.438rem;
+ --margin-bottom-card: 1.875rem;
+ --margin-bottom-card-body-squares-grid-div: 0.75rem;
+ --margin-bottom-labels-grid-div: 0.313rem;
- /* height */
- --height-body: 100%;
- --height-setup: 26.706rem;
- --height-setup-div: 26.706rem;
- --height-clouds: 8.281rem;
- --height-clouds-img: 5.438rem;
- --height-background: 8.281rem;
- --height-form: 18.425rem;
- --height-form-squares-grid-div: 0.625rem;
- --height-main-settings: 1.875rem;
- --height-main-settings-underline: 0.313rem;
- --height-main-settings-select: 1.875rem;
- --height-theme-buttons-input: 2.188rem;
- --height-button-squares-grid-div: 0.625rem;
- --height-port: 3.125rem;
- --height-submit: 1.875rem;
- --height-index-xl: 35.031rem;
- --height-index-lg: 53.438rem;
- --height-index-md: 53.438rem;
- --height-hw-logo: 3.75rem;
- --height-usage: 5.313rem;
- --height-card-body-squares-grid-div: 0.625rem;
- --height-main-hw-info: 100%;
- --height-usage-value-span: 5.8rem;
- --height-usage-underline: 0.313rem;
- --height-footer: 3.125rem;
- --height-card-footer-dots-grid-div: 1.5rem;
- --height-inner-dot: 0.75rem;
- --height-detailed-hw-info-div: 1.063rem;
- --height-dividers-div: 3.125rem;
- --height-controls: 2.625rem;
- --height-controls-img: 1.875rem;
- --height-contacts-links-a-img: 2.125rem;
- --height-uptime: 8.27rem;
- --height-uptime-squares-grid-div: 0.625rem;
- --height-values-grid-div: 3.188rem;
- --height-labels-grid-div: 0.813rem;
- --height-chart-rectangle-grid-div: 0.625rem;
- --height-chart-container: 11.688rem;
- --height-error: 25.75rem;
- --height-error-img: 19.313rem;
- --height-error-div: 12.125rem;
+ /* height */
+ --height-body: 100%;
+ --height-setup: 26.706rem;
+ --height-setup-div: 26.706rem;
+ --height-clouds: 8.281rem;
+ --height-clouds-img: 5.438rem;
+ --height-background: 8.281rem;
+ --height-form: 18.425rem;
+ --height-form-squares-grid-div: 0.625rem;
+ --height-main-settings: 1.875rem;
+ --height-main-settings-underline: 0.313rem;
+ --height-main-settings-select: 1.875rem;
+ --height-theme-buttons-input: 2.188rem;
+ --height-button-squares-grid-div: 0.625rem;
+ --height-port: 3.125rem;
+ --height-submit: 1.875rem;
+ --height-index-xl: 35.031rem;
+ --height-index-lg: 53.438rem;
+ --height-index-md: 53.438rem;
+ --height-hw-logo: 3.75rem;
+ --height-usage: 5.313rem;
+ --height-card-body-squares-grid-div: 0.625rem;
+ --height-main-hw-info: 100%;
+ --height-usage-value-span: 5.8rem;
+ --height-usage-underline: 0.313rem;
+ --height-footer: 3.125rem;
+ --height-card-footer-dots-grid-div: 1.5rem;
+ --height-inner-dot: 0.75rem;
+ --height-detailed-hw-info-div: 1.063rem;
+ --height-dividers-div: 3.125rem;
+ --height-controls: 2.625rem;
+ --height-controls-img: 1.875rem;
+ --height-contacts-links-a-img: 2.125rem;
+ --height-uptime: 8.27rem;
+ --height-uptime-squares-grid-div: 0.625rem;
+ --height-values-grid-div: 3.188rem;
+ --height-labels-grid-div: 0.813rem;
+ --height-chart-rectangle-grid-div: 0.625rem;
+ --height-chart-container: 11.688rem;
+ --height-error: 25.75rem;
+ --height-error-img: 19.313rem;
+ --height-error-div: 12.125rem;
- /* max-height */
- --max-height-card: 16.562rem;
+ /* max-height */
+ --max-height-card: 16.562rem;
- /* min-height */
- --min-height-card: 16.562rem;
+ /* min-height */
+ --min-height-card: 16.562rem;
- /* width */
- --width-body: 100%;
- --width-dhtmlx-message-area: 21.875rem;
- --width-setup-div: 21.875rem;
- --width-logo: 21.875rem;
- --width-logo-description: 21.875rem;
- --width-clouds: 21.875rem;
- --width-clouds-img: 4.375rem;
- --width-background: 21.875rem;
- --width-form: 21.875rem;
- --width-form-squares-grid-div: 0.625rem;
- --width-main-settings: 18.875rem;
- --width-main-settings-input: 18.875rem;
- --width-main-settings-underline: 18.875rem;
- --width-main-settings-select: 18.875rem;
- --width-theme-buttons-input: 9.063rem;
- --width-button-squares-grid-div: 0.625rem;
- --width-port: 18.875rem;
- --width-submit: 8.75rem;
- --width-hw-logo: 3.75rem;
- --width-usage: 18.875rem;
- --width-card-body-squares-grid-div: 0.625rem;
- --width-usage-value-span: 2.224rem;
- --width-info-label: 9.5rem;
- --width-usage-underline: 9.5rem;
- --width-footer: 100%;
- --width-card-footer-dots-grid-div: 1.5rem;
- --width-inner-dot: 0.75rem;
- --width-detailed-hw-info-div: 5.625rem;
- --width-dividers-div: 0.063rem;
- --width-controls: 100%;
- --width-controls-img: 1.875rem;
- --width-announcement: 21.875rem;
- --width-contacts-label: 21.875rem;
- --width-contacts-description-div: 21.875rem;
- --width-contacts-links-a-img: 2.125rem;
- --width-uptime: 100%;
- --width-uptime-squares-grid-div: 0.625rem;
- --width-values-grid-div: 3.75rem;
- --width-labels-grid-div: 3.75rem;
- --width-chart-rectangle-grid-div: 3.125rem;
- --width-chart-container: 42.625rem;
- --width-error-img: 19.313rem;
- --width-error-div: 23.875rem;
- --width-advice: 23.875rem;
+ /* width */
+ --width-body: 100%;
+ --width-dhtmlx-message-area: 21.875rem;
+ --width-setup-div: 21.875rem;
+ --width-logo: 21.875rem;
+ --width-logo-description: 21.875rem;
+ --width-clouds: 21.875rem;
+ --width-clouds-img: 4.375rem;
+ --width-background: 21.875rem;
+ --width-form: 21.875rem;
+ --width-form-squares-grid-div: 0.625rem;
+ --width-main-settings: 18.875rem;
+ --width-main-settings-input: 18.875rem;
+ --width-main-settings-underline: 18.875rem;
+ --width-main-settings-select: 18.875rem;
+ --width-theme-buttons-input: 9.063rem;
+ --width-button-squares-grid-div: 0.625rem;
+ --width-port: 18.875rem;
+ --width-submit: 8.75rem;
+ --width-hw-logo: 3.75rem;
+ --width-usage: 18.875rem;
+ --width-card-body-squares-grid-div: 0.625rem;
+ --width-usage-value-span: 2.224rem;
+ --width-info-label: 9.5rem;
+ --width-usage-underline: 9.5rem;
+ --width-footer: 100%;
+ --width-card-footer-dots-grid-div: 1.5rem;
+ --width-inner-dot: 0.75rem;
+ --width-detailed-hw-info-div: 5.625rem;
+ --width-dividers-div: 0.063rem;
+ --width-controls: 100%;
+ --width-controls-img: 1.875rem;
+ --width-announcement: 21.875rem;
+ --width-contacts-label: 21.875rem;
+ --width-contacts-description-div: 21.875rem;
+ --width-contacts-links-a-img: 2.125rem;
+ --width-uptime: 100%;
+ --width-uptime-squares-grid-div: 0.625rem;
+ --width-values-grid-div: 3.75rem;
+ --width-labels-grid-div: 3.75rem;
+ --day-width-values-grid-div: 5rem;
+ --day-width-labels-grid-div: 5rem;
+ --width-chart-rectangle-grid-div: 3.125rem;
+ --width-chart-container: 42.625rem;
+ --width-error-img: 19.313rem;
+ --width-error-div: 23.875rem;
+ --width-advice: 23.875rem;
- /* max-width */
- --max-width-setup: 71.25rem;
- --max-width-index-xl: 71.25rem;
- --max-width-index-lg: 47.5rem;
- --max-width-index-md: 23.75rem;
- --max-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.75rem;
- --max-width-col-lg-12-col-xl-8: 47.5rem;
+ /* max-width */
+ --max-width-setup: 71.25rem;
+ --max-width-index-xl: 71.25rem;
+ --max-width-index-lg: 47.5rem;
+ --max-width-index-md: 23.75rem;
+ --max-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.75rem;
+ --max-width-col-lg-12-col-xl-8: 47.5rem;
- /* min-width */
- --min-width-setup: 71.25rem;
- --min-width-index-xl: 71.25rem;
- --min-width-index-lg: 47.5rem;
- --min-width-index-md: 23.75rem;
- --min-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.75rem;
- --min-width-col-lg-12-col-xl-8: 47.5rem;
- --min-width-error: 71.25rem;
+ /* min-width */
+ --min-width-setup: 71.25rem;
+ --min-width-index-xl: 71.25rem;
+ --min-width-index-lg: 47.5rem;
+ --min-width-index-md: 23.75rem;
+ --min-width-col-sm-12-col-md-6-col-lg-6-col-xl-4: 23.75rem;
+ --min-width-col-lg-12-col-xl-8: 47.5rem;
+ --min-width-error: 71.25rem;
- /* border */
- --border-chart-container: 0.063rem;
+ /* border */
+ --border-chart-container: 0.063rem;
- /* border-width */
- --border-width-chart-triangle-grid-div: 0.438rem 0.438rem 0rem 0.438rem;
+ /* border-width */
+ --border-width-chart-triangle-grid-div: 0.438rem 0.438rem 0rem 0.438rem;
- /* border-radius */
- --border-radius-setup-div: 1.25rem;
- --border-radius-port: 0rem 0rem 0.625rem 0.625rem;
- --border-radius-card: 1.25rem;
- --border-radius-hw-logo: 50%;
- --border-radius-card-footer-dots-grid-div: 50%;
- --border-radius-inner-dot: 50%;
- --border-radius-error-img: 50%;
- --border-radius-controls-img: 50%;
- --border-radius-error-div: 1.25rem;
+ /* border-radius */
+ --border-radius-setup-div: 1.25rem;
+ --border-radius-port: 0rem 0rem 0.625rem 0.625rem;
+ --border-radius-card: 1.25rem;
+ --border-radius-hw-logo: 50%;
+ --border-radius-card-footer-dots-grid-div: 50%;
+ --border-radius-inner-dot: 50%;
+ --border-radius-error-img: 50%;
+ --border-radius-controls-img: 50%;
+ --border-radius-error-div: 1.25rem;
- /* letter-spacing */
- --letter-spacing-2px: 0.125rem;
- --letter-spacing-5px: 0.313rem;
- --letter-spacing-10px: 0.625rem;
+ /* letter-spacing */
+ --letter-spacing-2px: 0.125rem;
+ --letter-spacing-5px: 0.313rem;
+ --letter-spacing-10px: 0.625rem;
- /* transition */
- --transition-all: color 0.2s, background 0.2s, transform 0.07s, opacity 0.4s;
+ /* transition */
+ --transition-all: color 0.2s, background 0.2s, transform 0.07s, opacity 0.4s;
- /* transform */
- --transform-form-squares-grid-second: scale(1.3);
- --transform-theme-buttons-input-active: scale(0.9);
- --transform-submit-active: scale(0.9);
- --transform-controls-first-active: scale(0.9);
- --transform-controls-second-active: scale(0.9);
- --transform-contacts-links-a-first-active: scale(0.9);
- --transform-contacts-links-a-second-active: scale(0.9);
- --transform-uptime-squares-grid-second: scale(1.3);
- --transform-chart-rectangle-grid-div-active: scale(0.9);
+ /* transform */
+ --transform-form-squares-grid-second: scale(1.3);
+ --transform-theme-buttons-input-active: scale(0.9);
+ --transform-submit-active: scale(0.9);
+ --transform-controls-first-active: scale(0.9);
+ --transform-controls-second-active: scale(0.9);
+ --transform-contacts-links-a-first-active: scale(0.9);
+ --transform-contacts-links-a-second-active: scale(0.9);
+ --transform-uptime-squares-grid-second: scale(1.3);
+ --transform-chart-rectangle-grid-div-active: scale(0.9);
}
diff --git a/src/main/resources/static/css/layout.css b/src/main/resources/static/css/layout.css
index a3817c65..30db4e51 100644
--- a/src/main/resources/static/css/layout.css
+++ b/src/main/resources/static/css/layout.css
@@ -10,14 +10,12 @@
*/
/* base elements */
-*
-{
+* {
font-family: var(--font-family-roboto);
transition: var(--transition-all);
}
-body
-{
+body {
position: fixed;
top: 0;
left: 0;
@@ -26,8 +24,7 @@ body
background: var(--background-body);
}
-.logo
-{
+.logo {
position: absolute;
top: var(--top-logo);
z-index: 1;
@@ -39,8 +36,7 @@ body
color: var(--color-logo);
}
-.logo-description
-{
+.logo-description {
position: absolute;
top: var(--top-logo-description);
z-index: 1;
@@ -52,34 +48,29 @@ body
color: var(--color-logo-description);
}
-.clouds
-{
+.clouds {
height: var(--height-clouds);
width: var(--width-clouds);
overflow: hidden;
}
-.clouds > img
-{
+.clouds > img {
position: relative;
z-index: 1;
height: var(--height-clouds-img);
width: var(--width-clouds-img);
}
-.clouds > .first
-{
+.clouds > .first {
top: var(--top-clouds-first);
}
-.clouds > .second
-{
+.clouds > .second {
top: var(--top-clouds-second);
left: var(--left-clouds-second);
}
-.background
-{
+.background {
position: absolute;
top: 0;
height: var(--height-background);
@@ -87,20 +78,17 @@ body
}
/* setup elements */
-.dhtmlx_message_area
-{
+.dhtmlx_message_area {
width: var(--width-dhtmlx-message-area);
}
-.setup
-{
+.setup {
margin-top: calc((100vh / 2) - (var(--height-setup) / 2));
max-width: var(--max-width-setup);
min-width: var(--min-width-setup);
}
-.setup-div
-{
+.setup-div {
display: block;
position: relative;
margin: auto;
@@ -116,8 +104,7 @@ body
animation-fill-mode: forwards;
}
-.form
-{
+.form {
position: absolute;
bottom: 0;
left: 0;
@@ -126,15 +113,13 @@ body
background: var(--background-form);
}
-.form-squares-grid
-{
+.form-squares-grid {
position: relative;
bottom: var(--bottom-form-squares-grid);
left: var(--left-form-squares-grid);
}
-.form-squares-grid > div
-{
+.form-squares-grid > div {
display: inline-block;
margin-right: var(--margin-right-form-squares-grid-div);
height: var(--height-form-squares-grid-div);
@@ -142,24 +127,20 @@ body
box-shadow: var(--box-shadow-form-squares-grid-div) var(--black-opacity-10);
}
-.form-squares-grid > .first
-{
+.form-squares-grid > .first {
background: var(--background-form-squares-grid-first);
}
-.form-squares-grid > .second
-{
+.form-squares-grid > .second {
background: var(--background-form-squares-grid-second);
transform: var(--transform-form-squares-grid-second);
}
-.form-squares-grid > .third
-{
+.form-squares-grid > .third {
background: var(--background-form-squares-grid-third);
}
-.label-main-settings
-{
+.label-main-settings {
position: relative;
margin-bottom: var(--margin-bottom-label-main-settings);
text-align: center;
@@ -169,17 +150,15 @@ body
color: var(--color-label-main-settings);
}
-.main-settings
-{
- position: relative;
- left: var(--left-main-settings);
- height: var(--height-main-settings);
- width: var(--width-main-settings);
- background: var(--background-main-settings);
+.main-settings {
+ position: relative;
+ left: var(--left-main-settings);
+ height: var(--height-main-settings);
+ width: var(--width-main-settings);
+ background: var(--background-main-settings);
}
-.main-settings > input
-{
+.main-settings > input {
position: relative;
top: var(--top-main-settings-input);
width: var(--width-main-settings-input);
@@ -192,28 +171,23 @@ body
outline: none;
}
-.main-settings > input::placeholder
-{
+.main-settings > input::placeholder {
color: var(--color-main-settings-input-placeholder);
}
-.main-settings > input::-webkit-input-placeholder
-{
+.main-settings > input::-webkit-input-placeholder {
color: var(--color-main-settings-input-placeholder);
}
-.main-settings > input::-moz-placeholder
-{
+.main-settings > input::-moz-placeholder {
opacity: 1;
}
-.main-settings > input::-ms-clear
-{
+.main-settings > input::-ms-clear {
display: none;
}
-.main-settings > select
-{
+.main-settings > select {
position: relative;
top: var(--top-main-settings-select);
height: var(--height-main-settings-select);
@@ -226,8 +200,7 @@ body
outline: none;
}
-.main-settings-underline
-{
+.main-settings-underline {
position: relative;
top: var(--top-main-settings-underline);
height: var(--height-main-settings-underline);
@@ -236,8 +209,7 @@ body
box-shadow: var(--box-shadow-main-settings-underline) var(--black-opacity-10);
}
-.label-additional-settings
-{
+.label-additional-settings {
position: relative;
top: var(--top-label-additional-settings);
text-align: center;
@@ -247,20 +219,17 @@ body
color: var(--color-label-additional-settings);
}
-.additional-settings
-{
+.additional-settings {
position: relative;
top: var(--top-additional-settings);
}
-.button-squares-grid
-{
+.button-squares-grid {
position: relative;
top: var(--top-button-squares-grid);
}
-.button-squares-grid > div
-{
+.button-squares-grid > div {
display: inline-block;
position: absolute;
height: var(--height-button-squares-grid-div);
@@ -269,8 +238,7 @@ body
box-shadow: var(--box-shadow-button-squares-grid-div) var(--black-opacity-10);
}
-.button-squares-grid > .first
-{
+.button-squares-grid > .first {
left: var(--left-button-squares-grid-first);
background: var(--background-button-squares-grid-first);
animation: fade-in-square;
@@ -278,15 +246,13 @@ body
animation-fill-mode: forwards;
}
-.button-squares-grid > .second
-{
+.button-squares-grid > .second {
left: var(--left-button-squares-grid-second);
visibility: hidden;
background: var(--background-button-squares-grid-second);
}
-.theme-buttons > input
-{
+.theme-buttons > input {
position: relative;
top: var(--top-theme-buttons-input);
height: var(--height-theme-buttons-input);
@@ -300,25 +266,21 @@ body
box-shadow: var(--box-shadow-theme-buttons-input) var(--black-opacity-10);
}
-.theme-buttons > input:active
-{
+.theme-buttons > input:active {
transform: var(--transform-theme-buttons-input-active);
}
-.theme-buttons > .first
-{
+.theme-buttons > .first {
left: var(--left-theme-buttons-first);
margin-right: var(--margin-right-theme-buttons-first);
background: var(--background-theme-buttons-first);
}
-.theme-buttons > .second
-{
+.theme-buttons > .second {
background: var(--background-theme-buttons-second);
}
-.port
-{
+.port {
position: relative;
top: var(--top-port);
left: var(--left-port);
@@ -335,31 +297,26 @@ body
outline: none;
}
-.port::placeholder
-{
+.port::placeholder {
letter-spacing: 0;
color: var(--color-port-placeholder);
}
-.port::-webkit-input-placeholder
-{
+.port::-webkit-input-placeholder {
letter-spacing: 0;
color: var(--color-port-placeholder);
}
-.port::-moz-placeholder
-{
+.port::-moz-placeholder {
letter-spacing: 0;
opacity: 1;
}
-.port::-ms-clear
-{
+.port::-ms-clear {
display: none;
}
-.submit
-{
+.submit {
position: absolute;
bottom: var(--bottom-submit);
left: var(--left-submit);
@@ -376,58 +333,48 @@ body
box-shadow: var(--box-shadow-submit) var(--black-opacity-10);
}
-.submit:active
-{
+.submit:active {
transform: var(--transform-submit-active);
}
/* index elements */
-.index
-{
+.index {
margin-top: calc((100vh / 2) - (var(--height-index-xl) / 2));
max-width: var(--max-width-index-xl);
min-width: var(--min-width-index-xl);
}
-@media only screen and (max-width: 75rem)
-{
- .index
- {
+@media only screen and (max-width: 75rem) {
+ .index {
margin-top: calc((100vh / 2) - (var(--height-index-lg) / 2));
max-width: var(--max-width-index-lg);
min-width: var(--min-width-index-lg);
}
}
-@media only screen and (max-width: 48rem)
-{
- .index
- {
+@media only screen and (max-width: 48rem) {
+ .index {
margin-top: calc((100vh / 2) - (var(--height-index-md) / 2));
max-width: var(--max-width-index-md);
min-width: var(--min-width-index-md);
}
- .sm-hidden
- {
+ .sm-hidden {
visibility: hidden;
}
}
-.col-sm-12.col-md-6.col-lg-6.col-xl-4
-{
- max-width: var(--max-width-col-sm-12-col-md-6-col-lg-6-col-xl-4);
- min-width: var(--min-width-col-sm-12-col-md-6-col-lg-6-col-xl-4);
+.col-sm-12.col-md-6.col-lg-6.col-xl-4 {
+ max-width: var(--max-width-col-sm-12-col-md-6-col-lg-6-col-xl-4);
+ min-width: var(--min-width-col-sm-12-col-md-6-col-lg-6-col-xl-4);
}
-.col-lg-12.col-xl-8
-{
+.col-lg-12.col-xl-8 {
max-width: var(--max-width-col-lg-12-col-xl-8);
min-width: var(--min-width-col-lg-12-col-xl-8);
}
-.card
-{
+.card {
margin-bottom: var(--margin-bottom-card);
max-height: var(--max-height-card);
min-height: var(--min-height-card);
@@ -439,59 +386,50 @@ body
box-shadow: var(--box-shadow-card) var(--black-opacity-10);
}
-.header
-{
+.header {
position: relative;
display: flex;
top: var(--top-header);
left: var(--left-header);
}
-.hw-logo
-{
+.hw-logo {
height: var(--height-hw-logo);
width: var(--width-hw-logo);
border-radius: var(--border-radius-hw-logo);
}
-.hw-logo.first
-{
+.hw-logo.first {
background: var(--background-hw-logo-first);
}
-.hw-logo.second
-{
+.hw-logo.second {
background: var(--background-hw-logo-second);
}
-.hw-logo.third
-{
+.hw-logo.third {
background: var(--background-hw-logo-third);
}
-.label-hw-info
-{
+.label-hw-info {
position: absolute;
top: var(--top-label-hw-info);
left: var(--left-label-hw-info);
}
-.hw-type
-{
+.hw-type {
font-size: var(--font-size-18pt);
font-weight: var(--font-weight-bold);
color: var(--color-hw-type);
}
-.hw-name
-{
+.hw-name {
font-size: var(--font-size-12pt);
font-weight: var(--font-weight-regular);
color: var(--color-hw-name);
}
-.usage
-{
+.usage {
position: absolute;
height: var(--height-usage);
width: var(--width-usage);
@@ -499,43 +437,36 @@ body
left: var(--left-usage);
}
-.card-body-squares-grid
-{
+.card-body-squares-grid {
position: absolute;
top: var(--top-card-body-squares-grid);
}
-.card-body-squares-grid > div
-{
+.card-body-squares-grid > div {
margin-bottom: var(--margin-bottom-card-body-squares-grid-div);
height: var(--height-card-body-squares-grid-div);
width: var(--width-card-body-squares-grid-div);
}
-.card-body-squares-grid.first > div
-{
+.card-body-squares-grid.first > div {
background: var(--background-card-body-squares-grid-first-div);
}
-.card-body-squares-grid.second > div
-{
+.card-body-squares-grid.second > div {
background: var(--background-card-body-squares-grid-second-div);
}
-.card-body-squares-grid.third > div
-{
+.card-body-squares-grid.third > div {
background: var(--background-card-body-squares-grid-third-div);
}
-.main-hw-info
-{
+.main-hw-info {
position: absolute;
right: 0;
height: var(--height-main-hw-info);
}
-.hw-usage > div
-{
+.hw-usage > div {
position: absolute;
right: 0;
bottom: var(--bottom-hw-usage-div);
@@ -543,14 +474,12 @@ body
font-weight: var(--font-weight-bold);
}
-.usage-value
-{
+.usage-value {
display: flex;
margin-right: var(--margin-right-usage-value);
}
-.usage-value > span
-{
+.usage-value > span {
position: relative;
height: var(--height-usage-value-span);
width: var(--width-usage-value-span);
@@ -559,28 +488,23 @@ body
animation-duration: var(--animation-duration-wiggle-usage-value);
}
-.usage-value > .first
-{
+.usage-value > .first {
animation-delay: var(--animation-delay-usage-value-first);
}
-.usage-value > .second
-{
+.usage-value > .second {
animation-delay: var(--animation-delay-usage-value-second);
}
-.usage-value > .third
-{
+.usage-value > .third {
animation-delay: var(--animation-delay-usage-value-third);
}
-.usage-postfix
-{
+.usage-postfix {
color: var(--color-usage-postfix);
}
-.info-label
-{
+.info-label {
position: relative;
top: var(--top-info-label);
width: var(--width-info-label);
@@ -591,8 +515,7 @@ body
background: transparent;
}
-.usage-underline
-{
+.usage-underline {
position: absolute;
right: 0;
bottom: 0;
@@ -600,23 +523,19 @@ body
width: var(--width-usage-underline);
}
-.usage-underline.first
-{
+.usage-underline.first {
background: var(--background-usage-underline-first);
}
-.usage-underline.second
-{
+.usage-underline.second {
background: var(--background-usage-underline-second);
}
-.usage-underline.third
-{
+.usage-underline.third {
background: var(--background-usage-underline-third);
}
-.footer
-{
+.footer {
position: absolute;
bottom: 0;
left: 0;
@@ -624,43 +543,35 @@ body
width: var(--width-footer);
}
-.footer.first
-{
+.footer.first {
background: var(--background-footer-first);
}
-.footer.first > .card-footer-dots-grid > div > .inner-dot
-{
+.footer.first > .card-footer-dots-grid > div > .inner-dot {
background: var(--background-footer-first-card-footer-dots-grid-div-inner-dot);
}
-.footer.second
-{
+.footer.second {
background: var(--background-footer-second);
}
-.footer.second > .card-footer-dots-grid > div > .inner-dot
-{
+.footer.second > .card-footer-dots-grid > div > .inner-dot {
background: var(--background-footer-second-card-footer-dots-grid-div-inner-dot);
}
-.footer.third
-{
+.footer.third {
background: var(--background-footer-third);
}
-.footer.third > .card-footer-dots-grid > div > .inner-dot
-{
+.footer.third > .card-footer-dots-grid > div > .inner-dot {
background: var(--background-footer-third-card-footer-dots-grid-div-inner-dot);
}
-.card-footer-dots-grid
-{
+.card-footer-dots-grid {
position: absolute;
}
-.card-footer-dots-grid > div
-{
+.card-footer-dots-grid > div {
display: inline-block;
position: absolute;
bottom: var(--bottom-card-footer-dots-grid-div);
@@ -670,23 +581,19 @@ body
background: var(--background-card-footer-dots-grid-div);
}
-.card-footer-dots-grid > .first
-{
+.card-footer-dots-grid > .first {
left: var(--card-footer-dots-grid-first);
}
-.card-footer-dots-grid > .second
-{
+.card-footer-dots-grid > .second {
left: var(--card-footer-dots-grid-second);
}
-.card-footer-dots-grid > .third
-{
+.card-footer-dots-grid > .third {
left: var(--card-footer-dots-grid-third);
}
-.inner-dot
-{
+.inner-dot {
position: absolute;
top: var(--top-inner-dot);
left: var(--left-inner-dot);
@@ -695,13 +602,11 @@ body
border-radius: var(--border-radius-inner-dot);
}
-.detailed-hw-info
-{
+.detailed-hw-info {
position: absolute;
}
-.detailed-hw-info > div
-{
+.detailed-hw-info > div {
display: inline-block;
position: absolute;
top: var(--top-detailed-hw-info-div);
@@ -713,28 +618,23 @@ body
color: var(--color-detailed-hw-info-div);
}
-.detailed-hw-info > .first
-{
+.detailed-hw-info > .first {
left: var(--left-detailed-hw-info-first);
}
-.detailed-hw-info > .second
-{
+.detailed-hw-info > .second {
left: var(--left-detailed-hw-info-second);
}
-.detailed-hw-info > .third
-{
+.detailed-hw-info > .third {
left: var(--left-detailed-hw-info-third);
}
-.dividers
-{
+.dividers {
position: absolute;
}
-.dividers > div
-{
+.dividers > div {
display: inline-block;
position: absolute;
height: var(--height-dividers-div);
@@ -742,25 +642,21 @@ body
background: var(--background-dividers-div);
}
-.dividers > .first
-{
+.dividers > .first {
left: var(--left-dividers-first);
}
-.dividers > .second
-{
+.dividers > .second {
left: var(--left-dividers-second);
}
-.controls
-{
+.controls {
position: absolute;
height: var(--height-controls);
width: var(--width-controls);
}
-.controls > img
-{
+.controls > img {
position: absolute;
top: var(--top-controls-img);
z-index: 2;
@@ -769,43 +665,36 @@ body
border-radius: var(--border-radius-controls-img);
}
-.controls > .first
-{
+.controls > .first {
left: var(--left-controls-first);
opacity: 0.5;
animation: wiggle-first-control;
animation-duration: var(--animation-duration-wiggle-first-control);
}
-.controls > .second
-{
+.controls > .second {
left: var(--left-controls-second);
animation: wiggle-second-control;
animation-duration: var(--animation-duration-wiggle-second-control);
}
-.controls > .first:active
-{
+.controls > .first:active {
transform: var(--transform-controls-first-active);
}
-.controls > .second:active
-{
+.controls > .second:active {
transform: var(--transform-controls-second-active);
}
-.pages
-{
+.pages {
position: absolute;
}
-.pages > div
-{
+.pages > div {
position: absolute;
}
-.contacts-label
-{
+.contacts-label {
position: absolute;
top: var(--top-contacts-label);
z-index: 1;
@@ -817,8 +706,7 @@ body
color: var(--color-contacts-label);
}
-.contacts-description > div
-{
+.contacts-description > div {
position: absolute;
z-index: 1;
width: var(--width-contacts-description-div);
@@ -829,18 +717,15 @@ body
color: var(--color-contacts-description-div);
}
-.contacts-description > .first
-{
+.contacts-description > .first {
top: var(--top-contacts-description-first);
}
-.contacts-description > .second
-{
+.contacts-description > .second {
top: var(--top-contacts-description-second);
}
-.contacts-links > a > img
-{
+.contacts-links > a > img {
position: absolute;
top: var(--top-contacts-links-a-img);
z-index: 1;
@@ -848,28 +733,23 @@ body
width: var(--width-contacts-links-a-img);
}
-.contacts-links > a > .first
-{
+.contacts-links > a > .first {
left: var(--left-contacts-links-a-first);
}
-.contacts-links > a > .first:active
-{
+.contacts-links > a > .first:active {
transform: var(--transform-contacts-links-a-first-active);
}
-.contacts-links > a > .second
-{
+.contacts-links > a > .second {
left: var(--left-contacts-links-a-second);
}
-.contacts-links > a > .second:active
-{
+.contacts-links > a > .second:active {
transform: var(--transform-contacts-links-a-second-active);
}
-.uptime
-{
+.uptime {
position: absolute;
bottom: 0;
left: 0;
@@ -878,15 +758,13 @@ body
background: var(--background-uptime);
}
-.uptime-squares-grid
-{
+.uptime-squares-grid {
position: relative;
bottom: var(--bottom-uptime-squares-grid);
left: var(--left-uptime-squares-grid);
}
-.uptime-squares-grid > div
-{
+.uptime-squares-grid > div {
display: inline-block;
margin-right: var(--margin-right-uptime-squares-grid-div);
height: var(--height-uptime-squares-grid-div);
@@ -894,31 +772,26 @@ body
box-shadow: var(--box-shadow-uptime-squares-grid-div) var(--black-opacity-10);
}
-.uptime-squares-grid > .first
-{
+.uptime-squares-grid > .first {
background: var(--background-uptime-squares-grid-first);
}
-.uptime-squares-grid > .second
-{
+.uptime-squares-grid > .second {
background: var(--background-uptime-squares-grid-second);
transform: var(--transform-uptime-squares-grid-second);
}
-.uptime-squares-grid > .third
-{
+.uptime-squares-grid > .third {
background: var(--background-uptime-squares-grid-third);
}
-.uptime-rectangle-grid
-{
+.uptime-rectangle-grid {
position: absolute;
top: var(--top-uptime-rectangle-grid);
left: var(--left-uptime-rectangle-grid);
}
-.values-grid > div
-{
+.values-grid > div {
display: inline-block;
margin-right: var(--margin-right-values-grid-div);
height: var(--height-values-grid-div);
@@ -931,14 +804,16 @@ body
border-radius: 2px
}
-.values-grid > div > p
-{
+.values-grid > div:first-child {
+ width: var(--day-width-values-grid-div);
+}
+
+.values-grid > div > p {
position: relative;
bottom: var(--bottom-values-grid-div-p);
}
-.labels-grid > div
-{
+.labels-grid > div {
display: inline-block;
margin-right: var(--margin-right-labels-grid-div);
margin-bottom: var(--margin-bottom-labels-grid-div);
@@ -949,11 +824,14 @@ body
font-weight: var(--font-weight-regular);
color: var(--color-labels-grid-div);
background: var(--background-labels-grid-div);
- border-radius:2px
+ border-radius: 2px
+}
+
+.labels-grid > div:first-child {
+ width: var(--day-width-labels-grid-div);
}
-.chart-label
-{
+.chart-label {
position: absolute;
top: var(--top-chart-label);
left: var(--left-chart-label);
@@ -962,14 +840,12 @@ body
color: var(--color-chart-label);
}
-.chart-triangle-grid
-{
+.chart-triangle-grid {
position: absolute;
top: var(--top-chart-triangle-grid);
}
-.chart-triangle-grid > div
-{
+.chart-triangle-grid > div {
position: absolute;
border-style: solid;
border-width: var(--border-width-chart-triangle-grid-div);
@@ -980,32 +856,27 @@ body
animation-fill-mode: forwards;
}
-.chart-triangle-grid > .first
-{
+.chart-triangle-grid > .first {
left: var(--left-chart-triangle-grid-first);
border-color: var(--border-color-chart-triangle-grid-first) transparent;
}
-.chart-triangle-grid > .second
-{
+.chart-triangle-grid > .second {
left: var(--left-chart-triangle-grid-second);
border-color: var(--border-color-chart-triangle-grid-second) transparent;
}
-.chart-triangle-grid > .third
-{
+.chart-triangle-grid > .third {
left: var(--left-chart-triangle-grid-third);
border-color: var(--border-color-chart-triangle-grid-third) transparent;
}
-.chart-rectangle-grid
-{
+.chart-rectangle-grid {
position: absolute;
top: var(--top-chart-rectangle-grid);
}
-.chart-rectangle-grid > div
-{
+.chart-rectangle-grid > div {
display: inline-block;
position: absolute;
height: var(--height-chart-rectangle-grid-div);
@@ -1013,31 +884,26 @@ body
cursor: pointer;
}
-.chart-rectangle-grid > div:active
-{
+.chart-rectangle-grid > div:active {
transform: var(--transform-chart-rectangle-grid-div-active);
}
-.chart-rectangle-grid > .first
-{
+.chart-rectangle-grid > .first {
left: var(--left-chart-rectangle-grid-first);
background: var(--background-chart-rectangle-grid-first);
}
-.chart-rectangle-grid > .second
-{
+.chart-rectangle-grid > .second {
left: var(--left-chart-rectangle-grid-second);
background: var(--background-chart-rectangle-grid-second);
}
-.chart-rectangle-grid > .third
-{
+.chart-rectangle-grid > .third {
left: var(--left-chart-rectangle-grid-third);
background: var(--background-chart-rectangle-grid-third);
}
-.chart-container
-{
+.chart-container {
position: absolute;
top: var(--top-chart-container);
left: var(--left-chart-container);
@@ -1047,8 +913,7 @@ body
border: var(--border-chart-container) solid var(--grey-light);
}
-#project-version
-{
+#project-version {
position: relative;
bottom: var(--bottom-project-version);
opacity: 0;
@@ -1058,15 +923,13 @@ body
}
/* error classes */
-.error
-{
+.error {
margin-top: calc((100vh / 2) - (var(--height-error) / 2));
max-width: var(--min-width-error);
min-width: var(--min-width-error);
}
-.error-img
-{
+.error-img {
display: block;
position: relative;
z-index: 1;
@@ -1078,8 +941,7 @@ body
box-shadow: var(--box-shadow-error-img) var(--black-opacity-10);
}
-.error-div
-{
+.error-div {
position: relative;
left: var(--left-error-div);
z-index: 1;
@@ -1094,13 +956,11 @@ body
animation-fill-mode: forwards;
}
-.error-div > div
-{
+.error-div > div {
position: absolute;
}
-.code
-{
+.code {
top: var(--top-code);
left: var(--left-code);
font-size: var(--font-size-21pt);
@@ -1108,8 +968,7 @@ body
color: var(--color-code);
}
-.title
-{
+.title {
top: var(--top-title);
left: var(--left-title);
font-size: var(--font-size-31pt);
@@ -1117,21 +976,18 @@ body
color: var(--color-title);
}
-.explanation
-{
+.explanation {
top: var(--top-explanation);
left: var(--left-explanation);
}
-.explanation > div
-{
+.explanation > div {
font-size: var(--font-size-13pt);
font-weight: var(--font-weight-regular);
color: var(--color-explanation-div);
}
-.advice
-{
+.advice {
width: var(--width-advice);
bottom: var(--bottom-advice);
text-align: center;
From 2cc53184cda0eaa584d84bef75f7b6a8105cccee Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Sun, 20 Mar 2022 18:10:44 +0000
Subject: [PATCH 021/201] add docker-compose
---
README.md | 2 ++
docker-compose.yml | 13 +++++++++++++
2 files changed, 15 insertions(+)
create mode 100644 docker-compose.yml
diff --git a/README.md b/README.md
index 910c2f0d..e0308cf0 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,8 @@
* `docker run --restart unless-stopped -it -d --name ward -p 4000:4000 -e WARD_PORT=4000 -e WARD_THEME=dark --privileged antonyleons/ward`
* Go to localhost:4000 in web browser
+Also see the example [docker-compose.yml](https://github.com/AntonyLeons/Ward/blob/main/docker-compose.yml) file in the root directory.
+
## Java
Download the latest release from [here](https://github.com/AntonyLeons/Ward/releases/latest)
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..03fedd5f
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,13 @@
+version: '3.3'
+services:
+ run:
+ restart: unless-stopped
+ container_name: ward
+ ports:
+ - '4000:4000'
+ environment:
+ - WARD_PORT=4000
+ - WARD_THEME=dark
+ - WARD_NAME=leons-server
+ privileged: true
+ image: antonyleons/ward
\ No newline at end of file
From d2a59929d8f101b6b047a9ef9fdd8b073c0d21e4 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Mon, 21 Mar 2022 16:47:09 +0000
Subject: [PATCH 022/201] add dependabot
---
.github/dependabot.yml | 7 +++
.github/workflows/codeql-analysis.yml | 70 ---------------------------
2 files changed, 7 insertions(+), 70 deletions(-)
create mode 100644 .github/dependabot.yml
delete mode 100644 .github/workflows/codeql-analysis.yml
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..93067668
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,7 @@
+version: 2
+updates:
+- package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
\ No newline at end of file
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
deleted file mode 100644
index 16a0b312..00000000
--- a/.github/workflows/codeql-analysis.yml
+++ /dev/null
@@ -1,70 +0,0 @@
-# For most projects, this workflow file will not need changing; you simply need
-# to commit it to your repository.
-#
-# You may wish to alter this file to override the set of languages analyzed,
-# or to provide custom queries or build logic.
-#
-# ******** NOTE ********
-# We have attempted to detect the languages in your repository. Please check
-# the `language` matrix defined below to confirm you have the correct set of
-# supported CodeQL languages.
-#
-name: "CodeQL"
-
-on:
- push:
- branches: [ master ]
- pull_request:
- # The branches below must be a subset of the branches above
- branches: [ master ]
- schedule:
- - cron: '34 16 * * 5'
-
-jobs:
- analyze:
- name: Analyze
- runs-on: ubuntu-latest
- permissions:
- actions: read
- contents: read
- security-events: write
-
- strategy:
- fail-fast: false
- matrix:
- language: [ 'java', 'javascript' ]
- # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
- # Learn more about CodeQL language support at https://git.io/codeql-language-support
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v1
- with:
- languages: ${{ matrix.language }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
- # queries: ./path/to/local/query, your-org/your-repo/queries@main
-
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v1
-
- # ℹ️ Command-line programs to run using the OS shell.
- # 📚 https://git.io/JvXDl
-
- # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
- # and modify them (or add more) to build your code if your project
- # uses a compiled language
-
- #- run: |
- # make bootstrap
- # make release
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v1
From 635dc39460c540f01203a530e2a215aa2a7fe763 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Mon, 21 Mar 2022 17:51:06 +0000
Subject: [PATCH 023/201] add github actions
---
.github/workflows/build-jar.yml | 17 +++++++++++++++++
.github/workflows/docker-image.yml | 13 +++++++++++++
2 files changed, 30 insertions(+)
create mode 100644 .github/workflows/build-jar.yml
create mode 100644 .github/workflows/docker-image.yml
diff --git a/.github/workflows/build-jar.yml b/.github/workflows/build-jar.yml
new file mode 100644
index 00000000..7b1d458c
--- /dev/null
+++ b/.github/workflows/build-jar.yml
@@ -0,0 +1,17 @@
+name: build-jar
+on: pull_request
+jobs:
+ build-and-upload:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-java@v2
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ - run: mvn clean package
+ - run: mkdir staging && cp target/*.jar staging
+ - uses: actions/upload-artifact@v3
+ with:
+ name: Package
+ path: staging
\ No newline at end of file
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
new file mode 100644
index 00000000..1da5cff1
--- /dev/null
+++ b/.github/workflows/docker-image.yml
@@ -0,0 +1,13 @@
+name: docker-image
+on: release
+jobs:
+ build-and-push:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Build and push Docker images
+ uses: docker/build-push-action@v2.10.0
+ with:
+ push: true
+ platform: linux/amd64,linux/arm64,linux/s390x
+ tags: antonyleons/ward:latest,antonyleons/ward:${GITHUB_REF#refs/tags/}
+
From dccadef1eae408471ad551761010f8b9b65a7979 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 21 Mar 2022 17:54:12 +0000
Subject: [PATCH 024/201] Bump oshi-core from 6.1.3 to 6.1.5 (#8)
Bumps [oshi-core](https://github.com/oshi/oshi) from 6.1.3 to 6.1.5.
- [Release notes](https://github.com/oshi/oshi/releases)
- [Changelog](https://github.com/oshi/oshi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/oshi/oshi/compare/oshi-parent-6.1.3...oshi-parent-6.1.5)
---
updated-dependencies:
- dependency-name: com.github.oshi:oshi-core
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 35bbf8d9..32a4517f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
- 6.1.3
+ 6.1.55.10.01.18.220.5.4
From 415877e2a802a19c64a061b57b0cedf1956bc737 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 21 Mar 2022 17:54:24 +0000
Subject: [PATCH 025/201] Bump spring-boot-starter-parent from 2.6.3 to 2.6.4
(#7)
Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v2.6.3...v2.6.4)
---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 32a4517f..f4689ce5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
org.springframework.bootspring-boot-starter-parent
- 2.6.3
+ 2.6.4
From 83d82825ffd2f71f4b089e981da5a891177428b9 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Mon, 21 Mar 2022 18:33:42 +0000
Subject: [PATCH 026/201] Update dependabot.yml (#9)
* Update dependabot.yml
* fix github action
---
.github/dependabot.yml | 15 ++++++++++-----
.github/workflows/build-jar.yml | 6 +++---
pom.xml | 2 +-
3 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 93067668..c5000d01 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,7 +1,12 @@
version: 2
updates:
-- package-ecosystem: "maven"
- directory: "/"
- schedule:
- interval: daily
- open-pull-requests-limit: 10
\ No newline at end of file
+ - package-ecosystem: "maven"
+ directory: "/"
+ schedule:
+ interval: daily
+ open-pull-requests-limit: 10
+
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
\ No newline at end of file
diff --git a/.github/workflows/build-jar.yml b/.github/workflows/build-jar.yml
index 7b1d458c..efadd12c 100644
--- a/.github/workflows/build-jar.yml
+++ b/.github/workflows/build-jar.yml
@@ -9,9 +9,9 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
+ - run: mvn clean install
- run: mvn clean package
- - run: mkdir staging && cp target/*.jar staging
- uses: actions/upload-artifact@v3
with:
- name: Package
- path: staging
\ No newline at end of file
+ name: Ward.jar
+ path: target/*.jar
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index f4689ce5..147a121f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0dev.leonsward
- 2.1.1
+ 2.1.2jar
From b16a29caaa179a5732d501884b4c8165bf620a76 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 21 Mar 2022 18:36:40 +0000
Subject: [PATCH 027/201] Bump actions/checkout from 2 to 3 (#10)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/build-jar.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build-jar.yml b/.github/workflows/build-jar.yml
index efadd12c..c03c54dd 100644
--- a/.github/workflows/build-jar.yml
+++ b/.github/workflows/build-jar.yml
@@ -4,7 +4,7 @@ jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
java-version: '17'
From 84cc961cc7c513f860c634b4f99ce1b2084a06b8 Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Mon, 21 Mar 2022 20:38:03 +0000
Subject: [PATCH 028/201] fix docker build
---
.github/workflows/docker-image.yml | 31 ++++++++++++++++++++++--------
pom.xml | 2 +-
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
index 1da5cff1..52d730dd 100644
--- a/.github/workflows/docker-image.yml
+++ b/.github/workflows/docker-image.yml
@@ -1,13 +1,28 @@
name: docker-image
-on: release
+on:
+ release:
+ types: [published]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- - name: Build and push Docker images
- uses: docker/build-push-action@v2.10.0
- with:
- push: true
- platform: linux/amd64,linux/arm64,linux/s390x
- tags: antonyleons/ward:latest,antonyleons/ward:${GITHUB_REF#refs/tags/}
-
+ - name: Checkout
+ uses: actions/checkout@v2
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v1
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v1
+ - name: Login to DockerHub
+ uses: docker/login-action@v1
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_TOKEN }}
+ - name: Get the tag name
+ run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
+ - name: Build and push Docker images
+ uses: docker/build-push-action@v2.10.0
+ with:
+ context: .
+ push: true
+ platforms: linux/amd64,linux/arm64,linux/s390x
+ tags: antonyleons/ward:latest,antonyleons/ward:${{ env.TAG }}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 147a121f..32896bdc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0dev.leonsward
- 2.1.2
+ 2.1.7jar
From e983cdae06f4d12e9cd259af23cb86d9e3f2af99 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 27 Mar 2022 21:05:30 +0100
Subject: [PATCH 029/201] Bump spring-boot-starter-parent from 2.6.4 to 2.6.5
(#11)
Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.6.4 to 2.6.5.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v2.6.4...v2.6.5)
---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 32896bdc..e938722b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
org.springframework.bootspring-boot-starter-parent
- 2.6.4
+ 2.6.5
From 31e0be14e6793dbd3dd3ac4cf04a161287d64820 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 29 Mar 2022 23:15:06 +0100
Subject: [PATCH 030/201] Bump jnaVersion from 5.10.0 to 5.11.0 (#12)
Bumps `jnaVersion` from 5.10.0 to 5.11.0.
Updates `jna` from 5.10.0 to 5.11.0
- [Release notes](https://github.com/java-native-access/jna/releases)
- [Changelog](https://github.com/java-native-access/jna/blob/master/CHANGES.md)
- [Commits](https://github.com/java-native-access/jna/compare/5.10.0...5.11.0)
Updates `jna-platform` from 5.10.0 to 5.11.0
- [Release notes](https://github.com/java-native-access/jna/releases)
- [Changelog](https://github.com/java-native-access/jna/blob/master/CHANGES.md)
- [Commits](https://github.com/java-native-access/jna/compare/5.10.0...5.11.0)
---
updated-dependencies:
- dependency-name: net.java.dev.jna:jna
dependency-type: direct:production
update-type: version-update:semver-minor
- dependency-name: net.java.dev.jna:jna-platform
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e938722b..3de76175 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
6.1.5
- 5.10.0
+ 5.11.01.18.220.5.4
From 582175619c90fce559b34ac22f92a0aa6b7fd14b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sun, 3 Apr 2022 15:56:06 +0100
Subject: [PATCH 031/201] Bump spring-boot-starter-parent from 2.6.5 to 2.6.6
(#15)
Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.6.5 to 2.6.6.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v2.6.5...v2.6.6)
---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 3de76175..379e2072 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
org.springframework.bootspring-boot-starter-parent
- 2.6.5
+ 2.6.6
From 1ff227e814e42486505934a9c2c351daa539da0f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 12 Apr 2022 12:28:59 +0100
Subject: [PATCH 032/201] Bump actions/setup-java from 2 to 3 (#16)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2 to 3.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v2...v3)
---
updated-dependencies:
- dependency-name: actions/setup-java
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/build-jar.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build-jar.yml b/.github/workflows/build-jar.yml
index c03c54dd..c2ce068b 100644
--- a/.github/workflows/build-jar.yml
+++ b/.github/workflows/build-jar.yml
@@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- - uses: actions/setup-java@v2
+ - uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
From e21772d4ce011e8508057b3c577045a8e7d974b0 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 12 Apr 2022 12:29:10 +0100
Subject: [PATCH 033/201] Bump oshi-core from 6.1.5 to 6.1.6 (#17)
Bumps [oshi-core](https://github.com/oshi/oshi) from 6.1.5 to 6.1.6.
- [Release notes](https://github.com/oshi/oshi/releases)
- [Changelog](https://github.com/oshi/oshi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/oshi/oshi/compare/oshi-parent-6.1.5...oshi-parent-6.1.6)
---
updated-dependencies:
- dependency-name: com.github.oshi:oshi-core
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 379e2072..2c55d5d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
- 6.1.5
+ 6.1.65.11.01.18.220.5.4
From 2be56e14fdcdcba3d1d5cef6ff38f35bde1ff9d1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 19 Apr 2022 06:12:33 +0100
Subject: [PATCH 034/201] Bump lombok from 1.18.22 to 1.18.24 (#18)
Bumps [lombok](https://github.com/projectlombok/lombok) from 1.18.22 to 1.18.24.
- [Release notes](https://github.com/projectlombok/lombok/releases)
- [Changelog](https://github.com/projectlombok/lombok/blob/master/doc/changelog.markdown)
- [Commits](https://github.com/projectlombok/lombok/compare/v1.18.22...v1.18.24)
---
updated-dependencies:
- dependency-name: org.projectlombok:lombok
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 2c55d5d0..34458045 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
6.1.65.11.0
- 1.18.22
+ 1.18.240.5.4
From 26ea83663ed66f5aabdbb30ee58f2ebb0ca1ac4f Mon Sep 17 00:00:00 2001
From: Antony Leons
Date: Thu, 21 Apr 2022 17:26:43 +0100
Subject: [PATCH 035/201] Merge branch 'master'
---
LICENSE | 2 +-
README.md | 102 +++------------------------------------------
images/logo.png | Bin 0 -> 89577 bytes
images/preview.png | Bin 0 -> 215704 bytes
4 files changed, 7 insertions(+), 97 deletions(-)
create mode 100644 images/logo.png
create mode 100644 images/preview.png
diff --git a/LICENSE b/LICENSE
index 254dab92..b51889fd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2020 B-Software
+Copyright (c) 2022 B-Software
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index e0308cf0..3a6cbd20 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-
+
---
@@ -32,109 +32,19 @@ Ward works nice on all popular operating systems, because it uses [OSHI](https:/
**All features tested on:** `Windows` `Linux`
-
- Preview Image
+
+
Preview Image
---
-### Features
-
-
-
-
Processor name
-
-
-
-
-
-
Processor utilization percentage
-
-
-
Processor cores count (Logical and physical ones)
-
-
-
Current frequency of the processor
-
-
-
Does the processor supports 64-bit instructions
-
-
-
-
-
-
-
-
Type of operating system and it's version
-
-
-
-
-
-
RAM utilization percentage
-
-
-
Amount of total installed RAM
-
-
-
Generation of the installed RAM (If you have dmidecode)
-
-
-
Current processes count
-
-
-
-
-
-
-
-
Host0 storage name
-
-
-
-
-
-
Storage utilization percentage
-
-
-
Total current storage installed (Including external drives)
-
-
-
Installed disks count
-
-
-
Total amount of virtual memory (Swap in Linux)
-
-
-
-
-
-
-
-
-
-
-
-
-
- This block contain uptime and chart sections. Uptime represent time since last boot on Linux, and time between hard resets on Windows.
- Also it have paginator which can be useful to get author contacts.
- Chart section display last fifteen seconds of server utilization. (Proccesor, ram, storage)
- You can hide separated datasets by clicking on rectangles on the top right corner of chart section.
-
-
-
-
----
-
### Installation
Create your own jar
- 1. Clone the project
- 2. Import project in your IDE as Maven project
- 3. mvn clean package
- 4. jar will be in the target folder
+ • Clone the project
+ • Import project in your IDE as Maven project
+ • mvn clean package
diff --git a/images/logo.png b/images/logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..8b89757c24fbfa84c789393aba440a4f3ad0f8c4
GIT binary patch
literal 89577
zcmbTd1ymf}vM4;bdvFMY1qkl$8c2W;+;#B5-63djC%8j!cMtA_;O;&^a2bAb?sw0+
z@BR15dcCG?cX{nyvv+lMxU!-w1}X_E006-FASa~)0Ki=R-H{PrTSn*BBVJD^_HtTI
z000`^-yH_AI5|tZzN+z$LH=84
zCshx7GgcKdCp#BM6EkVoS23yoYGW@T>1bx;Z0D$IXJ_-Do>Kl#k%1hXEbKsf4NI`8
zotqQGe?c&lGIBN(rh4@n2Q%AWm#MPz3$U{ZaPu>=aSE`p{RikLJ5x)L$NvwMgH3>w
zSAc`>e*k^$Gp0t)M*l}(QxgG@oujSMtHPGHM&@R$_F!`=;J?i%AZce~=lII_RXWap
zN%85Ezz49Cvk}`B{M^ROCLm)@
z6Jstu4pSbJ|HPNFGjaLr+5f~heZ}WC;$b&s=VWK*Ffub`=HubwVCFM3HHmVf4hW$oTbyNvpoJ85ns$4{<*TT1pccR2pF0C?cKsu
zCV$;(W=i!>v*mwdf&V)V{)4QWh1o07|Bbu<1I)<|K7y|KSwY|Jh&vdiGxe(0_uz
zMzz0}|Bk1xH~)^vX5d%Sj<4|+8$GZV0HZPcK}uZJJ>%rrGLdH9CDUy75V}2tjCQ-<
z*#3Cdw(J(3HZ6`s?mYE+FeNqaQpyR!6gc>MSl|~x?fB;g4CnmD^B<@c!~^=Pe_)z1
zramA12ePw0X-@u>;J;80Hh9EjbKU;Zbe`(5^^cZ-{6lsbKpwpI55Fdu|H?o)J*w`D
zv%8Jp5bBLQNPuHnye(hv3MtmXMCAJ?KkI#;J#sCU)>YX3IDnBb^#96}dU
z+)#qi@>66mhMeFdJLheLrf+cp3dKO0ok
z*c?F=_Cql|Y$|CqJX^P;^YY2>Nff%8#JleP`x}%1`r7*HnYTaQc-&Q`Wqdz`{x*0d
zL?XocxYp4K+Jk{d-haahS*A*+BIE~@?U%P!l%M7=hf2`&YC*K#FP@6#Ez^5;H{
zuKJ5T(kg=K(jJK6Z4Vrrq)*pn%ewF7L2gerDpxe@IZj0QqO1{)YHkh;5X(^d!&B*Y
z&xfcX30;qEFAo-OtWe8|o;WcR?i+KS-*3x(WWPfJ09wkFWPRwU
z=u_Xzd6IH&6YU!-9a7}Loa&kYv+1C<-)fNnqLuAG%gjRo;!I%MN{Sf)cl>UQ#O(v}
z+alipNac_7<#W(`M?q{?{GwJQqn7|P3
z%oP%x7)uJoiHxbT%Ea}H;S|x;+4JEkrc6k6dt;40mo9GTkW3Mv`l
zsty-Q9DZ~m<#SY77;grF$Y@-M;UoPx#h?paVh}Z{4v}$)DX3*~ztNV>qW`vibZliV
zw}h+7$<$@2Ok=`M_~n$f!{>VBcUg4Zpm}4NAzOaB_#cTdixjz%`s#SW3QPeD6o}6g
z%F~e@^jlm&Ztg|J_yEKXjtz!Wewbgi62YNG?(sEp#IKe9xK0c}K?F^QL{zC+1aS%=
zD+c8DNtVvHv(gbts)XhHp#U;P{i0vaMV|-9o7R0FtuzR&%x=wKZKi0y3JI~ZukE(N
zmiQ8hnNJ_(@cdXgMmb-(>KzI