diff --git a/api.py b/api.py index c55d3a36c00ddef1bc32f7fb9b5d9879caaf96f0..f2129d5ee54c29feba035bf4c31ca887a1680764 100755 --- a/api.py +++ b/api.py @@ -87,8 +87,8 @@ class EccsResults(Resource): file_path = f"{e_p.ECCS_OUTPUTDIR}/eccs_{date}.log" if 'status' in request.args: status = request.args['status'].upper() - if (status not in ['OK','DISABLED','ERROR']): - return jsonify(error="Incorrect status provided. It can be 'OK','DISABLED','ERROR'") + if (status not in ['OK','DISABLED','ERROR','UNKNOWN']): + return jsonify(error="Incorrect status provided. It can be 'OK','DISABLED','ERROR','UNKNOWN'") if 'idp' in request.args: idp = request.args['idp'] if (not existsInFile(file_path, idp, "entityID", eccsDataTable, date)): @@ -232,7 +232,7 @@ class FedStats(Resource): return jsonify(error=f'FileNotFound: ECCS script has not been executed on {date} yet') if (reg_auth): - resultDict = {'date': date, 'registrationAuthority': reg_auth, 'OK': 0, 'ERROR': 0, 'DISABLED': 0} + resultDict = {'date': date, 'registrationAuthority': reg_auth, 'OK': 0, 'ERROR': 0, 'DISABLED': 0, 'UNKNOWN': 0} for line in lines: # Strip the line feed and carriage return characters @@ -248,13 +248,15 @@ class FedStats(Resource): resultDict['ERROR'] = resultDict['ERROR'] + 1 if (aux['status'] == "DISABLED"): resultDict['DISABLED'] = resultDict['DISABLED'] + 1 + if (aux['status'] == "UNKNOWN"): + resultDict['UNKNOWN'] = resultDict['UNKNOWN'] + 1 results.append(resultDict) return jsonify(results) else: for name,regAuth in regAuthDict.items(): - resultDict = {'date': date, 'registrationAuthority': regAuth, 'OK': 0, 'ERROR': 0, 'DISABLED': 0} + resultDict = {'date': date, 'registrationAuthority': regAuth, 'OK': 0, 'ERROR': 0, 'DISABLED': 0, 'UNKNOWN': 0} for line in lines: # Strip the line feed and carriage return characters @@ -270,6 +272,8 @@ class FedStats(Resource): resultDict['ERROR'] = resultDict['ERROR'] + 1 if (aux['status'] == "DISABLED"): resultDict['DISABLED'] = resultDict['DISABLED'] + 1 + if (aux['status'] == "UNKNOWN"): + resultDict['UNKNOWN'] = resultDict['UNKNOWN'] + 1 results.append(resultDict) return jsonify(results) diff --git a/eccs.py b/eccs.py index 2b73888c1f637d1e21fe65002ce68f50e69f0df7..3dfeb7df565be2fdcd3234e58197c25e3a0091e2 100755 --- a/eccs.py +++ b/eccs.py @@ -112,6 +112,10 @@ def check(idp,test): elif (check_result_sp1 == check_result_sp2 == "DISABLED"): store_eccs_result(idp,sp,check_results,'DISABLED',test) + elif ((check_result_sp1 == check_result_sp2 == check_result_sp3 == "OK") or + (check_result_sp1 == "Unable-To-Check" or check_result_sp2 == "Unable-To-Check")): + store_eccs_result(idp,sp,check_results,'UNKNOWN',test) + else: store_eccs_result(idp,sp,check_results,'ERROR',test) diff --git a/web/eccs.css b/web/eccs.css index 8a465bd5448b5982ab1d83653da3b82465f49bda..7163e6679b8742b8a26a8919622bddf04a7ac0f5 100644 --- a/web/eccs.css +++ b/web/eccs.css @@ -7,7 +7,7 @@ tr.shown td.details-control { background: url('./details_close.png') no-repeat center center; } -#lbl-error, #lbl-ok, #lbl-disabled { +#lbl-error, #lbl-ok, #lbl-disabled, #lbl-unknown { position: relative; top: -1px; padding: 5px; @@ -23,15 +23,20 @@ tr.shown td.details-control { background-color: #72F81B; } +#lbl-unknown { + background-color: #AAAAAA; +} + #lbl-disabled { margin-left: 2px; } #inner-table { - padding-left:40px; + padding-left:40px; background-color:white; } + #inner-table tr td{ border: 0; } @@ -72,7 +77,7 @@ input[type=checkbox] { transform: scale(1.5); } -#error, #ok, #disabled { +#error, #ok, #disabled, #unknown { position: relative; bottom: -2px; } diff --git a/web/eccs.js b/web/eccs.js index 57152eb7095424be7d807f7b08a04bca322abeb6..1eb28b5a7906ea5518967d51024972e361061983 100644 --- a/web/eccs.js +++ b/web/eccs.js @@ -142,7 +142,7 @@ function SHA1(msg) { } -// PHP Variables retrieved from eccs.php +// PHP Variables retrieved from index.php // idp (entityID of the IdP) // date (date time of the check) // reg_auth (the IdP RegistrationAuthority) @@ -338,6 +338,10 @@ $(document).ready(function() { //$('td', row).css('background-color', '#00CE00'); // NEW ECCS2 $('td', row).css('background-color', '#72F81B'); // OLD ECCS } + if (data.status == "UNKNOWN") { + $('td', row).css('background-color', '#AAAAAA'); + } + }, "order": [[1, 'asc']] } ); diff --git a/web/index.php b/web/index.php index b49fa727a816d557b9eae61c6d7675311c2b1da2..ae3b006a55ecc37e8e83b4d3dd25d0f183c7386b 100644 --- a/web/index.php +++ b/web/index.php @@ -54,6 +54,8 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]); <input id="error" type="checkbox" name="status" value="ERROR"/> <label id="lbl-ok" for="ok">OK</label> <input id="ok" type="checkbox" name="status" value="OK"/> + <label id="lbl-unknown" for="unknown">UNKNOWN</label> + <input id="unknown" type="checkbox" name="status" value="UNKNOWN"/> <label id="lbl-disabled" for="disabled">DISABLED</label> <input id="disabled" type="checkbox" name="status" value="DISABLE"/> </div> <!-- END boxStatus --> @@ -76,9 +78,9 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]); <thead> <tr> <th></th> - <th>DisplayName</th> - <th>EntityID</th> - <th>Registration Authority</th> + <th>DisplayName</th> + <th>EntityID</th> + <th>Registration Authority</th> </tr> </thead> </table>