Improved code.

This commit is contained in:
Christian P. MOMON 2021-06-11 23:35:50 +02:00
parent a5cfd2f8d5
commit 7e8aac7ec7
5 changed files with 70 additions and 21 deletions

View file

@ -523,26 +523,7 @@ public class Federation extends PathPropertyList
// //
for (Organization organization : getOrganizations()) for (Organization organization : getOrganizations())
{ {
result.add(organization.getContactURL()); result.addAll(organization.getURLAll());
result.add(organization.getLegalURL());
result.add(organization.getLogoURL());
result.add(organization.getTechnicalGuideURL());
result.add(organization.getUserGuideURL());
result.add(organization.getWebsiteURL());
//
for (Service service : organization.getServices())
{
result.add(service.getContactURL());
result.add(service.getLegalURL());
result.add(service.getLogoURL());
result.add(service.getSoftwareWebsite());
result.add(service.getSoftwareLicenseURL());
result.add(service.getSoftwareSourceURL());
result.add(service.getTechnicalGuideURL());
result.add(service.getUserGuideURL());
result.add(service.getWebsiteURL());
}
} }
// //

View file

@ -33,6 +33,7 @@ import fr.devinsy.statoolinfos.htmlize.charts.WeekValues;
import fr.devinsy.statoolinfos.htmlize.charts.YearValues; import fr.devinsy.statoolinfos.htmlize.charts.YearValues;
import fr.devinsy.statoolinfos.properties.PathProperties; import fr.devinsy.statoolinfos.properties.PathProperties;
import fr.devinsy.statoolinfos.properties.PathPropertyList; import fr.devinsy.statoolinfos.properties.PathPropertyList;
import fr.devinsy.statoolinfos.uptime.URLSet;
import fr.devinsy.statoolinfos.util.URLUtils; import fr.devinsy.statoolinfos.util.URLUtils;
/** /**
@ -682,6 +683,34 @@ public class Organization extends PathPropertyList
return result; return result;
} }
/**
* Gets the URL all.
*
* @return the URL all
*/
public URLSet getURLAll()
{
URLSet result;
result = new URLSet();
result.add(getContactURL());
result.add(getLegalURL());
result.add(getLogoURL());
result.add(getTechnicalGuideURL());
result.add(getUserGuideURL());
result.add(getWebsiteURL());
//
for (Service service : getServices())
{
result.addAll(service.getURLAll());
}
//
return result;
}
/** /**
* Gets the user count. * Gets the user count.
* *

View file

@ -34,6 +34,7 @@ import fr.devinsy.statoolinfos.crawl.CrawlJournal;
import fr.devinsy.statoolinfos.htmlize.charts.MonthValues; import fr.devinsy.statoolinfos.htmlize.charts.MonthValues;
import fr.devinsy.statoolinfos.properties.PathProperties; import fr.devinsy.statoolinfos.properties.PathProperties;
import fr.devinsy.statoolinfos.properties.PathPropertyList; import fr.devinsy.statoolinfos.properties.PathPropertyList;
import fr.devinsy.statoolinfos.uptime.URLSet;
import fr.devinsy.statoolinfos.util.URLUtils; import fr.devinsy.statoolinfos.util.URLUtils;
/** /**
@ -779,6 +780,26 @@ public class Service extends PathPropertyList
return result; return result;
} }
public URLSet getURLAll()
{
URLSet result;
result = new URLSet();
result.add(getContactURL());
result.add(getLegalURL());
result.add(getLogoURL());
result.add(getSoftwareWebsite());
result.add(getSoftwareLicenseURL());
result.add(getSoftwareSourceURL());
result.add(getTechnicalGuideURL());
result.add(getUserGuideURL());
result.add(getWebsiteURL());
//
return result;
}
/** /**
* User count. * User count.
* *

View file

@ -12,7 +12,11 @@
</head> </head>
<body> <body>
<div style="width:1150px; margin: 0 auto 0 auto;"> <div style="width:1150px; margin: 0 auto 0 auto;">
<h2>Disponibilités</h2> <h2>Disponibilité des services</h2>
<div style="margin-left: 0px; margin-bottom: 10px;">
<a id="allButton" href="#all" class="button" onclick="javascript:setView('ALL');">Tout</a>
<a id="shrunkButton" href="#shrunk" class="button" onclick="javascript:setView('SHRUNK');">Réduit</a>
</div>
<div class="legend right" style="float: right; margin-top: -150px;"> <div class="legend right" style="float: right; margin-top: -150px;">
<div class="row"> <div class="row">

View file

@ -59,6 +59,20 @@ public class URLSet implements Iterable<URL>
} }
} }
/**
* Adds the all.
*
* @param urls
* the urls
*/
public void addAll(final URLSet urls)
{
for (URL url : urls)
{
add(url);
}
}
/** /**
* Clear. * Clear.
*/ */