Managed empty data case in check page.

This commit is contained in:
Christian P. MOMON 2021-01-08 03:15:11 +01:00
parent f5ffce2fbf
commit 843b8b1d46
2 changed files with 50 additions and 35 deletions

View file

@ -107,40 +107,66 @@ public class PropertyFileCheckPage
// //
data.setContent("statsTitle", title); data.setContent("statsTitle", title);
//
int index = 0; int index = 0;
for (PropertyCheck check : checks) if (checks.isEmpty())
{ {
// data.setAttribute("fullBlockTable", "class", "xid:nodisplay");
data.setContent("line", index, "lineIndex", check.getIndex()); }
data.setEscapedContent("line", index, "lineComment", check.getComment()); else
data.setEscapedContent("line", index, "lineContent", check.getLine()); {
data.setAttribute("line", index, "lineContent", "class", statusToCSS(check.getStatus())); for (PropertyCheck check : checks)
{
//
data.setContent("line", index, "lineIndex", check.getIndex());
data.setEscapedContent("line", index, "lineComment", check.getComment());
data.setEscapedContent("line", index, "lineContent", check.getLine());
data.setAttribute("line", index, "lineContent", "class", statusToCSS(check.getStatus()));
index += 1; index += 1;
}
} }
//
index = 0; index = 0;
for (PropertyCheck check : checks.extractActiveLines()) PropertyChecks subchecks = checks.extractActiveLines();
if (subchecks.isEmpty())
{ {
// data.setAttribute("shrunkBlockTable", "class", "xid:nodisplay");
data.setContent("shrunkLine", index, "shrunkLineIndex", check.getIndex()); }
data.setEscapedContent("shrunkLine", index, "shrunkLineContent", check.getLine()); else
data.setEscapedContent("shrunkLine", index, "shrunkLineComment", check.getComment()); {
data.setAttribute("shrunkLine", index, "shrunkLineContent", "class", statusToCSS(check.getStatus())); for (PropertyCheck check : subchecks)
{
//
data.setContent("shrunkLine", index, "shrunkLineIndex", check.getIndex());
data.setEscapedContent("shrunkLine", index, "shrunkLineContent", check.getLine());
data.setEscapedContent("shrunkLine", index, "shrunkLineComment", check.getComment());
data.setAttribute("shrunkLine", index, "shrunkLineContent", "class", statusToCSS(check.getStatus()));
index += 1; index += 1;
}
} }
//
index = 0; index = 0;
for (PropertyCheck check : checks.extractAlertLines()) subchecks = checks.extractAlertLines();
if (subchecks.isEmpty())
{ {
// data.setAttribute("alertBlockTable", "class", "xid:nodisplay");
data.setContent("alertLine", index, "alertLineIndex", check.getIndex()); }
data.setEscapedContent("alertLine", index, "alertLineContent", check.getLine()); else
data.setEscapedContent("alertLine", index, "alertLineComment", check.getComment()); {
data.setAttribute("alertLine", index, "alertLineContent", "class", statusToCSS(check.getStatus())); for (PropertyCheck check : subchecks)
{
//
data.setContent("alertLine", index, "alertLineIndex", check.getIndex());
data.setEscapedContent("alertLine", index, "alertLineContent", check.getLine());
data.setEscapedContent("alertLine", index, "alertLineComment", check.getComment());
data.setAttribute("alertLine", index, "alertLineContent", "class", statusToCSS(check.getStatus()));
index += 1; index += 1;
}
} }
// //

View file

@ -27,7 +27,7 @@
<span id="voidCount" class="bg_void" style="padding: 0 10px;" title="Inconnus">n/a</span> <span id="voidCount" class="bg_void" style="padding: 0 10px;" title="Inconnus">n/a</span>
</div> </div>
<div id="fullBlock" style="width: 100%;"> <div id="fullBlock" style="width: 100%;">
<table class="table_simple"> <table id="fullBlockTable" class="table_simple">
<tbody> <tbody>
<tr id="line"> <tr id="line">
<td id="lineIndex" style="width: 30px; text-align: right; padding-right: 5px;">000</td> <td id="lineIndex" style="width: 30px; text-align: right; padding-right: 5px;">000</td>
@ -38,7 +38,7 @@
</table> </table>
</div> </div>
<div id="shrunkBlock" style="width: 100%; display: none;"> <div id="shrunkBlock" style="width: 100%; display: none;">
<table class="table_simple"> <table id="shrunkBlockTable" class="table_simple">
<tbody> <tbody>
<tr id="shrunkLine"> <tr id="shrunkLine">
<td id="shrunkLineIndex" style="width: 30px; text-align: right; right; padding-right: 5px;">000</td> <td id="shrunkLineIndex" style="width: 30px; text-align: right; right; padding-right: 5px;">000</td>
@ -49,7 +49,7 @@
</table> </table>
</div> </div>
<div id="alertBlock" style="width: 100%; display: none;"> <div id="alertBlock" style="width: 100%; display: none;">
<table class="table_simple"> <table id="alertBlockTable" class="table_simple">
<tbody> <tbody>
<tr id="alertLine"> <tr id="alertLine">
<td id="alertLineIndex" style="width: 30px; text-align: right; right; padding-right: 5px;">000</td> <td id="alertLineIndex" style="width: 30px; text-align: right; right; padding-right: 5px;">000</td>
@ -59,17 +59,6 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div id="alertBlock" style="width: 100%; display: none;">
<table class="table_simple">
<tbody>
<tr id="alertLine">
<td id="alertLineIndex" style="width: 30px; text-align: right;">000</td>
<td id="alertLineContent" style="padding-left: 10px;">n/a</td>
<td id="alertLineComment" style="width: 200px; padding-left: 10px;">n/a</td>
</tr>
</tbody>
</table>
</div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">