HTTPD now supports dark mode

This commit is contained in:
Telesphoreo 2023-04-03 15:39:22 -05:00
parent 46ff09bf58
commit 7a996004f0
4 changed files with 17 additions and 14 deletions

View File

@ -30,7 +30,7 @@ repositories {
dependencies { dependencies {
implementation("org.projectlombok:lombok:1.18.26") implementation("org.projectlombok:lombok:1.18.26")
annotationProcessor("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("dev.plex:server:1.3-SNAPSHOT")
implementation("org.json:json:20230227") implementation("org.json:json:20230227")
implementation("org.reflections:reflections:0.10.2") implementation("org.reflections:reflections:0.10.2")

View File

@ -6,6 +6,7 @@ import dev.plex.request.GetMapping;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
@ -15,6 +16,8 @@ import java.util.List;
public class SchematicDownloadEndpoint extends AbstractServlet public class SchematicDownloadEndpoint extends AbstractServlet
{ {
List<File> files = new ArrayList<>();
@GetMapping(endpoint = "/api/schematics/download/") @GetMapping(endpoint = "/api/schematics/download/")
public String downloadSchematic(HttpServletRequest request, HttpServletResponse response) public String downloadSchematic(HttpServletRequest request, HttpServletResponse response)
{ {
@ -86,11 +89,10 @@ public class SchematicDownloadEndpoint extends AbstractServlet
" </tr>\n"); " </tr>\n");
} }
file = file.replace("${schematics}", sb.toString()); file = file.replace("${schematics}", sb.toString());
files.clear();
return file; return file;
} }
List<File> files = new ArrayList<>();
public List<File> listFilesForFolder(final File folder) public List<File> listFilesForFolder(final File folder)
{ {
for (File fileEntry : folder.listFiles()) for (File fileEntry : folder.listFiles())
@ -105,7 +107,6 @@ public class SchematicDownloadEndpoint extends AbstractServlet
files.add(fileEntry); files.add(fileEntry);
} }
} }
PlexLog.debug(files.toString());
return files; return files;
} }
} }

View File

@ -2,18 +2,19 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous"> integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/Telesphoreo/bootstrap-color-switcher@master/script.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@200;400&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@200;400&display=swap" rel="stylesheet">
<title>${TITLE} - Plex HTTPD</title> <title>${TITLE} - Plex HTTPD</title>
</head> </head>
<body style="font-family: 'IBM Plex Sans', sans-serif;"> <body style="font-family: 'IBM Plex Sans', sans-serif;">
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid"> <div class="container-fluid">
<a class="navbar-brand" href="/" style="font-weight:200;">Plex HTTPD</a> <a class="navbar-brand" href="/" style="font-weight:200;">Plex HTTPD</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"

View File

@ -2,18 +2,19 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous"> integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script> crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/Telesphoreo/bootstrap-color-switcher@master/script.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@200;400&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@200;400&display=swap" rel="stylesheet">
<title>${TITLE} - Plex HTTPD</title> <title>${TITLE} - Plex HTTPD</title>
</head> </head>
<body style="font-family: 'IBM Plex Sans', sans-serif;"> <body style="font-family: 'IBM Plex Sans', sans-serif;">
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid"> <div class="container-fluid">
<a class="navbar-brand" href="/" style="font-weight:200;">Plex HTTPD</a> <a class="navbar-brand" href="/" style="font-weight:200;">Plex HTTPD</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"