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

Added UNKNOWN status

parent 2eb817e3
Branches
Tags
No related merge requests found
......@@ -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)
......
......@@ -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)
......
......@@ -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;
}
......
......@@ -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']]
} );
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment