From 7a996004f0f93334146ae3d249ca405377eb0b72 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Mon, 3 Apr 2023 15:39:22 -0500 Subject: [PATCH] HTTPD now supports dark mode --- build.gradle.kts | 2 +- .../plex/request/impl/SchematicDownloadEndpoint.java | 7 ++++--- src/main/resources/dev/test.html | 11 ++++++----- src/main/resources/httpd/template.html | 11 ++++++----- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9d93d95..9282f82 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,7 +30,7 @@ repositories { dependencies { implementation("org.projectlombok:lombok:1.18.26") annotationProcessor("org.projectlombok:lombok:1.18.26") - implementation("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT") + implementation("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT") implementation("dev.plex:server:1.3-SNAPSHOT") implementation("org.json:json:20230227") implementation("org.reflections:reflections:0.10.2") diff --git a/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java b/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java index aa3ae71..cce777d 100644 --- a/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java +++ b/src/main/java/dev/plex/request/impl/SchematicDownloadEndpoint.java @@ -6,6 +6,7 @@ import dev.plex.request.GetMapping; import dev.plex.util.PlexLog; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; + import java.io.File; import java.io.IOException; import java.io.OutputStream; @@ -15,6 +16,8 @@ import java.util.List; public class SchematicDownloadEndpoint extends AbstractServlet { + List files = new ArrayList<>(); + @GetMapping(endpoint = "/api/schematics/download/") public String downloadSchematic(HttpServletRequest request, HttpServletResponse response) { @@ -86,11 +89,10 @@ public class SchematicDownloadEndpoint extends AbstractServlet " \n"); } file = file.replace("${schematics}", sb.toString()); + files.clear(); return file; } - List files = new ArrayList<>(); - public List listFilesForFolder(final File folder) { for (File fileEntry : folder.listFiles()) @@ -105,7 +107,6 @@ public class SchematicDownloadEndpoint extends AbstractServlet files.add(fileEntry); } } - PlexLog.debug(files.toString()); return files; } } diff --git a/src/main/resources/dev/test.html b/src/main/resources/dev/test.html index 216ff15..b4b55a1 100644 --- a/src/main/resources/dev/test.html +++ b/src/main/resources/dev/test.html @@ -2,18 +2,19 @@ - - + ${TITLE} - Plex HTTPD -