Added unavailable filter button in uptime view.

This commit is contained in:
Christian P. MOMON 2021-06-12 01:46:35 +02:00
parent 7e8aac7ec7
commit 08891da488

View file

@ -14,8 +14,8 @@
<div style="width:1150px; margin: 0 auto 0 auto;"> <div style="width:1150px; margin: 0 auto 0 auto;">
<h2>Disponibilité des services</h2> <h2>Disponibilité des services</h2>
<div style="margin-left: 0px; margin-bottom: 10px;"> <div style="margin-left: 0px; margin-bottom: 10px;">
<a id="allButton" href="#all" class="button" onclick="javascript:setView('ALL');">Tout</a> <a id="allButton" class="button" href="#" onclick="javascript:filter('ALL');">Tout</a>
<a id="shrunkButton" href="#shrunk" class="button" onclick="javascript:setView('SHRUNK');">Réduit</a> <a id="nokButton" class="button" href="#" onclick="javascript:filter('NOK');">Indisponibles</a>
</div> </div>
<div class="legend right" style="float: right; margin-top: -150px;"> <div class="legend right" style="float: right; margin-top: -150px;">
@ -39,7 +39,8 @@
<li><img src="status-void.png" title="" /><span id="voidCount">n/a</span></li> <li><img src="status-void.png" title="" /><span id="voidCount">n/a</span></li>
</ul> </ul>
</div> </div>
<table class="center_table table_classic left uptimeTable"> <table id="uptimeTable" class="center_table table_classic left uptimeTable">
<thead>
<tr id="lineHeader"> <tr id="lineHeader">
<th id="lineName" style="padding-top: 0; padding-bottom: 0;">Service</th> <th id="lineName" style="padding-top: 0; padding-bottom: 0;">Service</th>
<th id="lineName" style="padding-top: 0; padding-bottom: 0;">Organisation</th> <th id="lineName" style="padding-top: 0; padding-bottom: 0;">Organisation</th>
@ -66,6 +67,8 @@
<td id="lineHeader-1">X</td> <td id="lineHeader-1">X</td>
<td id="lineHeader-0">X</td> <td id="lineHeader-0">X</td>
</tr> </tr>
</thead>
<tbody>
<tr id="line"> <tr id="line">
<td id="lineName" style="padding-top: 0; padding-bottom: 0;"> <td id="lineName" style="padding-top: 0; padding-bottom: 0;">
<a href="#" id="lineNameLink"> <a href="#" id="lineNameLink">
@ -102,7 +105,48 @@
<td id="uptime-1"><img id="statusImg-1" src="status-void.png" /></td> <td id="uptime-1"><img id="statusImg-1" src="status-void.png" /></td>
<td id="uptime-0"><img id="statusImg-0" src="status-void.png" /></td> <td id="uptime-0"><img id="statusImg-0" src="status-void.png" /></td>
</tr> </tr>
</tbody>
</table> </table>
</div> </div>
<script type="text/javascript">
$(document).ready(function()
{
var table = $('#uptimeTable').DataTable(
{
paging: false,
ordering: true,
"order": [[ 0, "asc" ]],
language: dataTableFrench
});
var showAll=1;
$("#nokButton").click(function()
{
if (showAll == 1)
{
showAll=0;
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex)
{
return !table.cell(dataIndex, 23).data().includes('-ok');
}
);
table.draw();
}
});
$("#allButton").click(function()
{
if (showAll == 0)
{
showAll=1;
$.fn.dataTable.ext.search.pop();
table.draw();
}
});
});
</script>
</body> </body>
</html> </html>