mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-26 19:17:43 +01:00
Registered Plugins tab WebAPI
This commit is contained in:
parent
a1705b929d
commit
e048fb6d64
@ -13,6 +13,8 @@ import main.java.com.djrapitops.plan.systems.webserver.webapi.WebAPIManager;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.webapi.bukkit.*;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.webapi.bungee.IsCachedWebAPI;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.webapi.bungee.PostHtmlWebAPI;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.webapi.bungee.PostInspectPluginsTabWebAPI;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.webapi.bungee.RequestPluginsTabWebAPI;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.webapi.universal.PingWebAPI;
|
||||
import main.java.com.djrapitops.plan.utilities.html.HtmlUtils;
|
||||
|
||||
@ -58,12 +60,15 @@ public class WebServer {
|
||||
webAPI.registerNewAPI(new AnalyzeWebAPI());
|
||||
webAPI.registerNewAPI(new ConfigurationWebAPI());
|
||||
webAPI.registerNewAPI(new InspectWebAPI());
|
||||
webAPI.registerNewAPI(new OnlinePlayersWebAPI());
|
||||
webAPI.registerNewAPI(new MaxPlayersWebAPI());
|
||||
webAPI.registerNewAPI(new GetOnlinePlayersWebAPI());
|
||||
webAPI.registerNewAPI(new GetMaxPlayersWebAPI());
|
||||
webAPI.registerNewAPI(new PingWebAPI());
|
||||
webAPI.registerNewAPI(new RequestInspectPluginsTabBukkitWebAPI());
|
||||
|
||||
webAPI.registerNewAPI(new IsCachedWebAPI());
|
||||
webAPI.registerNewAPI(new PostHtmlWebAPI());
|
||||
webAPI.registerNewAPI(new PostInspectPluginsTabWebAPI());
|
||||
webAPI.registerNewAPI(new RequestPluginsTabWebAPI());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@ import java.util.Map;
|
||||
/**
|
||||
* @author Rsl1122
|
||||
*/
|
||||
public class MaxPlayersWebAPI extends WebAPI {
|
||||
public class GetMaxPlayersWebAPI extends WebAPI {
|
||||
@Override
|
||||
public Response onRequest(IPlan plugin, Map<String, String> variables) {
|
||||
return new JsonResponse(plugin.getVariable().getMaxPlayers());
|
@ -15,7 +15,7 @@ import java.util.Map;
|
||||
/**
|
||||
* @author Fuzzlemann
|
||||
*/
|
||||
public class OnlinePlayersWebAPI extends WebAPI {
|
||||
public class GetOnlinePlayersWebAPI extends WebAPI {
|
||||
@Override
|
||||
public Response onRequest(IPlan plugin, Map<String, String> variables) {
|
||||
return new JsonResponse(((Plan) plugin).getServer().getOnlinePlayers());
|
@ -8,9 +8,7 @@ import com.djrapitops.plugin.utilities.Compatibility;
|
||||
import main.java.com.djrapitops.plan.api.IPlan;
|
||||
import main.java.com.djrapitops.plan.api.exceptions.WebAPIException;
|
||||
import main.java.com.djrapitops.plan.systems.info.BukkitInformationManager;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.PageCache;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.response.Response;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.response.api.SuccessResponse;
|
||||
import main.java.com.djrapitops.plan.systems.webserver.webapi.WebAPI;
|
||||
|
||||
import java.util.Map;
|
||||
@ -36,7 +34,7 @@ public class RequestInspectPluginsTabBukkitWebAPI extends WebAPI {
|
||||
UUID uuid = UUID.fromString(uuidS);
|
||||
|
||||
((BukkitInformationManager) plugin.getInfoManager()).cacheInspectPluginsTab(uuid, this.getClass());
|
||||
return PageCache.loadPage("success", SuccessResponse::new);
|
||||
return success();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user