mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-02 14:37:45 +01:00
IP table now sorts properly
This commit is contained in:
parent
2e1a6f6b68
commit
f2ce10738c
@ -6,6 +6,7 @@ package main.java.com.djrapitops.plan.utilities.html.tables;
|
|||||||
|
|
||||||
import main.java.com.djrapitops.plan.data.GeoInfo;
|
import main.java.com.djrapitops.plan.data.GeoInfo;
|
||||||
import main.java.com.djrapitops.plan.utilities.FormatUtils;
|
import main.java.com.djrapitops.plan.utilities.FormatUtils;
|
||||||
|
import main.java.com.djrapitops.plan.utilities.comparators.GeoInfoComparator;
|
||||||
import main.java.com.djrapitops.plan.utilities.html.Html;
|
import main.java.com.djrapitops.plan.utilities.html.Html;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -23,19 +24,18 @@ public class IpTableCreator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String createTable(List<GeoInfo> geoInfo) {
|
public static String createTable(List<GeoInfo> geoInfo) {
|
||||||
|
geoInfo.sort(new GeoInfoComparator());
|
||||||
StringBuilder html = new StringBuilder();
|
StringBuilder html = new StringBuilder();
|
||||||
if (geoInfo.isEmpty()) {
|
if (geoInfo.isEmpty()) {
|
||||||
html.append(Html.TABLELINE_3.parse("No Connections", "-", "-"));
|
html.append(Html.TABLELINE_3.parse("No Connections", "-", "-"));
|
||||||
} else {
|
} else {
|
||||||
int i = 0;
|
|
||||||
for (GeoInfo info : geoInfo) {
|
for (GeoInfo info : geoInfo) {
|
||||||
|
long date = info.getDate();
|
||||||
html.append(Html.TABLELINE_3.parse(
|
html.append(Html.TABLELINE_3.parse(
|
||||||
FormatUtils.formatIP(info.getIp()),
|
FormatUtils.formatIP(info.getIp()),
|
||||||
info.getGeolocation(),
|
info.getGeolocation(),
|
||||||
FormatUtils.formatTimeStampYear(info.getDate())
|
date != 0 ? FormatUtils.formatTimeStampYear(date) : "-"
|
||||||
));
|
));
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return html.toString();
|
return html.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user