Rename VersionCheckSystem -> VersionChecker

This commit is contained in:
Rsl1122 2020-03-02 13:43:30 +02:00 committed by Risto Lahtela
parent b5d07de18b
commit a8126f6669
15 changed files with 88 additions and 81 deletions

View File

@ -23,7 +23,7 @@ import com.djrapitops.plan.delivery.formatting.Formatters;
import com.djrapitops.plan.identification.ServerInfo;
import com.djrapitops.plan.settings.config.PlanConfig;
import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import com.djrapitops.plugin.logging.L;
import com.djrapitops.plugin.logging.error.ErrorHandler;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
@ -54,13 +54,13 @@ public class PlanPlaceHolders extends PlaceholderExpansion {
public final ErrorHandler errorHandler;
private final Collection<AbstractPlanPlaceHolder> placeholders = new ArrayList<>();
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
public PlanPlaceHolders(
PlanSystem system,
ErrorHandler errorHandler
) {
this.versionCheckSystem = system.getVersionCheckSystem();
this.versionChecker = system.getVersionChecker();
this.errorHandler = errorHandler;
PlanConfig config = system.getConfigSystem().getConfig();
@ -90,6 +90,7 @@ public class PlanPlaceHolders extends PlaceholderExpansion {
return "plan";
}
@SuppressWarnings("deprecation")
@Override
public String getPlugin() {
return "Plan";
@ -102,7 +103,7 @@ public class PlanPlaceHolders extends PlaceholderExpansion {
@Override
public String getVersion() {
return versionCheckSystem.getCurrentVersion();
return versionChecker.getCurrentVersion();
}
@Override

View File

@ -40,7 +40,7 @@ import com.djrapitops.plan.settings.locale.LocaleSystem;
import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.storage.database.queries.objects.ServerQueries;
import com.djrapitops.plan.storage.file.PlanFiles;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import com.djrapitops.plugin.benchmarking.Benchmark;
import com.djrapitops.plugin.benchmarking.Timings;
import com.djrapitops.plugin.logging.L;
@ -64,7 +64,7 @@ public class PlanSystem implements SubSystem {
private final PlanFiles files;
private final ConfigSystem configSystem;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
private final LocaleSystem localeSystem;
private final DBSystem databaseSystem;
private final CacheSystem cacheSystem;
@ -90,7 +90,7 @@ public class PlanSystem implements SubSystem {
public PlanSystem(
PlanFiles files,
ConfigSystem configSystem,
VersionCheckSystem versionCheckSystem,
VersionChecker versionChecker,
LocaleSystem localeSystem,
DBSystem databaseSystem,
CacheSystem cacheSystem,
@ -113,7 +113,7 @@ public class PlanSystem implements SubSystem {
) {
this.files = files;
this.configSystem = configSystem;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.localeSystem = localeSystem;
this.databaseSystem = databaseSystem;
this.cacheSystem = cacheSystem;
@ -138,7 +138,7 @@ public class PlanSystem implements SubSystem {
"§2 ██▌",
"§2 ██▌ ██▌",
"§2 ██▌██▌██▌██▌ §2Player Analytics",
"§2 ██▌██▌██▌██▌ §fv" + versionCheckSystem.getCurrentVersion(),
"§2 ██▌██▌██▌██▌ §fv" + versionChecker.getCurrentVersion(),
""
);
}
@ -166,7 +166,7 @@ public class PlanSystem implements SubSystem {
files,
configSystem,
localeSystem,
versionCheckSystem,
versionChecker,
databaseSystem,
webServerSystem,
processing,
@ -217,7 +217,7 @@ public class PlanSystem implements SubSystem {
localeSystem,
configSystem,
files,
versionCheckSystem
versionChecker
);
}
@ -235,8 +235,8 @@ public class PlanSystem implements SubSystem {
// Accessor methods.
public VersionCheckSystem getVersionCheckSystem() {
return versionCheckSystem;
public VersionChecker getVersionChecker() {
return versionChecker;
}
public ConfigSystem getConfigSystem() {

View File

@ -25,7 +25,7 @@ import com.djrapitops.plan.settings.locale.lang.GenericLang;
import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.storage.database.Database;
import com.djrapitops.plan.storage.database.queries.objects.ServerQueries;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import com.djrapitops.plugin.command.CommandNode;
import com.djrapitops.plugin.command.CommandType;
import com.djrapitops.plugin.command.Sender;
@ -42,21 +42,21 @@ public class InfoCommand extends CommandNode {
private final PlanPlugin plugin;
private final Locale locale;
private final DBSystem dbSystem;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
@Inject
public InfoCommand(
PlanPlugin plugin,
Locale locale,
DBSystem dbSystem,
VersionCheckSystem versionCheckSystem
VersionChecker versionChecker
) {
super("info", Permissions.INFO.getPermission(), CommandType.CONSOLE);
this.plugin = plugin;
this.locale = locale;
this.dbSystem = dbSystem;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
setShortHelp(locale.get(CmdHelpLang.INFO).toString());
}
@ -68,7 +68,7 @@ public class InfoCommand extends CommandNode {
Database database = dbSystem.getDatabase();
String updateAvailable = versionCheckSystem.isNewVersionAvailable() ? yes : no;
String updateAvailable = versionChecker.isNewVersionAvailable() ? yes : no;
String proxyAvailable = database.query(ServerQueries.fetchProxyServerInformation()).isPresent() ? yes : no;

View File

@ -24,6 +24,8 @@ import java.util.Objects;
* Object containing webserver security user information.
*
* @author Rsl1122
*
* TODO Rewrite Authentication stuff
*/
@Deprecated
public class WebUser {

View File

@ -32,7 +32,7 @@ import com.djrapitops.plan.identification.properties.ServerProperties;
import com.djrapitops.plan.storage.database.Database;
import com.djrapitops.plan.storage.file.FileResource;
import com.djrapitops.plan.storage.file.ResourceCache;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import com.djrapitops.plugin.benchmarking.Benchmark;
import com.djrapitops.plugin.benchmarking.Timings;
import com.djrapitops.plugin.logging.FolderTimeStampFileLogger;
@ -57,7 +57,7 @@ public class DebugPage implements Page {
private final String template;
private final Database database;
private final ServerInfo serverInfo;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
private final CombineDebugLogger debugLogger;
private final Timings timings;
private final ErrorHandler errorHandler;
@ -70,7 +70,7 @@ public class DebugPage implements Page {
Database database,
ServerInfo serverInfo,
Formatters formatters,
VersionCheckSystem versionCheckSystem,
VersionChecker versionChecker,
DebugLogger debugLogger,
Timings timings,
ErrorHandler errorHandler
@ -79,7 +79,7 @@ public class DebugPage implements Page {
this.database = database;
this.serverInfo = serverInfo;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.debugLogger = (CombineDebugLogger) debugLogger;
this.timings = timings;
this.errorHandler = errorHandler;
@ -93,8 +93,8 @@ public class DebugPage implements Page {
placeholders.put("title", Icon.called("bug") + " Debug Information");
placeholders.put("titleText", "Debug Information");
placeholders.put("paragraph", createContent());
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
placeholders.put("updateModal", versionChecker.getUpdateModal());
placeholders.put("contributors", Contributors.generateContributorHtml());
return placeholders.apply(template);
}
@ -207,7 +207,7 @@ public class DebugPage implements Page {
content.append("<pre>### Server Information<br>")
.append("**Plan Version:** ")
.append(versionCheckSystem.getCurrentVersion())
.append(versionChecker.getCurrentVersion())
.append("<br>");
content.append("**Server:** ");

View File

@ -19,7 +19,7 @@ package com.djrapitops.plan.delivery.rendering.pages;
import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
import com.djrapitops.plan.delivery.rendering.html.Contributors;
import com.djrapitops.plan.delivery.rendering.html.icon.Icon;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
/**
* Page to display error stacktrace.
@ -33,24 +33,24 @@ public class ErrorMessagePage implements Page {
private final String errorTitle;
private final String errorMsg;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
public ErrorMessagePage(
String template, Icon icon, String errorTitle, String errorMsg,
VersionCheckSystem versionCheckSystem
VersionChecker versionChecker
) {
this.template = template;
this.icon = icon;
this.errorTitle = errorTitle;
this.errorMsg = errorMsg;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
}
public ErrorMessagePage(
String template, String errorTitle, String errorMsg,
VersionCheckSystem versionCheckSystem
VersionChecker versionChecker
) {
this(template, Icon.called("exclamation-circle").build(), errorTitle, errorMsg, versionCheckSystem);
this(template, Icon.called("exclamation-circle").build(), errorTitle, errorMsg, versionChecker);
}
@Override
@ -60,8 +60,8 @@ public class ErrorMessagePage implements Page {
placeholders.put("title", icon.toHtml() + " " + errorTitle);
placeholders.put("titleText", errorTitle);
placeholders.put("paragraph", errorMsg);
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
placeholders.put("updateModal", versionChecker.getUpdateModal());
placeholders.put("contributors", Contributors.generateContributorHtml());
return placeholders.apply(template);
}

View File

@ -20,7 +20,7 @@ import com.djrapitops.plan.delivery.formatting.PlaceholderReplacer;
import com.djrapitops.plan.delivery.rendering.html.Contributors;
import com.djrapitops.plan.delivery.rendering.html.Html;
import com.djrapitops.plan.delivery.rendering.html.icon.Icon;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
/**
* Page to display error stacktrace.
@ -33,16 +33,16 @@ public class InternalErrorPage implements Page {
private final String errorMsg;
private final Throwable error;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
public InternalErrorPage(
String template, String errorMsg, Throwable error,
VersionCheckSystem versionCheckSystem
VersionChecker versionChecker
) {
this.template = template;
this.errorMsg = errorMsg;
this.error = error;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
}
@Override
@ -52,8 +52,8 @@ public class InternalErrorPage implements Page {
placeholders.put("title", Icon.called("bug") + " 500 Internal Error occurred");
placeholders.put("titleText", "500 Internal Error occurred");
placeholders.put("paragraph", createContent());
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
placeholders.put("updateModal", versionChecker.getUpdateModal());
placeholders.put("contributors", Contributors.generateContributorHtml());
return placeholders.apply(template);
}

View File

@ -30,7 +30,7 @@ import com.djrapitops.plan.settings.config.paths.ProxySettings;
import com.djrapitops.plan.settings.theme.Theme;
import com.djrapitops.plan.settings.theme.ThemeVal;
import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
@ -46,7 +46,7 @@ public class NetworkPage implements Page {
private final String templateHtml;
private final DBSystem dbSystem;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
private final PlanConfig config;
private final Theme theme;
private final ServerInfo serverInfo;
@ -56,7 +56,7 @@ public class NetworkPage implements Page {
String templateHtml,
DBSystem dbSystem,
VersionCheckSystem versionCheckSystem,
VersionChecker versionChecker,
PlanConfig config,
Theme theme,
ServerInfo serverInfo,
@ -64,7 +64,7 @@ public class NetworkPage implements Page {
) {
this.templateHtml = templateHtml;
this.dbSystem = dbSystem;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.config = config;
this.theme = theme;
this.serverInfo = serverInfo;
@ -89,8 +89,8 @@ public class NetworkPage implements Page {
placeholders.put("avgPingColor", theme.getValue(ThemeVal.GRAPH_AVG_PING));
placeholders.put("timeZone", config.getTimeZoneOffsetHours());
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
placeholders.put("updateModal", versionChecker.getUpdateModal());
placeholders.put("contributors", Contributors.generateContributorHtml());
CachingSupplier<ServerPluginTabs> pluginTabs = new CachingSupplier<>(() -> {

View File

@ -31,7 +31,7 @@ import com.djrapitops.plan.storage.database.Database;
import com.djrapitops.plan.storage.database.queries.containers.ContainerFetchQueries;
import com.djrapitops.plan.storage.database.queries.objects.ServerQueries;
import com.djrapitops.plan.storage.file.PlanFiles;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import com.djrapitops.plugin.benchmarking.Timings;
import com.djrapitops.plugin.logging.debug.DebugLogger;
import com.djrapitops.plugin.logging.error.ErrorHandler;
@ -52,9 +52,10 @@ import java.util.*;
@Singleton
public class PageFactory {
private final Lazy<VersionCheckSystem> versionCheckSystem;
private final Lazy<VersionChecker> versionChecker;
private final Lazy<PlanFiles> files;
private final Lazy<PlanConfig> config;
private final Lazy<Locale> locale;
private final Lazy<Theme> theme;
private final Lazy<DBSystem> dbSystem;
private final Lazy<ServerInfo> serverInfo;
@ -65,9 +66,10 @@ public class PageFactory {
@Inject
public PageFactory(
Lazy<VersionCheckSystem> versionCheckSystem,
Lazy<VersionChecker> versionChecker,
Lazy<PlanFiles> files,
Lazy<PlanConfig> config,
Lazy<Locale> locale,
Lazy<Theme> theme,
Lazy<DBSystem> dbSystem,
Lazy<ServerInfo> serverInfo,
@ -76,9 +78,10 @@ public class PageFactory {
Lazy<Timings> timings,
Lazy<ErrorHandler> errorHandler
) {
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.files = files;
this.config = config;
this.locale = locale;
this.theme = theme;
this.dbSystem = dbSystem;
this.serverInfo = serverInfo;
@ -91,13 +94,13 @@ public class PageFactory {
public DebugPage debugPage() throws IOException {
return new DebugPage(
getResource("web/error.html"),
dbSystem.get().getDatabase(), serverInfo.get(), formatters.get(), versionCheckSystem.get(),
dbSystem.get().getDatabase(), serverInfo.get(), formatters.get(), versionChecker.get(),
debugLogger.get(), timings.get(), errorHandler.get()
);
}
public PlayersPage playersPage() throws IOException {
return new PlayersPage(getResource("web/players.html"), versionCheckSystem.get(), config.get(), serverInfo.get());
return new PlayersPage(getResource("web/players.html"), versionChecker.get(), config.get(), serverInfo.get());
}
public ServerPage serverPage(UUID serverUUID) throws NotFoundException, IOException {
@ -108,7 +111,7 @@ public class PageFactory {
server,
config.get(),
theme.get(),
versionCheckSystem.get(),
versionChecker.get(),
dbSystem.get(),
serverInfo.get(),
formatters.get()
@ -120,7 +123,7 @@ public class PageFactory {
PlayerContainer player = db.query(ContainerFetchQueries.fetchPlayerContainer(playerUUID));
return new PlayerPage(
getResource("web/player.html"), player,
versionCheckSystem.get(),
versionChecker.get(),
config.get(), this, theme.get(),
formatters.get(), serverInfo.get()
);
@ -162,14 +165,14 @@ public class PageFactory {
public NetworkPage networkPage() throws IOException {
return new NetworkPage(getResource("web/network.html"),
dbSystem.get(),
versionCheckSystem.get(), config.get(), theme.get(), serverInfo.get(), formatters.get());
versionChecker.get(), config.get(), theme.get(), serverInfo.get(), formatters.get());
}
public Page internalErrorPage(String message, Throwable error) {
try {
return new InternalErrorPage(
getResource("web/error.html"), message, error,
versionCheckSystem.get());
versionChecker.get());
} catch (IOException noParse) {
return () -> "Error occurred: " + error.toString() +
", additional error occurred when attempting to render error page to user: " +
@ -180,13 +183,13 @@ public class PageFactory {
public Page errorPage(String title, String error) throws IOException {
return new ErrorMessagePage(
getResource("web/error.html"), title, error,
versionCheckSystem.get());
versionChecker.get());
}
public Page errorPage(Icon icon, String title, String error) throws IOException {
return new ErrorMessagePage(
getResource("web/error.html"), icon, title, error,
versionCheckSystem.get());
versionChecker.get());
}
public String getResource(String name) throws IOException {

View File

@ -27,7 +27,7 @@ import com.djrapitops.plan.identification.ServerInfo;
import com.djrapitops.plan.settings.config.PlanConfig;
import com.djrapitops.plan.settings.theme.Theme;
import com.djrapitops.plan.settings.theme.ThemeVal;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import java.util.UUID;
@ -41,7 +41,7 @@ public class PlayerPage implements Page {
private final String templateHtml;
private final PlayerContainer player;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
private final PlanConfig config;
private final PageFactory pageFactory;
@ -54,7 +54,7 @@ public class PlayerPage implements Page {
PlayerPage(
String templateHtml,
PlayerContainer player,
VersionCheckSystem versionCheckSystem,
VersionChecker versionChecker,
PlanConfig config,
PageFactory pageFactory,
Theme theme,
@ -63,7 +63,7 @@ public class PlayerPage implements Page {
) {
this.templateHtml = templateHtml;
this.player = player;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.config = config;
this.pageFactory = pageFactory;
this.theme = theme;
@ -89,8 +89,8 @@ public class PlayerPage implements Page {
placeholders.put("refresh", clockLongFormatter.apply(now));
placeholders.put("refreshFull", secondLongFormatter.apply(now));
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
placeholders.put("updateModal", versionChecker.getUpdateModal());
placeholders.put("timeZone", config.getTimeZoneOffsetHours());
String playerName = player.getValue(PlayerKeys.NAME).orElse(playerUUID.toString());

View File

@ -22,7 +22,7 @@ import com.djrapitops.plan.identification.ServerInfo;
import com.djrapitops.plan.settings.config.PlanConfig;
import com.djrapitops.plan.settings.config.paths.PluginSettings;
import com.djrapitops.plan.settings.config.paths.ProxySettings;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
/**
* Html String generator for /players page.
@ -32,18 +32,18 @@ import com.djrapitops.plan.version.VersionCheckSystem;
public class PlayersPage implements Page {
private final String templateHtml;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
private final PlanConfig config;
private final ServerInfo serverInfo;
PlayersPage(
String templateHtml,
VersionCheckSystem versionCheckSystem,
VersionChecker versionChecker,
PlanConfig config,
ServerInfo serverInfo
) {
this.templateHtml = templateHtml;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.config = config;
this.serverInfo = serverInfo;
}
@ -52,8 +52,8 @@ public class PlayersPage implements Page {
public String toHtml() {
PlaceholderReplacer placeholders = new PlaceholderReplacer();
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
placeholders.put("updateModal", versionChecker.getUpdateModal());
placeholders.put("contributors", Contributors.generateContributorHtml());
if (serverInfo.getServer().isProxy()) {
placeholders.put("networkName", config.get(ProxySettings.NETWORK_NAME));

View File

@ -35,7 +35,7 @@ import com.djrapitops.plan.settings.config.paths.DisplaySettings;
import com.djrapitops.plan.settings.theme.Theme;
import com.djrapitops.plan.settings.theme.ThemeVal;
import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import java.util.List;
import java.util.UUID;
@ -53,7 +53,7 @@ public class ServerPage implements Page {
private final Server server;
private final PlanConfig config;
private final Theme theme;
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
private final DBSystem dbSystem;
private final ServerInfo serverInfo;
private final Formatters formatters;
@ -62,7 +62,7 @@ public class ServerPage implements Page {
String templateHtml, Server server,
PlanConfig config,
Theme theme,
VersionCheckSystem versionCheckSystem,
VersionChecker versionChecker,
DBSystem dbSystem,
ServerInfo serverInfo,
Formatters formatters
@ -71,7 +71,7 @@ public class ServerPage implements Page {
this.server = server;
this.config = config;
this.theme = theme;
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.dbSystem = dbSystem;
this.serverInfo = serverInfo;
this.formatters = formatters;
@ -121,8 +121,8 @@ public class ServerPage implements Page {
placeholders.put("backButton", serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK.create() : "");
placeholders.put("contributors", Contributors.generateContributorHtml());
placeholders.put("version", versionCheckSystem.getUpdateButton().orElse(versionCheckSystem.getCurrentVersionButton()));
placeholders.put("updateModal", versionCheckSystem.getUpdateModal());
placeholders.put("version", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
placeholders.put("updateModal", versionChecker.getUpdateModal());
CachingSupplier<ServerPluginTabs> pluginTabs = new CachingSupplier<>(() -> {
List<ExtensionData> extensionData = dbSystem.getDatabase().query(new ExtensionServerDataQuery(serverUUID));

View File

@ -33,7 +33,7 @@ import com.djrapitops.plan.storage.database.DBSystem;
import com.djrapitops.plan.storage.database.Database;
import com.djrapitops.plan.storage.database.queries.containers.ContainerFetchQueries;
import com.djrapitops.plan.storage.file.PlanFiles;
import com.djrapitops.plan.version.VersionCheckSystem;
import com.djrapitops.plan.version.VersionChecker;
import javax.inject.Inject;
import javax.inject.Singleton;
@ -51,7 +51,7 @@ import java.util.UUID;
@Singleton
public class ResponseFactory {
private final VersionCheckSystem versionCheckSystem;
private final VersionChecker versionChecker;
private final PlanFiles files;
private final PageFactory pageFactory;
private final Locale locale;
@ -60,14 +60,14 @@ public class ResponseFactory {
@Inject
public ResponseFactory(
VersionCheckSystem versionCheckSystem,
VersionChecker versionChecker,
PlanFiles files,
PageFactory pageFactory,
Locale locale,
DBSystem dbSystem,
Theme theme
) {
this.versionCheckSystem = versionCheckSystem;
this.versionChecker = versionChecker;
this.files = files;
this.pageFactory = pageFactory;
this.locale = locale;

View File

@ -102,6 +102,7 @@ public class Locale extends HashMap<Lang, Message> {
this.langCode = locale.langCode;
}
// TODO Use inside Page implementations
public String replaceLanguageInHtml(String from) {
if (isEmpty()) {
return from;

View File

@ -39,7 +39,7 @@ import java.util.Optional;
* @author Rsl1122
*/
@Singleton
public class VersionCheckSystem implements SubSystem {
public class VersionChecker implements SubSystem {
private final String currentVersion;
private final Locale locale;
@ -49,7 +49,7 @@ public class VersionCheckSystem implements SubSystem {
private VersionInfo newVersionAvailable;
@Inject
public VersionCheckSystem(
public VersionChecker(
@Named("currentVersion") String currentVersion,
Locale locale,
PlanConfig config,