add list page

This commit is contained in:
Telesphoreo 2022-04-17 17:37:00 -05:00
parent ef5ff6b540
commit 01d2cf44ea
3 changed files with 6 additions and 6 deletions

View File

@ -8,6 +8,7 @@ import dev.plex.request.impl.IndexEndpoint;
import dev.plex.request.impl.ListEndpoint; import dev.plex.request.impl.ListEndpoint;
import dev.plex.request.impl.PunishmentsEndpoint; import dev.plex.request.impl.PunishmentsEndpoint;
import dev.plex.request.impl.SchematicDownloadEndpoint; import dev.plex.request.impl.SchematicDownloadEndpoint;
import dev.plex.request.impl.SchematicIndexEndpoint;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import lombok.Getter; import lombok.Getter;
@ -69,6 +70,7 @@ public class HTTPDModule extends PlexModule
new ListEndpoint(); new ListEndpoint();
new PunishmentsEndpoint(); new PunishmentsEndpoint();
new SchematicDownloadEndpoint(); new SchematicDownloadEndpoint();
new SchematicIndexEndpoint();
server.setConnectors(new Connector[]{connector}); server.setConnectors(new Connector[]{connector});
server.setHandler(context); server.setHandler(context);

View File

@ -1,16 +1,14 @@
package dev.plex.request.impl; package dev.plex.request.impl;
import com.google.gson.GsonBuilder;
import dev.plex.request.AbstractServlet; import dev.plex.request.AbstractServlet;
import dev.plex.request.GetMapping; import dev.plex.request.GetMapping;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class SchematicIndexEndpoint extends AbstractServlet public class SchematicIndexEndpoint extends AbstractServlet
{ {
@GetMapping(endpoint = "/api/list/") @GetMapping(endpoint = "/api/schematics/")
public String schematicIndex(HttpServletRequest request) public String schematicIndex(HttpServletRequest request)
{ {
return readFile(this.getClass().getResourceAsStream("/httpd/schematic_list.html"));
} }
} }

View File

@ -45,8 +45,8 @@
<h2>Plex HTTPD</h2> <h2>Plex HTTPD</h2>
<h5>Welcome to the schematic page. Please select if you would like to download or upload a schematic.</h5> <h5>Welcome to the schematic page. Please select if you would like to download or upload a schematic.</h5>
<div class="d-grid gap-2 col-2 mx-auto"> <div class="d-grid gap-2 col-2 mx-auto">
<button type="button" class="btn btn-success btn-sm p-2">Download</button> <button type="button" class="btn btn-outline-info btn-sm p-2"><a href="/api/schematics/download/">Download</a></button>
<button type="button" class="btn btn-primary btn-sm p-2">Upload</button> <button type="button" class="btn btn-outline-info btn-sm p-2"><a href="/api/schematics/upload/">Upload</a></button>
</div> </div>
</div> </div>
</body> </body>