mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-30 21:17:49 +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.utilities.FormatUtils;
|
||||
import main.java.com.djrapitops.plan.utilities.comparators.GeoInfoComparator;
|
||||
import main.java.com.djrapitops.plan.utilities.html.Html;
|
||||
|
||||
import java.util.List;
|
||||
@ -23,19 +24,18 @@ public class IpTableCreator {
|
||||
}
|
||||
|
||||
public static String createTable(List<GeoInfo> geoInfo) {
|
||||
geoInfo.sort(new GeoInfoComparator());
|
||||
StringBuilder html = new StringBuilder();
|
||||
if (geoInfo.isEmpty()) {
|
||||
html.append(Html.TABLELINE_3.parse("No Connections", "-", "-"));
|
||||
} else {
|
||||
int i = 0;
|
||||
for (GeoInfo info : geoInfo) {
|
||||
long date = info.getDate();
|
||||
html.append(Html.TABLELINE_3.parse(
|
||||
FormatUtils.formatIP(info.getIp()),
|
||||
info.getGeolocation(),
|
||||
FormatUtils.formatTimeStampYear(info.getDate())
|
||||
date != 0 ? FormatUtils.formatTimeStampYear(date) : "-"
|
||||
));
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return html.toString();
|
||||
|
Loading…
Reference in New Issue
Block a user