From 2b9e51792f42923a2fc602d8faacdafba4170524 Mon Sep 17 00:00:00 2001
From: Tomasz Wolniewicz <twoln@umk.pl>
Date: Thu, 15 Jun 2023 11:07:07 +0200
Subject: [PATCH] adding the checkbox alowing to limit the display to only
 these federations whci have a current operational problem

---
 templates/status.html                | 30 +++++++++++++++++-----------
 templates/status/status-members.html |  8 ++++++--
 2 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/templates/status.html b/templates/status.html
index f05b258..bcba572 100644
--- a/templates/status.html
+++ b/templates/status.html
@@ -18,8 +18,13 @@
 		<input type="checkbox" class="type_filter" id="include_candidates" value="candidates_group" checked="checked" />
 		<label for="include_candidates">Candidates ({{ candidates | length }})</label>
 	</div>
+        <div>
+            <input type="checkbox" id="problem_filter" />
+            <label for="include_problems">Limit to current feed problems</label>
+        </div>
 </div>
 
+
 <div class="central-section">
 
 	<div id="search_results" class="col-2-1">
@@ -177,24 +182,25 @@ function deselectAll(){
 			$dialog_test.dialog();
 			$dialog_test.dialog("destroy");
 			$dialog_test.dialog({ 'width' : w + 30,
-														'height' : h + 70,
-														'position' : {
-															my: 'right top',
-															at: 'right-50 top+50',
-															of: $('#breadcrumb')
-														},
-														'close': function(event, ui){
-															deselectAll();
-														}
-
-													});
-
+					      'height' : h + 70,
+					      'position' : {my: 'right top', at: 'right-50 top+50', of: $('#breadcrumb')},
+					      'close': function(event, ui){deselectAll();
+                                              }
+                        });
 			$dialog_test.html($memberInfo.html());
 		}
 
 
             showTime($dialog_test.find('span.timer'));
         }
+        
+        $('#problem_filter').on('change', function() {
+            if($('#problem_filter').prop('checked') ) {
+                $('.feed-ok').hide();
+            } else {
+        $('.feed-ok').show();    
+        }
+    });
 
 	$(document).keyup(function(e){
 		if(e.keyCode == 27){
diff --git a/templates/status/status-members.html b/templates/status/status-members.html
index 63291d0..70c027b 100644
--- a/templates/status/status-members.html
+++ b/templates/status/status-members.html
@@ -6,9 +6,13 @@
  {% set alert_icon = 'green_dot.png' %}
  {% set alert_text = 'status OK' %}
  {% set error_message = '' %}
+ {% set problem_class = ' feed-ok' %}
  {% if federation.fed.feed_problem %}
   {% set alert_icon = 'orange_dot.png' %}
- {% set alert_text = 'metadata update problem' %}
+  {% set alert_text = 'metadata update problem' %}
+  {% if federation.fed.status == 6 %}
+   {% set problem_class = ' feed-problem' %}
+  {% endif %}
  {% endif %}
  {% if federation.information_missing %}
   {% set error_message = error_message ~ ' information missing' %}
@@ -23,7 +27,7 @@
   {% set alert_icon = 'blue_dot.png' %}
   {% set alert_text = 'validUnitl between ' ~ constant('VALIDITY_ALERT_THRESHOLD')/3600 ~ ' and ' ~ constant('VALIDITY_WARNING_THRESHOLD')/3600 ~ ' hours' %}
  {% endif %}
-<div id="{{ federation.fed.code }}_option_div" class="member-div" style="padding-left: 1em;{%
+<div id="{{ federation.fed.code }}_option_div" class="member-div{{ problem_class }}" style="padding-left: 1em;{%
 if federation.information_missing
 %}color: red;{%
 endif
-- 
GitLab