Extend sAbstractHttpHandler.

This commit is contained in:
Manuel Friedli 2023-04-08 09:43:04 +02:00
parent a194e5db62
commit a45daf6ba3
4 changed files with 3 additions and 89 deletions

View file

@ -13,9 +13,9 @@ import lombok.extern.slf4j.Slf4j;
import java.nio.ByteBuffer;
@Slf4j
public class RenderHandler implements HttpHandler {
public class RenderHandler extends AbstractHttpHandler {
@Override
public void handleRequest(final HttpServerExchange exchange) {
public void handle(final HttpServerExchange exchange) {
log.debug("Handling render request");
if (exchange.isInIoThread()) {

View file

@ -13,7 +13,5 @@
<root level="info">
<appender-ref ref="STDOUT"/>
</root>
<logger name="ch.fritteli.labyrinth.server.handler.AbstractHttpHandler" level="debug"/>
<logger name="ch.fritteli.labyrinth.server.handler.CreateHandler" level="debug"/>
<logger name="ch.fritteli.labyrinth.server.handler.RenderHandler" level="debug"/>
<logger name="ch.fritteli.labyrinth.*" level="debug"/>
</configuration>

View file

@ -1,33 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Labyrinth Generator</title>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div class="content">
<h1>Labyrinth Generator</h1>
<p>Enter some values, click the "Create!" button and see what happens!</p>
<form action="/create" method="get">
<div class="inputs-wrapper">
<label for="width">Width:</label><input id="width" min="1" name="width" required type="number">
<label for="height">Height:</label><input id="height" min="1" name="height" required type="number">
<label for="output">Output format:</label>
<select id="output" name="output" required>
<option label="HTML Document" value="html"></option>
<option label="Plain text" value="text"></option>
<option label="PDF Document" value="pdf"></option>
<option label="PDF Document (Download)" value="pdffile"></option>
<option label="Binary" value="binary"></option>
</select>
<label for="id">Seed (optional):</label><input id="id" name="id" type="number">
</div>
<div class="controls-wrapper">
<button class="primary" type="submit">Create!</button>
<button type="reset">Reset form</button>
</div>
</form>
</div>
</body>
</html>

View file

@ -1,51 +0,0 @@
:root {
--color-background: #181a1b;
--color-foreground: #e8e6e3;
--color-border: #5d6164;
--color-background-highlight: #292b2c;
--color-foreground-highlight: #f8f7f4;
--color-border-highlight: #6e7275;
}
body {
display: flex;
font-family: sans-serif;
justify-content: center;
}
body, button, input, select {
background-color: var(--color-background);
color: var(--color-foreground);
}
button, input, select {
border: 1px solid var(--color-border);
}
button:active, input:active, select:active,
button:focus, input:focus, select:focus,
button:hover, input:hover, select:hover {
background-color: var(--color-background-highlight);
border-color: var(--color-border-highlight);
color: var(--color-foreground-highlight);
}
button.primary {
background-color: #ffcc00;
border-color: #eebb00;
color: var(--color-background);
}
.content {
width: 75%;
}
.content h1 {
text-align: center;
}
.inputs-wrapper {
display: grid;
grid-row-gap: 1em;
grid-template-columns: 0.5fr 1fr;
}