Added alert check counts in organization page.

This commit is contained in:
Christian P. MOMON 2021-01-25 04:32:32 +01:00
parent 5822c9260a
commit 560fe0f861
3 changed files with 29 additions and 1 deletions

View file

@ -29,7 +29,10 @@ import org.slf4j.LoggerFactory;
import fr.devinsy.catgenerator.core.CatGenerator;
import fr.devinsy.statoolinfos.HtmlizerContext;
import fr.devinsy.statoolinfos.checker.PropertyChecker;
import fr.devinsy.statoolinfos.checker.PropertyChecks;
import fr.devinsy.statoolinfos.core.Organization;
import fr.devinsy.statoolinfos.core.Service;
import fr.devinsy.statoolinfos.core.StatoolInfosException;
import fr.devinsy.statoolinfos.crawl.CrawlCache;
import fr.devinsy.xidyn.XidynException;
@ -130,6 +133,27 @@ public class OrganizationPage
data.setAttribute("organizationMemberEndDateData", "style", "display: none;");
}
{
try
{
PropertyChecker checker = new PropertyChecker();
PropertyChecks checks = checker.checkOrganization(organization.getInputFile());
for (Service service : organization.getServices())
{
PropertyChecks subChecks = checker.checkService(service.getInputFile());
checks.addAll(subChecks);
}
data.setContent("errorCount", checks.getErrorCount());
data.setContent("warningCount", checks.getWarningCount());
data.setContent("voidCount", checks.getVoidCount());
}
catch (IOException exception)
{
exception.printStackTrace();
}
}
data.setContent("serviceCount", organization.getServices().size());
data.setAttribute("rawLink", "href", organization.getTechnicalName() + ".properties");

View file

@ -114,7 +114,6 @@ public class PropertyFileCheckPage
page = PropertyFilesCheckPage.htmlize("Services", serviceAlertChecks);
FileUtils.write(new File(htmlizeDirectory, "alertChecks-services.xhtml"), page, StandardCharsets.UTF_8);
}
/**

View file

@ -34,6 +34,11 @@
<a id="rawCheckLink" href="#"><img id="rawCheckLinkImg" src="circle-icons/clipboard-mono.svg" title="Fichier propriétés analysé"/></a>
<a id="rawLink" href="#"><img id="rawLinkImg" src="circle-icons/document-mono.svg" title="Fichier propriétés"/></a>
<a id="statsLink" href="#"><img id="statsLinkImg" src="circle-icons/barchart-mono.svg" title="Statistiques"/></a>
<div style="display: inline-block; vertical-align: middle; font-size: smaller; margin-left: 2px;">
<span id="errorCount" class="bg_error" style="padding: 0 10px;" title="Propriétés en erreurs">n/a</span><br/>
<span id="warningCount" class="bg_warning" style="padding: 0 10px;" title="Propriétés attendues">n/a</span><br/>
<span id="voidCount" class="bg_void" style="padding: 0 10px;" title="Propriétés Inconnues">n/a</span>
</div>
</div>
<br/>
<div>Nombre de services : <span id="serviceCount">n/a</span></div>