mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-28 02:54:20 +01:00
Network ExtensionData visualization
This commit is contained in:
parent
2ad5f979f6
commit
4c9488c859
@ -19,12 +19,16 @@ package com.djrapitops.plan.utilities.html.pages;
|
|||||||
import com.djrapitops.plan.api.exceptions.ParseException;
|
import com.djrapitops.plan.api.exceptions.ParseException;
|
||||||
import com.djrapitops.plan.data.store.containers.NetworkContainer;
|
import com.djrapitops.plan.data.store.containers.NetworkContainer;
|
||||||
import com.djrapitops.plan.data.store.keys.NetworkKeys;
|
import com.djrapitops.plan.data.store.keys.NetworkKeys;
|
||||||
|
import com.djrapitops.plan.data.store.keys.ServerKeys;
|
||||||
import com.djrapitops.plan.system.file.PlanFiles;
|
import com.djrapitops.plan.system.file.PlanFiles;
|
||||||
import com.djrapitops.plan.system.info.server.properties.ServerProperties;
|
import com.djrapitops.plan.system.info.server.properties.ServerProperties;
|
||||||
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
import com.djrapitops.plan.system.update.VersionCheckSystem;
|
||||||
|
import com.djrapitops.plan.utilities.formatting.Formatters;
|
||||||
import com.djrapitops.plan.utilities.formatting.PlaceholderReplacer;
|
import com.djrapitops.plan.utilities.formatting.PlaceholderReplacer;
|
||||||
import com.djrapitops.plan.utilities.html.structure.AnalysisPluginsTabContentCreator;
|
import com.djrapitops.plan.utilities.html.structure.AnalysisPluginsTabContentCreator;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import static com.djrapitops.plan.data.store.keys.NetworkKeys.*;
|
import static com.djrapitops.plan.data.store.keys.NetworkKeys.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,19 +44,22 @@ public class NetworkPage implements Page {
|
|||||||
private final VersionCheckSystem versionCheckSystem;
|
private final VersionCheckSystem versionCheckSystem;
|
||||||
private final PlanFiles files;
|
private final PlanFiles files;
|
||||||
private final ServerProperties serverProperties;
|
private final ServerProperties serverProperties;
|
||||||
|
private final Formatters formatters;
|
||||||
|
|
||||||
NetworkPage(
|
NetworkPage(
|
||||||
NetworkContainer networkContainer,
|
NetworkContainer networkContainer,
|
||||||
AnalysisPluginsTabContentCreator analysisPluginsTabContentCreator,
|
AnalysisPluginsTabContentCreator analysisPluginsTabContentCreator,
|
||||||
VersionCheckSystem versionCheckSystem,
|
VersionCheckSystem versionCheckSystem,
|
||||||
PlanFiles files,
|
PlanFiles files,
|
||||||
ServerProperties serverProperties
|
ServerProperties serverProperties,
|
||||||
|
Formatters formatters
|
||||||
) {
|
) {
|
||||||
this.networkContainer = networkContainer;
|
this.networkContainer = networkContainer;
|
||||||
this.analysisPluginsTabContentCreator = analysisPluginsTabContentCreator;
|
this.analysisPluginsTabContentCreator = analysisPluginsTabContentCreator;
|
||||||
this.versionCheckSystem = versionCheckSystem;
|
this.versionCheckSystem = versionCheckSystem;
|
||||||
this.files = files;
|
this.files = files;
|
||||||
this.serverProperties = serverProperties;
|
this.serverProperties = serverProperties;
|
||||||
|
this.formatters = formatters;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -76,9 +83,11 @@ public class NetworkPage implements Page {
|
|||||||
);
|
);
|
||||||
placeholderReplacer.put("update", versionCheckSystem.getUpdateHtml().orElse(""));
|
placeholderReplacer.put("update", versionCheckSystem.getUpdateHtml().orElse(""));
|
||||||
|
|
||||||
|
AnalysisPluginTabs analysisPluginTabs = new AnalysisPluginTabs(networkContainer.getBungeeContainer().getValue(ServerKeys.EXTENSION_DATA).orElse(new ArrayList<>()), formatters);
|
||||||
|
|
||||||
String[] content = analysisPluginsTabContentCreator.createContent(null, networkContainer.getUnsafe(NetworkKeys.PLAYERS_MUTATOR));
|
String[] content = analysisPluginsTabContentCreator.createContent(null, networkContainer.getUnsafe(NetworkKeys.PLAYERS_MUTATOR));
|
||||||
String nav = content[0];
|
String nav = analysisPluginTabs.getNav() + content[0];
|
||||||
String tabs = content[1];
|
String tabs = analysisPluginTabs.getTabs() + content[1];
|
||||||
|
|
||||||
placeholderReplacer.put("navPluginsTabs", nav);
|
placeholderReplacer.put("navPluginsTabs", nav);
|
||||||
placeholderReplacer.put("tabsPlugins", tabs);
|
placeholderReplacer.put("tabsPlugins", tabs);
|
||||||
|
@ -191,6 +191,6 @@ public class PageFactory {
|
|||||||
.query(ContainerFetchQueries.fetchNetworkContainer()); // Not cached, big.
|
.query(ContainerFetchQueries.fetchNetworkContainer()); // Not cached, big.
|
||||||
return new NetworkPage(networkContainer,
|
return new NetworkPage(networkContainer,
|
||||||
analysisPluginsTabContentCreator.get(),
|
analysisPluginsTabContentCreator.get(),
|
||||||
versionCheckSystem.get(), fileSystem.get(), serverInfo.get().getServerProperties());
|
versionCheckSystem.get(), fileSystem.get(), serverInfo.get().getServerProperties(), formatters.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user