From ce6801f8b3bb4a3ab81f1038d7a133647f3437d6 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 19 Aug 2024 00:02:10 +0200 Subject: [PATCH] Fixed bad path in last metrics page. --- src/website/views/LastStatsView.java | 49 +++++++++++++++++++--------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/src/website/views/LastStatsView.java b/src/website/views/LastStatsView.java index 6811aca..5fb7551 100644 --- a/src/website/views/LastStatsView.java +++ b/src/website/views/LastStatsView.java @@ -80,16 +80,24 @@ public class LastStatsView int index = 0; for (Service service : services.sortByName()) { - data.setAttribute("serviceListLine", index, "serviceListLineOrganizationLink", "href", service.getOrganization().getTechnicalName() + ".xhtml"); - data.setAttribute("serviceListLine", index, "serviceListLineOrganizationLogo", "src", service.getOrganization().getLogoFileName()); - data.setEscapedAttribute("serviceListLine", index, "serviceListLineOrganizationLogo", "title", service.getOrganization().getName()); + String serviceRoot = "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/services/" + + service.getTechnicalName() + "/"; + String organizationRoot = "/federation/organizations/" + service.getOrganization().getTechnicalName() + "/"; - data.setAttribute("serviceListLine", index, "serviceListLineLogo", "src", service.getLogoFileName()); + data.setAttribute("serviceListLine", index, "serviceListLineOrganizationLink", "href", organizationRoot); + data.setAttribute("serviceListLine", index, "serviceListLineOrganizationLogo", "src", + organizationRoot + service.getOrganization().getLogoFileName()); + data.setEscapedAttribute("serviceListLine", index, "serviceListLineOrganizationLogo", "title", + service.getOrganization().getName()); + + data.setAttribute("serviceListLine", index, "serviceListLineLogo", "src", serviceRoot + service.getLogoFileName()); data.setEscapedContent("serviceListLine", index, "serviceListLineNameValue", service.getName()); - data.setAttribute("serviceListLine", index, "serviceListLineNameLink", "href", service.getOrganization().getTechnicalName() + "-" + service.getTechnicalName() + ".xhtml"); + data.setAttribute("serviceListLine", index, "serviceListLineNameLink", "href", serviceRoot); - data.setAttribute("serviceListLine", index, "serviceStatusImg", "src", "/commons/status-" + service.getStatus().toString().toLowerCase() + ".png"); - data.setAttribute("serviceListLine", index, "serviceStatusImg", "title", StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString())); + data.setAttribute("serviceListLine", index, "serviceStatusImg", "src", + "/commons/status-" + service.getStatus().toString().toLowerCase() + ".png"); + data.setAttribute("serviceListLine", index, "serviceStatusImg", "title", + StringUtils.defaultIfBlank(service.getStatusDescription(), service.getStatus().toString())); if (service.getWebsiteURL() != null) { @@ -99,16 +107,25 @@ public class LastStatsView } data.setEscapedContent("serviceListLine", index, "serviceListLineSoftwareLink", service.getSoftwareName()); - data.setAttribute("serviceListLine", index, "serviceListLineSoftwareLink", "href", "software-" + service.getSoftwareTechnicalName() + ".xhtml"); + data.setAttribute("serviceListLine", index, "serviceListLineSoftwareLink", "href", + "software-" + service.getSoftwareTechnicalName() + ".xhtml"); - data.setContent("serviceListLine", index, "serviceListLineHitCount", StatoolInfosUtils.defaultIfZero(service.getMonthHitCount(month), "😢")); - data.setContent("serviceListLine", index, "serviceListLineVisitCount", StatoolInfosUtils.defaultIfZero(service.getMonthVisitCount(month), "😞")); - data.setContent("serviceListLine", index, "serviceListLineVisitorCount", StatoolInfosUtils.defaultIfZero(service.getMonthVisitorCount(month), "😞")); - data.setContent("serviceListLine", index, "serviceListLineUserCount", StatoolInfosUtils.defaultIfZero(service.getMonthUserCount(month), "😢")); - data.setContent("serviceListLine", index, "serviceListLineAccountCount", StatoolInfosUtils.defaultIfZero(service.getMonthAccountCount(month), "😇")); - data.setContent("serviceListLine", index, "serviceListLineActiveAccountCount", StatoolInfosUtils.defaultIfZero(service.getMonthActiveAccountCount(month), "😇")); - data.setContent("serviceListLine", index, "serviceListLineDatabaseBytes", StatoolInfosUtils.defaultIfZero(service.getMonthDatabaseBytes(month), "😇")); - data.setContent("serviceListLine", index, "serviceListLineDatafilesBytes", StatoolInfosUtils.defaultIfZero(service.getMonthDatafilesBytes(month), "😇")); + data.setContent("serviceListLine", index, "serviceListLineHitCount", + StatoolInfosUtils.defaultIfZero(service.getMonthHitCount(month), "😢")); + data.setContent("serviceListLine", index, "serviceListLineVisitCount", + StatoolInfosUtils.defaultIfZero(service.getMonthVisitCount(month), "😞")); + data.setContent("serviceListLine", index, "serviceListLineVisitorCount", + StatoolInfosUtils.defaultIfZero(service.getMonthVisitorCount(month), "😞")); + data.setContent("serviceListLine", index, "serviceListLineUserCount", + StatoolInfosUtils.defaultIfZero(service.getMonthUserCount(month), "😢")); + data.setContent("serviceListLine", index, "serviceListLineAccountCount", + StatoolInfosUtils.defaultIfZero(service.getMonthAccountCount(month), "😇")); + data.setContent("serviceListLine", index, "serviceListLineActiveAccountCount", + StatoolInfosUtils.defaultIfZero(service.getMonthActiveAccountCount(month), "😇")); + data.setContent("serviceListLine", index, "serviceListLineDatabaseBytes", + StatoolInfosUtils.defaultIfZero(service.getMonthDatabaseBytes(month), "😇")); + data.setContent("serviceListLine", index, "serviceListLineDatafilesBytes", + StatoolInfosUtils.defaultIfZero(service.getMonthDatafilesBytes(month), "😇")); index += 1; }