Max height for General plugin tab elements, softdepend new PluginData

This commit is contained in:
Rsl1122 2017-11-27 17:00:29 +02:00
parent ae6f3f8de7
commit 89b4358d12
4 changed files with 23 additions and 11 deletions

View File

@ -4,6 +4,7 @@
*/ */
package main.java.com.djrapitops.plan.systems.webserver; package main.java.com.djrapitops.plan.systems.webserver;
import com.djrapitops.plugin.api.Benchmark;
import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.api.utility.log.Log;
import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpExchange;
@ -31,11 +32,12 @@ public class APIRequestHandler implements HttpHandler {
public void handle(HttpExchange exchange) throws IOException { public void handle(HttpExchange exchange) throws IOException {
Headers responseHeaders = exchange.getResponseHeaders(); Headers responseHeaders = exchange.getResponseHeaders();
Request request = new Request(exchange); Request request = new Request(exchange);
String requestString = request.toString();
Benchmark.start("", requestString);
int responseCode = -1;
try { try {
Response response = responseHandler.getAPIResponse(request); Response response = responseHandler.getAPIResponse(request);
if (Settings.DEV_MODE.isTrue()) { responseCode = response.getCode();
Log.debug(request.toString() + " Response code: " + response.getCode());
}
response.setResponseHeaders(responseHeaders); response.setResponseHeaders(responseHeaders);
response.send(exchange); response.send(exchange);
} catch (Exception e) { } catch (Exception e) {
@ -44,6 +46,9 @@ public class APIRequestHandler implements HttpHandler {
} }
} finally { } finally {
exchange.close(); exchange.close();
if (Settings.DEV_MODE.isTrue()) {
Log.debug(requestString + " Response code: " + responseCode + " took " + Benchmark.stop("", requestString) + " ms");
}
} }
} }

View File

@ -4,6 +4,7 @@
*/ */
package main.java.com.djrapitops.plan.systems.webserver; package main.java.com.djrapitops.plan.systems.webserver;
import com.djrapitops.plugin.api.Benchmark;
import com.djrapitops.plugin.api.utility.log.Log; import com.djrapitops.plugin.api.utility.log.Log;
import com.sun.net.httpserver.Headers; import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpExchange;
@ -32,12 +33,12 @@ public class RequestHandler implements HttpHandler {
public void handle(HttpExchange exchange) throws IOException { public void handle(HttpExchange exchange) throws IOException {
Headers responseHeaders = exchange.getResponseHeaders(); Headers responseHeaders = exchange.getResponseHeaders();
Request request = new Request(exchange); Request request = new Request(exchange);
String requestString = request.toString();
Benchmark.start("", requestString);
int responseCode = -1;
try { try {
Response response = responseHandler.getResponse(request); Response response = responseHandler.getResponse(request);
if (Settings.DEV_MODE.isTrue()) { responseCode = response.getCode();
Log.debug(request.toString() + " Response code: " + response.getCode());
}
if (response instanceof PromptAuthorizationResponse) { if (response instanceof PromptAuthorizationResponse) {
responseHeaders.set("WWW-Authenticate", "Basic realm=\"/\";"); responseHeaders.set("WWW-Authenticate", "Basic realm=\"/\";");
} }
@ -49,6 +50,9 @@ public class RequestHandler implements HttpHandler {
} }
} finally { } finally {
exchange.close(); exchange.close();
if (Settings.DEV_MODE.isTrue()) {
Log.debug(requestString + " Response code: " + responseCode+" took "+Benchmark.stop("", requestString)+" ms");
}
} }
} }

View File

@ -87,7 +87,7 @@ public class AnalysisPluginsTabContentCreator {
} }
public static void appendThird(PluginData pluginData, InspectContainer container, StringBuilder generalTab) { public static void appendThird(PluginData pluginData, InspectContainer container, StringBuilder generalTab) {
generalTab.append("<div class=\"col-xs-12 col-sm-12 col-md-4 col-lg-4\">" + generalTab.append("<div class=\"col-xs-12 col-sm-12 col-md-4 col-lg-4 plugin\">" +
"<div class=\"card\">" + "<div class=\"card\">" +
"<div class=\"header\">" + "<div class=\"header\">" +
"<h2>") "<h2>")
@ -98,7 +98,7 @@ public class AnalysisPluginsTabContentCreator {
} }
private static void appendTwoThirds(PluginData pluginData, AnalysisContainer container, StringBuilder generalTab) { private static void appendTwoThirds(PluginData pluginData, AnalysisContainer container, StringBuilder generalTab) {
generalTab.append("<div class=\"col-xs-12 col-sm-12 col-md-8 col-lg-8\">" + generalTab.append("<div class=\"col-xs-12 col-sm-12 col-md-8 col-lg-8 plugin\">" +
"<div class=\"card\">" + "<div class=\"card\">" +
"<div class=\"header\">" + "<div class=\"header\">" +
"<h2>") "<h2>")
@ -109,7 +109,7 @@ public class AnalysisPluginsTabContentCreator {
} }
private static void appendWhole(PluginData pluginData, AnalysisContainer container, StringBuilder generalTab) { private static void appendWhole(PluginData pluginData, AnalysisContainer container, StringBuilder generalTab) {
generalTab.append("<div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">" + generalTab.append("<div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12 plugin\">" +
"<div class=\"card\">" + "<div class=\"card\">" +
"<div class=\"header\">" + "<div class=\"header\">" +
"<h2>") "<h2>")

View File

@ -3,7 +3,6 @@ author: Rsl1122
main: main.java.com.djrapitops.plan.Plan main: main.java.com.djrapitops.plan.Plan
version: 4.1.0 version: 4.1.0
softdepend: softdepend:
- OnTime
- EssentialsX - EssentialsX
- Towny - Towny
- Vault - Vault
@ -16,6 +15,10 @@ softdepend:
- LiteBans - LiteBans
- SuperbVote - SuperbVote
- ViaVersion - ViaVersion
- BanManager
- ProtocolSupport
- Kingdoms
- RedProtect
commands: commands:
plan: plan: