mirror of
https://github.com/plexusorg/Module-HTTPD.git
synced 2024-11-21 19:25:02 +00:00
add list page
This commit is contained in:
parent
ef5ff6b540
commit
01d2cf44ea
@ -8,6 +8,7 @@ import dev.plex.request.impl.IndexEndpoint;
|
||||
import dev.plex.request.impl.ListEndpoint;
|
||||
import dev.plex.request.impl.PunishmentsEndpoint;
|
||||
import dev.plex.request.impl.SchematicDownloadEndpoint;
|
||||
import dev.plex.request.impl.SchematicIndexEndpoint;
|
||||
import dev.plex.util.PlexLog;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import lombok.Getter;
|
||||
@ -69,6 +70,7 @@ public class HTTPDModule extends PlexModule
|
||||
new ListEndpoint();
|
||||
new PunishmentsEndpoint();
|
||||
new SchematicDownloadEndpoint();
|
||||
new SchematicIndexEndpoint();
|
||||
|
||||
server.setConnectors(new Connector[]{connector});
|
||||
server.setHandler(context);
|
||||
|
@ -1,16 +1,14 @@
|
||||
package dev.plex.request.impl;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import dev.plex.request.AbstractServlet;
|
||||
import dev.plex.request.GetMapping;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class SchematicIndexEndpoint extends AbstractServlet
|
||||
{
|
||||
@GetMapping(endpoint = "/api/list/")
|
||||
@GetMapping(endpoint = "/api/schematics/")
|
||||
public String schematicIndex(HttpServletRequest request)
|
||||
{
|
||||
return readFile(this.getClass().getResourceAsStream("/httpd/schematic_list.html"));
|
||||
}
|
||||
}
|
||||
|
@ -45,8 +45,8 @@
|
||||
<h2>Plex HTTPD</h2>
|
||||
<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">
|
||||
<button type="button" class="btn btn-success btn-sm p-2">Download</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/download/">Download</a></button>
|
||||
<button type="button" class="btn btn-outline-info btn-sm p-2"><a href="/api/schematics/upload/">Upload</a></button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user