Commit 36366cc5 authored by Drahomír Karchňák's avatar Drahomír Karchňák

Added UTC string to a timestamp. Testing different ways to obtain isp.

parent 709e9ac8
......@@ -12,6 +12,8 @@ public class ForumBannerGenerator extends AbstractImageGenerator {
private static final int BANNER_WIDTH = 560;
private static final int BANNER_HEIGHT = 274;
private static final String UTC_FORMAT = "%s UTC";
private static final String TEMPLATE_FORMAT = "forumbanner_%s.png";
private static final String PRIMARY_FONT = "Roboto-Light.ttf";
......@@ -73,7 +75,7 @@ public class ForumBannerGenerator extends AbstractImageGenerator {
renderAdditionalValue(os, AdditionalValuePositionMapping.getSecondColumnX(lang), 254, finalImageGraphics);
renderTimeDateValue(formattedDate, 550, 16, finalImageGraphics);
renderTimeDateValue(formattedTime, 550, 40, finalImageGraphics);
renderTimeDateValue(String.format(UTC_FORMAT, formattedTime), 550, 40, finalImageGraphics);
return finalImage;
}
......
......@@ -118,9 +118,10 @@ public class ImageExport extends ServerResource {
+ " (t.ping_median::float / 1000000) ping_ms,"
+ " t.signal_strength,"
+ " COALESCE(prov.shortname, mprov.shortname, prov.name, mprov.name, network_operator_name, network_sim_operator) provider_name,"
+ " COALESCE(t.plattform, t.client_name) as platform "
+ " COALESCE(t.plattform, t.client_name) as platform, "
//+ " network_operator network_mcc_mnc,"
//+ " network_operator_name network_name,"
+ " network_operator_name network_name,"
+ " public_ip_as_name public_name"
//+ " network_sim_operator sim_mcc_mnc,"
//+ " nat_type \"connection\","
//+ " public_ip_asn asn,"
......@@ -159,6 +160,14 @@ public class ImageExport extends ServerResource {
final String os = rs.getString("platform");
final Timestamp time = rs.getTimestamp("time");
final String networkName = rs.getString("network_name");
final String publicName = rs.getString("public_name");
final StringBuilder test = new StringBuilder();
test.append(isp).append(", ");
test.append(networkName).append(", ");
test.append(publicName);
final OutputRepresentation result = new OutputRepresentation(MediaType.IMAGE_PNG) {
@Override
public void write(OutputStream out) throws IOException {
......@@ -178,7 +187,18 @@ public class ImageExport extends ServerResource {
SimpleDateFormat dateFormat = new SimpleDateFormat(TimeDateFormatting.getDateFormat(lang));
SimpleDateFormat timeFormat = new SimpleDateFormat(TimeDateFormatting.getTimeFormat(lang));
BufferedImage img = generator.generateImage(lang, upload, download, ping, isp, typ, signal, os, timeFormat.format(time), dateFormat.format(date));
BufferedImage img = generator.generateImage(
lang,
upload,
download,
ping,
test.toString(),
typ,
signal,
os,
timeFormat.format(time),
dateFormat.format(date)
);
ImageIO.write(img, "png", out);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment