forked from MinecraftUtilities/Backend
fix html motd
This commit is contained in:
parent
5877b100bc
commit
1d597d5d92
@ -60,6 +60,7 @@ public final class ColorUtils {
|
||||
@NonNull
|
||||
public static String toHTML(@NonNull String input) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("<span>"); // Open the span tag
|
||||
boolean nextIsColor = false; // Is the next char a color code?
|
||||
|
||||
for (char character : input.toCharArray()) {
|
||||
@ -76,6 +77,7 @@ public final class ColorUtils {
|
||||
}
|
||||
builder.append(character); // Append the char...
|
||||
}
|
||||
builder.append("</span>"); // Close the span tag
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
@ -9,22 +9,20 @@ import xyz.mcutils.backend.config.Config;
|
||||
@Controller
|
||||
@RequestMapping(value = "/")
|
||||
public class HomeController {
|
||||
|
||||
/**
|
||||
* The example UUID.
|
||||
*/
|
||||
private final String examplePlayer = "Notch";
|
||||
private final String exampleJavaServer = "aetheria.cc";
|
||||
private final String exampleBedrockServer = "geo.hivebedrock.network";
|
||||
|
||||
@GetMapping(value = "/")
|
||||
public String home(Model model) {
|
||||
model.addAttribute("public_url", Config.INSTANCE.getWebPublicUrl());
|
||||
model.addAttribute("player_example_url", Config.INSTANCE.getWebPublicUrl() + "/player/" + examplePlayer);
|
||||
model.addAttribute("java_server_example_url", Config.INSTANCE.getWebPublicUrl() + "/server/java/" + exampleJavaServer);
|
||||
model.addAttribute("bedrock_server_example_url", Config.INSTANCE.getWebPublicUrl() + "/server/bedrock/" + exampleBedrockServer);
|
||||
model.addAttribute("mojang_endpoint_status_url", Config.INSTANCE.getWebPublicUrl() + "/mojang/status");
|
||||
model.addAttribute("swagger_url", Config.INSTANCE.getWebPublicUrl() + "/swagger-ui.html");
|
||||
String publicUrl = Config.INSTANCE.getWebPublicUrl();
|
||||
|
||||
model.addAttribute("public_url", publicUrl);
|
||||
model.addAttribute("player_example_url", publicUrl + "/player/" + examplePlayer);
|
||||
model.addAttribute("java_server_example_url", publicUrl + "/server/java/" + exampleJavaServer);
|
||||
model.addAttribute("bedrock_server_example_url", publicUrl + "/server/bedrock/" + exampleBedrockServer);
|
||||
model.addAttribute("mojang_endpoint_status_url", publicUrl + "/mojang/status");
|
||||
model.addAttribute("swagger_url", publicUrl + "/swagger-ui.html");
|
||||
return "index";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user