Skip to content
Snippets Groups Projects
Commit 7f703bad authored by Marco Malavolti's avatar Marco Malavolti
Browse files

Added UNKNOWN status

parent 2eb817e3
No related branches found
No related tags found
No related merge requests found
...@@ -87,8 +87,8 @@ class EccsResults(Resource): ...@@ -87,8 +87,8 @@ class EccsResults(Resource):
file_path = f"{e_p.ECCS_OUTPUTDIR}/eccs_{date}.log" file_path = f"{e_p.ECCS_OUTPUTDIR}/eccs_{date}.log"
if 'status' in request.args: if 'status' in request.args:
status = request.args['status'].upper() status = request.args['status'].upper()
if (status not in ['OK','DISABLED','ERROR']): if (status not in ['OK','DISABLED','ERROR','UNKNOWN']):
return jsonify(error="Incorrect status provided. It can be 'OK','DISABLED','ERROR'") return jsonify(error="Incorrect status provided. It can be 'OK','DISABLED','ERROR','UNKNOWN'")
if 'idp' in request.args: if 'idp' in request.args:
idp = request.args['idp'] idp = request.args['idp']
if (not existsInFile(file_path, idp, "entityID", eccsDataTable, date)): if (not existsInFile(file_path, idp, "entityID", eccsDataTable, date)):
...@@ -232,7 +232,7 @@ class FedStats(Resource): ...@@ -232,7 +232,7 @@ class FedStats(Resource):
return jsonify(error=f'FileNotFound: ECCS script has not been executed on {date} yet') return jsonify(error=f'FileNotFound: ECCS script has not been executed on {date} yet')
if (reg_auth): 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: for line in lines:
# Strip the line feed and carriage return characters # Strip the line feed and carriage return characters
...@@ -248,13 +248,15 @@ class FedStats(Resource): ...@@ -248,13 +248,15 @@ class FedStats(Resource):
resultDict['ERROR'] = resultDict['ERROR'] + 1 resultDict['ERROR'] = resultDict['ERROR'] + 1
if (aux['status'] == "DISABLED"): if (aux['status'] == "DISABLED"):
resultDict['DISABLED'] = resultDict['DISABLED'] + 1 resultDict['DISABLED'] = resultDict['DISABLED'] + 1
if (aux['status'] == "UNKNOWN"):
resultDict['UNKNOWN'] = resultDict['UNKNOWN'] + 1
results.append(resultDict) results.append(resultDict)
return jsonify(results) return jsonify(results)
else: else:
for name,regAuth in regAuthDict.items(): 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: for line in lines:
# Strip the line feed and carriage return characters # Strip the line feed and carriage return characters
...@@ -270,6 +272,8 @@ class FedStats(Resource): ...@@ -270,6 +272,8 @@ class FedStats(Resource):
resultDict['ERROR'] = resultDict['ERROR'] + 1 resultDict['ERROR'] = resultDict['ERROR'] + 1
if (aux['status'] == "DISABLED"): if (aux['status'] == "DISABLED"):
resultDict['DISABLED'] = resultDict['DISABLED'] + 1 resultDict['DISABLED'] = resultDict['DISABLED'] + 1
if (aux['status'] == "UNKNOWN"):
resultDict['UNKNOWN'] = resultDict['UNKNOWN'] + 1
results.append(resultDict) results.append(resultDict)
return jsonify(results) return jsonify(results)
......
...@@ -112,6 +112,10 @@ def check(idp,test): ...@@ -112,6 +112,10 @@ def check(idp,test):
elif (check_result_sp1 == check_result_sp2 == "DISABLED"): elif (check_result_sp1 == check_result_sp2 == "DISABLED"):
store_eccs_result(idp,sp,check_results,'DISABLED',test) 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: else:
store_eccs_result(idp,sp,check_results,'ERROR',test) store_eccs_result(idp,sp,check_results,'ERROR',test)
......
...@@ -7,7 +7,7 @@ tr.shown td.details-control { ...@@ -7,7 +7,7 @@ tr.shown td.details-control {
background: url('./details_close.png') no-repeat center center; 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; position: relative;
top: -1px; top: -1px;
padding: 5px; padding: 5px;
...@@ -23,15 +23,20 @@ tr.shown td.details-control { ...@@ -23,15 +23,20 @@ tr.shown td.details-control {
background-color: #72F81B; background-color: #72F81B;
} }
#lbl-unknown {
background-color: #AAAAAA;
}
#lbl-disabled { #lbl-disabled {
margin-left: 2px; margin-left: 2px;
} }
#inner-table { #inner-table {
padding-left:40px; padding-left:40px;
background-color:white; background-color:white;
} }
#inner-table tr td{ #inner-table tr td{
border: 0; border: 0;
} }
...@@ -72,7 +77,7 @@ input[type=checkbox] { ...@@ -72,7 +77,7 @@ input[type=checkbox] {
transform: scale(1.5); transform: scale(1.5);
} }
#error, #ok, #disabled { #error, #ok, #disabled, #unknown {
position: relative; position: relative;
bottom: -2px; bottom: -2px;
} }
......
...@@ -142,7 +142,7 @@ function SHA1(msg) { ...@@ -142,7 +142,7 @@ function SHA1(msg) {
} }
// PHP Variables retrieved from eccs.php // PHP Variables retrieved from index.php
// idp (entityID of the IdP) // idp (entityID of the IdP)
// date (date time of the check) // date (date time of the check)
// reg_auth (the IdP RegistrationAuthority) // reg_auth (the IdP RegistrationAuthority)
...@@ -338,6 +338,10 @@ $(document).ready(function() { ...@@ -338,6 +338,10 @@ $(document).ready(function() {
//$('td', row).css('background-color', '#00CE00'); // NEW ECCS2 //$('td', row).css('background-color', '#00CE00'); // NEW ECCS2
$('td', row).css('background-color', '#72F81B'); // OLD ECCS $('td', row).css('background-color', '#72F81B'); // OLD ECCS
} }
if (data.status == "UNKNOWN") {
$('td', row).css('background-color', '#AAAAAA');
}
}, },
"order": [[1, 'asc']] "order": [[1, 'asc']]
} ); } );
......
...@@ -54,6 +54,8 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]); ...@@ -54,6 +54,8 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]);
<input id="error" type="checkbox" name="status" value="ERROR"/> <input id="error" type="checkbox" name="status" value="ERROR"/>
<label id="lbl-ok" for="ok">OK</label> <label id="lbl-ok" for="ok">OK</label>
<input id="ok" type="checkbox" name="status" value="OK"/> <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> <label id="lbl-disabled" for="disabled">DISABLED</label>
<input id="disabled" type="checkbox" name="status" value="DISABLE"/> <input id="disabled" type="checkbox" name="status" value="DISABLE"/>
</div> <!-- END boxStatus --> </div> <!-- END boxStatus -->
...@@ -76,9 +78,9 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]); ...@@ -76,9 +78,9 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]);
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>DisplayName</th> <th>DisplayName</th>
<th>EntityID</th> <th>EntityID</th>
<th>Registration Authority</th> <th>Registration Authority</th>
</tr> </tr>
</thead> </thead>
</table> </table>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment