Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Connectivity Check
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Connectivity Check
Commits
13e660a8
Commit
13e660a8
authored
5 years ago
by
Marco Malavolti
Browse files
Options
Downloads
Patches
Plain Diff
Fixed no data available for a day
parent
47759bb4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api.py
+28
-21
28 additions, 21 deletions
api.py
web/index.php
+1
-1
1 addition, 1 deletion
web/index.php
web/script.js
+5
-1
5 additions, 1 deletion
web/script.js
with
34 additions
and
23 deletions
api.py
+
28
−
21
View file @
13e660a8
...
@@ -27,6 +27,20 @@ def buildEmailAddress(listContacts):
...
@@ -27,6 +27,20 @@ def buildEmailAddress(listContacts):
return
hrefList
return
hrefList
def
existsInFile
(
file_path
,
value
,
research_item
):
with
open
(
file_path
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
fo
:
lines
=
fo
.
readlines
()
for
line
in
lines
:
aux
=
json
.
loads
(
line
)
if
(
research_item
==
"
entityID
"
):
if
(
value
==
aux
[
'
entityID
'
]):
return
True
if
(
research_item
==
"
registrationAuthority
"
):
if
(
value
==
aux
[
'
registrationAuthority
'
]):
return
True
return
False
### Classes
### Classes
# Test
# Test
...
@@ -55,34 +69,27 @@ class EccsResults(Resource):
...
@@ -55,34 +69,27 @@ class EccsResults(Resource):
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
'
]):
return
"
Incorrect status
format, should
be
'
ok
'
,
'
disabled
'
,
'
error
'"
return
'
{
"
error
"
:
"
Incorrect status
provided. It can
be
\
'
ok
\
'
,
\
'
disabled
\
'
,
\
'
error
\
'
"
}
'
if
'
idp
'
in
request
.
args
:
if
'
idp
'
in
request
.
args
:
idp
=
request
.
args
[
'
idp
'
]
idp
=
request
.
args
[
'
idp
'
]
with
open
(
file_path
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
fo
:
if
(
not
existsInFile
(
file_path
,
idp
,
"
entityID
"
)):
lines
=
fo
.
readlines
()
return
"
Identity Provider not found with the entityID: %s
"
%
idp
found
=
False
for
line
in
lines
:
aux
=
json
.
loads
(
line
)
if
(
idp
==
aux
[
'
entityID
'
]):
found
=
True
if
(
found
==
False
):
return
"
Identity Provider not found with the entityID: %s
"
%
idp
if
'
reg_auth
'
in
request
.
args
:
if
'
reg_auth
'
in
request
.
args
:
reg_auth
=
request
.
args
[
'
reg_auth
'
]
reg_auth
=
request
.
args
[
'
reg_auth
'
]
with
open
(
file_path
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
fo
:
if
(
not
existsInFile
(
file_path
,
reg_auth
,
"
registrationAuthority
"
)):
lines
=
fo
.
readlines
()
return
"
Identity Providers not found with the Registration Authority: %s
"
%
reg_auth
found
=
False
for
line
in
lines
:
aux
=
json
.
loads
(
line
)
if
(
reg_auth
==
aux
[
'
registrationAuthority
'
]):
found
=
True
if
(
found
==
False
):
return
"
Identity Providers not found with the Registration Authority: %s
"
%
reg_auth
lines
=
[]
lines
=
[]
results
=
[]
results
=
[]
with
open
(
file_path
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
fo
:
try
:
lines
=
fo
.
readlines
()
with
open
(
file_path
,
"
r
"
,
encoding
=
"
utf-8
"
)
as
fo
:
lines
=
fo
.
readlines
()
except
FileNotFoundError
as
e
:
if
(
eccsDataTable
):
return
''
else
:
return
"
FileNotFound: ECCS2 script has not been executed for this day
"
for
line
in
lines
:
for
line
in
lines
:
# Strip the line feed and carriage return characters
# Strip the line feed and carriage return characters
...
...
This diff is collapsed.
Click to expand it.
web/index.php
+
1
−
1
View file @
13e660a8
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<html>
<html>
<head>
<head>
<script
type=
"text/javascript"
src=
"https://code.jquery.com/jquery-3.5.1.js"
></script>
<script
type=
"text/javascript"
src=
"https://code.jquery.com/jquery-3.5.1.js"
crossorigin=
"anonymous"
></script>
<script
type=
"text/javascript"
src=
"https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css"
/>
...
...
This diff is collapsed.
Click to expand it.
web/script.js
+
5
−
1
View file @
13e660a8
// Global URL
// Global URL
var
url
=
"
/eccs2/api/eccsresults?eccdt=1
"
;
var
url
=
"
/eccs2/api/eccsresults?ecc
s
dt=1
"
;
var
table
;
var
table
;
// use URL constructor and return hostname
// use URL constructor and return hostname
function
getHostname
(
url
)
{
function
getHostname
(
url
)
{
if
(
url
==
""
){
return
null
}
const
urlNew
=
new
URL
(
url
);
const
urlNew
=
new
URL
(
url
);
if
(
urlNew
.
hostname
){
if
(
urlNew
.
hostname
){
return
urlNew
.
hostname
;
return
urlNew
.
hostname
;
...
@@ -53,6 +56,7 @@ function format ( d ) {
...
@@ -53,6 +56,7 @@ function format ( d ) {
'
<td><a href="
'
+
d
.
sp2
.
wayflessUrl
+
'
" target="_blank">Click to retry</a></td>
'
+
'
<td><a href="
'
+
d
.
sp2
.
wayflessUrl
+
'
" target="_blank">Click to retry</a></td>
'
+
'
</tr>
'
+
'
</tr>
'
+
'
</table>
'
;
'
</table>
'
;
}
}
}
function
getPastResults
()
{
function
getPastResults
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment