diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationMetricSummaryPage.java b/src/fr/devinsy/statoolinfos/htmlize/FederationMetricSummaryPage.java index 4bf31a5..d83c408 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationMetricSummaryPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationMetricSummaryPage.java @@ -61,8 +61,6 @@ public class FederationMetricSummaryPage */ public static void build(final File htmlizeDirectory, final Federation federation, final ViewMenu view, final PeriodMenu period) throws StatoolInfosException, IOException { - String result; - try { TagDataManager data = new TagDataManager(); @@ -71,7 +69,7 @@ public class FederationMetricSummaryPage data.setContent("metricMenuView", FederationMetricMenuView.htmlize(federation, TypeMenu.SUMMARY, view, period)); FederationMetricHtmlizer.htmlize(data, "http.hits.visitors", federation, view, period, "metrics.http.hits.visitors", ChartColor.GREEN); - FederationMetricHtmlizer.htmlize(data, "http.ip.visitors", federation, view, period, "metrics.http.ip.visitors", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "http.visitors.humans", federation, view, period, "metrics.http.visitors.humans", ChartColor.GREEN); FederationMetricHtmlizer.htmlize(data, "http.visits.visitors", federation, view, period, "metrics.http.visits.visitors", ChartColor.GREEN); // diff --git a/src/fr/devinsy/statoolinfos/htmlize/FederationMetricWebPage.java b/src/fr/devinsy/statoolinfos/htmlize/FederationMetricWebPage.java index 6f9d008..9b78248 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/FederationMetricWebPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/FederationMetricWebPage.java @@ -95,6 +95,18 @@ public class FederationMetricWebPage FederationMetricHtmlizer.htmlize(data, "http.ip.ipv4", federation, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW); FederationMetricHtmlizer.htmlize(data, "http.ip.ipv6", federation, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "http.visitors", federation, view, period, "metrics.http.visitors", ChartColor.BLUE); + + FederationMetricHtmlizer.htmlize(data, "http.visitors-humansbots", federation, view, period, "http.visitors (humans + bots)", "metrics.http.visitors.humans", ChartColor.GREEN, + "metrics.http.visitors.bots", ChartColor.YELLOW); + FederationMetricHtmlizer.htmlize(data, "http.visitors.humans", federation, view, period, "metrics.http.visitors.humans", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "http.visitors.bots", federation, view, period, "metrics.http.visitors.bots", ChartColor.YELLOW); + + FederationMetricHtmlizer.htmlize(data, "http.visitors-ipv4ipv6", federation, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW, + "metrics.http.visitors.ipv6", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "http.visitors.ipv4", federation, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW); + FederationMetricHtmlizer.htmlize(data, "http.visitors.ipv6", federation, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN); + FederationMetricHtmlizer.htmlize(data, "http.visits", federation, view, period, "metrics.http.visits", ChartColor.BLUE); FederationMetricHtmlizer.htmlize(data, "http.visits-visitorsbots", federation, view, period, "http.visits (visitors + bots)", "metrics.http.visits.visitors", ChartColor.GREEN, diff --git a/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricSummaryPage.java b/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricSummaryPage.java index 59b4463..907fefe 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricSummaryPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricSummaryPage.java @@ -70,7 +70,7 @@ public class OrganizationMetricSummaryPage data.setContent("metricMenuView", OrganizationMetricMenuView.htmlize(organization, TypeMenu.SUMMARY, view, period)); OrganizationMetricHtmlizer.htmlize(data, "http.hits.visitors", organization, view, period, "metrics.http.hits.visitors", ChartColor.GREEN); - OrganizationMetricHtmlizer.htmlize(data, "http.ip.visitors", organization, view, period, "metrics.http.ip.visitors", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "http.visitors.humans", organization, view, period, "metrics.http.visitors.humans", ChartColor.GREEN); OrganizationMetricHtmlizer.htmlize(data, "http.visits.visitors", organization, view, period, "metrics.http.visits.visitors", ChartColor.GREEN); // diff --git a/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricWebPage.java b/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricWebPage.java index ec368f4..96d684a 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricWebPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/OrganizationMetricWebPage.java @@ -102,6 +102,18 @@ public class OrganizationMetricWebPage OrganizationMetricHtmlizer.htmlize(data, "http.ip.ipv4", organization, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW); OrganizationMetricHtmlizer.htmlize(data, "http.ip.ipv6", organization, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "http.visitors", organization, view, period, "metrics.http.visitors", ChartColor.BLUE); + + OrganizationMetricHtmlizer.htmlize(data, "http.visitors-humansbots", organization, view, period, "http.visitors (humans + bots)", "metrics.http.visitors.humans", ChartColor.GREEN, + "metrics.http.visitors.bots", ChartColor.YELLOW); + OrganizationMetricHtmlizer.htmlize(data, "http.visitors.humans", organization, view, period, "metrics.http.visitors.humans", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "http.visitors.bots", organization, view, period, "metrics.http.visitors.bots", ChartColor.YELLOW); + + OrganizationMetricHtmlizer.htmlize(data, "http.visitors-ipv4ipv6", organization, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW, + "metrics.http.visitors.ipv6", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "http.visitors.ipv4", organization, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW); + OrganizationMetricHtmlizer.htmlize(data, "http.visitors.ipv6", organization, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN); + OrganizationMetricHtmlizer.htmlize(data, "http.visits", organization, view, period, "metrics.http.visits", ChartColor.BLUE); OrganizationMetricHtmlizer.htmlize(data, "http.visits-visitorsbots", organization, view, period, "http.visits (visitors + bots)", "metrics.http.visits.visitors", ChartColor.GREEN, diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricSummaryPage.java b/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricSummaryPage.java index 0800acf..9da751f 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricSummaryPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricSummaryPage.java @@ -70,7 +70,7 @@ public class ServiceMetricSummaryPage data.setContent("metricMenuView", ServiceMetricMenuView.htmlize(service, TypeMenu.SUMMARY, view, period)); ServiceMetricHtmlizer.htmlize(data, "http.hits.visitors", service, view, period, "metrics.http.hits.visitors", ChartColor.GREEN); - ServiceMetricHtmlizer.htmlize(data, "http.ip.visitors", service, view, period, "metrics.http.ip.visitors", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "http.visitors.humans", service, view, period, "metrics.http.visitors.humans", ChartColor.GREEN); ServiceMetricHtmlizer.htmlize(data, "http.visits.visitors", service, view, period, "metrics.http.visits.visitors", ChartColor.GREEN); // diff --git a/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricWebPage.java b/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricWebPage.java index 3cc1e51..e148898 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricWebPage.java +++ b/src/fr/devinsy/statoolinfos/htmlize/ServiceMetricWebPage.java @@ -101,6 +101,18 @@ public class ServiceMetricWebPage ServiceMetricHtmlizer.htmlize(data, "http.ip.ipv4", service, view, period, "metrics.http.ip.ipv4", ChartColor.YELLOW); ServiceMetricHtmlizer.htmlize(data, "http.ip.ipv6", service, view, period, "metrics.http.ip.ipv6", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "http.visitors", service, view, period, "metrics.http.ip", ChartColor.BLUE); + + ServiceMetricHtmlizer.htmlizeData(data, "http.visitors-humansbots", service, view, period, "http.visitors (humans + bots)", "metrics.http.visitors.humans", ChartColor.GREEN, + "metrics.http.visitors.bots", ChartColor.YELLOW); + ServiceMetricHtmlizer.htmlize(data, "http.visitors.humans", service, view, period, "metrics.http.visitors.humans", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "http.visitors.bots", service, view, period, "metrics.http.visitors.bots", ChartColor.YELLOW); + + ServiceMetricHtmlizer.htmlizeData(data, "http.visitors-ipv4ipv6", service, view, period, "http.visitors (ipv4 + ipv6)", "metrics.http.visitors.ipv4", ChartColor.YELLOW, + "metrics.http.visitors.ipv6", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "http.visitors.ipv4", service, view, period, "metrics.http.visitors.ipv4", ChartColor.YELLOW); + ServiceMetricHtmlizer.htmlize(data, "http.visitors.ipv6", service, view, period, "metrics.http.visitors.ipv6", ChartColor.GREEN); + ServiceMetricHtmlizer.htmlize(data, "http.visits", service, view, period, "metrics.http.visits", ChartColor.BLUE); ServiceMetricHtmlizer.htmlizeData(data, "http.visits-visitorsbots", service, view, period, "http.visits (visitors + bots)", "metrics.http.visits.visitors", ChartColor.GREEN, diff --git a/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java b/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java index e54fa3b..abd01d4 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java +++ b/src/fr/devinsy/statoolinfos/htmlize/UptimeView.java @@ -32,6 +32,7 @@ import fr.devinsy.statoolinfos.core.Services; import fr.devinsy.statoolinfos.core.StatoolInfosException; import fr.devinsy.statoolinfos.uptime.UptimeJournal; import fr.devinsy.statoolinfos.uptime.UptimeStat; +import fr.devinsy.strings.StringList; import fr.devinsy.xidyn.XidynException; import fr.devinsy.xidyn.data.TagDataManager; import fr.devinsy.xidyn.presenters.PresenterUtils; @@ -63,6 +64,26 @@ public class UptimeView { TagDataManager data = new TagDataManager(); + LocalDate now = LocalDate.now(); + for (int dayCount = 0; dayCount < 22; dayCount++) + { + LocalDate date = now.minusDays(dayCount); + + // + data.setContent("lineHeader-" + dayCount, StringUtils.capitalize(date.format(DateTimeFormatter.ofPattern("EEEE", Locale.FRENCH)).substring(0, 2))); + data.setAttribute("lineHeader-" + dayCount, "title", date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))); + + DayOfWeek weekDay = date.getDayOfWeek(); + if ((weekDay == DayOfWeek.SUNDAY) || (weekDay == DayOfWeek.SATURDAY)) + { + data.setAttribute("lineHeader-" + dayCount, "style", "background-color: gainsboro;"); + } + else + { + data.setAttribute("lineHeader-" + dayCount, "style", "background-color: #ececec;"); + } + } + int index = 0; for (Service service : services.sortByName()) { @@ -76,31 +97,34 @@ public class UptimeView data.setEscapedContent("line", index, "lineOrganizationValue", service.getOrganization().getName()); // - LocalDate now = LocalDate.now(); for (int dayCount = 0; dayCount < 22; dayCount++) { LocalDate date = now.minusDays(dayCount); // - data.setContent("lineHeader-" + dayCount, StringUtils.capitalize(date.format(DateTimeFormatter.ofPattern("EEEE", Locale.FRENCH)).substring(0, 2))); - data.setAttribute("lineHeader-" + dayCount, "title", date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))); - DayOfWeek weekDay = date.getDayOfWeek(); if ((weekDay == DayOfWeek.SUNDAY) || (weekDay == DayOfWeek.SATURDAY)) { - data.setAttribute("lineHeader-" + dayCount, "style", "background-color: gainsboro;"); data.setAttribute("line", index, "uptime-" + dayCount, "style", "background-color: gainsboro;"); } - else - { - data.setAttribute("lineHeader-" + dayCount, "style", "background-color: #ececec;"); - } // UptimeStat stat = journal.getStat(service.getWebsiteURL(), date); + StringList lines = new StringList(); + String header = String.format("%d ok + %d err", stat.getOkCount(), stat.getErrorCount()); + lines.add(header); + header = date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy")); + lines.add(header); + if (stat.getErrorCount() > 0) + { + lines.addAll(journal.getUptimes(service.getWebsiteURL(), date).toTimeList()); + } + data.setAttribute("line", index, "statusImg-" + dayCount, "src", "status-" + stat.getStatus().toString().toLowerCase() + ".png"); - String title = String.format("%d ok + %d err %s", stat.getOkCount(), stat.getErrorCount(), date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))); - data.setAttribute("line", index, "statusImg-" + dayCount, "title", title); + // String title = String.format("%d ok + %d err %s", + // stat.getOkCount(), stat.getErrorCount(), + // date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))); + data.setAttribute("line", index, "statusImg-" + dayCount, "title", lines.toStringSeparatedBy(" ")); } // diff --git a/src/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml b/src/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml index 2ddd6a3..b8c4601 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/serviceMetricSummaryView.xhtml @@ -16,7 +16,7 @@