mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-02 14:37:45 +01:00
Better icons to error responses
This commit is contained in:
parent
709ace0e0a
commit
3d84262fef
@ -35,6 +35,8 @@ public class ErrorResponse extends Response {
|
|||||||
public void replacePlaceholders() {
|
public void replacePlaceholders() {
|
||||||
Map<String, String> placeHolders = new HashMap<>();
|
Map<String, String> placeHolders = new HashMap<>();
|
||||||
placeHolders.put("title", title);
|
placeHolders.put("title", title);
|
||||||
|
String[] split = title.split(">", 3);
|
||||||
|
placeHolders.put("titleText", split.length == 3 ? split[2] : title);
|
||||||
placeHolders.put("paragraph", paragraph);
|
placeHolders.put("paragraph", paragraph);
|
||||||
placeHolders.put("version", MiscUtils.getPlanVersion());
|
placeHolders.put("version", MiscUtils.getPlanVersion());
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ public class NotFoundResponse extends ErrorResponse {
|
|||||||
|
|
||||||
public NotFoundResponse() {
|
public NotFoundResponse() {
|
||||||
super.setHeader("HTTP/1.1 404 Not Found");
|
super.setHeader("HTTP/1.1 404 Not Found");
|
||||||
super.setTitle(Html.FONT_AWESOME_ICON.parse("exclamation-circle")+" 404 Not Found");
|
super.setTitle(Html.FONT_AWESOME_ICON.parse("map-signs")+" 404 Not Found");
|
||||||
super.setParagraph("Page does not exist.");
|
super.setParagraph("Page does not exist.");
|
||||||
super.replacePlaceholders();
|
super.replacePlaceholders();
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class PromptAuthorizationResponse extends ErrorResponse {
|
|||||||
public PromptAuthorizationResponse() {
|
public PromptAuthorizationResponse() {
|
||||||
super.setHeader("HTTP/1.1 401 Access Denied\r\n"
|
super.setHeader("HTTP/1.1 401 Access Denied\r\n"
|
||||||
+ "WWW-Authenticate: Basic realm=\"/\";");
|
+ "WWW-Authenticate: Basic realm=\"/\";");
|
||||||
super.setTitle(Html.FONT_AWESOME_ICON.parse("times-circle")+" 401 Unauthorized");
|
super.setTitle(Html.FONT_AWESOME_ICON.parse("lock")+" 401 Unauthorized");
|
||||||
super.setParagraph("Authentication Failed.<br>"
|
super.setParagraph("Authentication Failed.<br>"
|
||||||
+ "- Ensure you have registered a user with <b>/plan register</b><br>"
|
+ "- Ensure you have registered a user with <b>/plan register</b><br>"
|
||||||
+ "- Check that the username and password are correct<br>"
|
+ "- Check that the username and password are correct<br>"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||||
<title>${title}</title>
|
<title>${titleText}</title>
|
||||||
<!-- Favicon-->
|
<!-- Favicon-->
|
||||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user