From 415938713366e60c3f88b2bb14ea453cfbb8228a Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Sat, 3 Jul 2021 22:44:19 +0200 Subject: [PATCH] Added filter buttons in uptime view. --- .../statoolinfos/htmlize/uptimeView.xhtml | 64 ++++++++++++------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml b/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml index a25279c..8e89b5c 100644 --- a/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml +++ b/src/fr/devinsy/statoolinfos/htmlize/uptimeView.xhtml @@ -15,6 +15,8 @@

Disponibilité des services

Tout + Alertes + Rétablis Indisponibles
@@ -121,32 +123,48 @@ $(document).ready(function() 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(); - } + { + $.fn.dataTable.ext.search.pop(); + table.draw(); }); + $("#nokButton").click(function() + { + $.fn.dataTable.ext.search.pop(); + $.fn.dataTable.ext.search.push( + function(settings, data, dataIndex) + { + var result; + return !(table.cell(dataIndex, 23).data().includes('status-ok') || table.cell(dataIndex, 23).data().includes('status-warning')); + } + ); + table.draw(); + }); + + $("#fixedButton").click(function() + { + $.fn.dataTable.ext.search.pop(); + $.fn.dataTable.ext.search.push( + function(settings, data, dataIndex) + { + return table.cell(dataIndex, 23).data().includes('status-warning'); + } + ); + table.draw(); + }); + + $("#alertButton").click(function() + { + $.fn.dataTable.ext.search.pop(); + $.fn.dataTable.ext.search.push( + function(settings, data, dataIndex) + { + return !table.cell(dataIndex, 23).data().includes('status-ok'); + } + ); + table.draw(); + }); });