Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Technical Site
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 OT
eduGAIN Technical Site
Commits
d5662718
Commit
d5662718
authored
1 year ago
by
Tomasz Wolniewicz
Browse files
Options
Downloads
Plain Diff
Merge branch 'cherry-pick-
3fa588b4
' into 'psnc-production'
The new issues page See merge request
!25
parents
e84df4c1
667dbdb5
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!25
The new issues page
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/config-template.php
+6
-2
6 additions, 2 deletions
lib/config-template.php
page-logic/issues.php
+81
-0
81 additions, 0 deletions
page-logic/issues.php
templates/issues.html
+56
-0
56 additions, 0 deletions
templates/issues.html
web/css/master.css
+21
-0
21 additions, 0 deletions
web/css/master.css
with
164 additions
and
2 deletions
lib/config-template.php
+
6
−
2
View file @
d5662718
...
...
@@ -44,9 +44,12 @@ define('BACK_TIME_ENTITIES', '14 days');
// the log level use 3 or less for normal production
define
(
'LOG_LEVEL'
,
5
);
// number of seconds to the expire time that causes the warning icon being shown
define
(
'VALIDITY_WARNING_THRESHOLD'
,
388800
);
define
(
'VALIDITY_WARNING_THRESHOLD'
,
388800
);
// 108h - 4.5days
// number of seconds to the expire time that causes the alert icon being shown
define
(
'VALIDITY_ALERT_THRESHOLD'
,
10800
);
define
(
'VALIDITY_ALERT_THRESHOLD'
,
10800
);
// 3h
// number of seconds to the expire that the federation will be shown in red
define
(
'ISSUES_ALERT_THRESHOLD'
,
129600
);
// 36h
// The settings below can probably stay as they are
//
...
...
@@ -68,6 +71,7 @@ define('WHATS_NEW_URL', ROOT_URL.'/whatsnew');
define
(
'SYSTEM_UPDATES'
,
'https://wiki.geant.org/display/eduGAIN/eduGAIN+Services+Status'
);
define
(
'V2_AUDIT'
,
ROOT_URL
.
'/compliance_audit'
);
define
(
'LINK_TESTS'
,
ROOT_URL
.
'/link_tests'
);
define
(
'ISSUES_URL'
,
ROOT_URL
.
'/issues'
);
// contacts
define
(
'EDUGAIN_EMAIL'
,
'edugain@geant.org'
);
...
...
This diff is collapsed.
Click to expand it.
page-logic/issues.php
0 → 100644
+
81
−
0
View file @
d5662718
<?php
require_once
(
eduGAIN_config
.
'database_ro.php'
);
function
formatSec
(
$inSeconds
)
{
$inSec
=
abs
(
$inSeconds
);
$inMin
=
floor
(
$inSec
/
60
);
$sec
=
$inSec
-
60
*
$inMin
;
$inHours
=
floor
(
$inMin
/
60
);
$min
=
$inMin
-
60
*
$inHours
;
$days
=
floor
(
$inHours
/
24
);
$hours
=
$inHours
-
24
*
$days
;
return
$days
.
"d "
.
$hours
.
"h "
.
$min
.
"min "
.
$sec
.
"s"
;
}
function
prepareFederationFields
(
$federation
)
{
$out
=
[
'fed'
=>
$federation
[
'code'
],
'name'
=>
$federation
[
'name'
],
'countries'
=>
$federation
[
'countries'
],
'color'
=>
$federation
[
'valid_sec'
]
<
ISSUES_ALERT_THRESHOLD
?
"red"
:
"#F1893B"
,
'creationinstant'
=>
[
'value'
=>
$federation
[
'creationinstant'
],
'display_title'
=>
'Metadata creation time'
,
],
'valid_until'
=>
[
'value'
=>
$federation
[
'valid_until'
],
'display_title'
=>
'Metadata valid until'
,
],
'feed_pull_time'
=>
[
'value'
=>
$federation
[
'feed_pull_time'
],
'display_title'
=>
'Last metadata pull'
,
],
'last_validation'
=>
[
'value'
=>
$federation
[
'last_validation'
],
'display_title'
=>
'Last successful validation'
,
],
'feed_problem_desc'
=>
[
'value'
=>
$federation
[
'feed_problem_desc'
]
??
$federation
[
'feed_problem_desc'
]
??
"The feed is close to expiry"
,
'display_title'
=>
'Issue'
,
],
'still_valid'
=>
[
'value'
=>
formatSec
(
$federation
[
'valid_sec'
]),
],
'valid_timestamp'
=>
[
'value'
=>
$federation
[
'valid_timestamp'
]
],
'contact_email'
=>
[
'value'
=>
$federation
[
'contact_email'
],
'display_title'
=>
'Federation contact'
,
],
'valid_sec'
=>
[
'value'
=>
$federation
[
'valid_sec'
],
],
];
return
(
$out
);
}
$edugain
=
new
eduGAIN
(
5
);
$edugain
->
load_federations_state
();
$edugain
->
load_federation_map_codes
();
$edugain
->
load_federation_country_names
();
$out
=
[];
$tmp
=
[];
$times
=
[];
$now
=
time
();
foreach
(
$edugain
->
FEDS
as
$fed
)
{
if
(
$fed
[
'valid_sec'
]
<
VALIDITY_WARNING_THRESHOLD
||
$fed
[
'feed_problem'
]
>
0
)
{
$fields
=
prepareFederationFields
(
$fed
);
$tmp
[
$fed
[
'code'
]]
=
$fields
;
$times
[
$fed
[
'code'
]]
=
$fields
[
'valid_timestamp'
];
}
}
asort
(
$times
);
foreach
(
$times
as
$fed
=>
$tm
)
{
$out
[
$fed
]
=
$tmp
[
$fed
];
}
$data
[
'feds'
]
=
$out
;
echo
$twig
->
render
(
'issues.html'
,
$data
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/issues.html
0 → 100644
+
56
−
0
View file @
d5662718
{% extends 'common/master.html' %}
{% import 'status/status-members-field-macros.html' as display %}
{% set breadcrumb = ['Members', 'Current issues'] %}
{% block title %}Federation issues{% endblock title %}
{% block main_body %}
<div
class=
"central-section"
>
This page shows federations with potential issues. The list is ordered putting federations closest to expiry on top.
<br/>
{% if feds|length > 0 %}
<strong>
All times are in UTC.
</strong>
.
<p>
<table
id=
"issues"
>
{% for federation in feds %}
<tr>
<td
colspan=
"2"
class=
"issues-title"
style=
"background-color: {{ federation.color }}"
>
{{ federation.name }} {% if federation.countries is defined %} ({{federation.countries|join(', ')}}){% endif %}
{% if federation.valid_sec.value
<
0
%}
-
expired
{{
federation.still_valid.value
}}
ago
{%
else
%}
-
still
valid
{{
federation.still_valid.value
}}
{%
endif
%}</
td
>
</tr>
<tr>
<th>
{{ federation.feed_problem_desc.display_title }}
</th>
<!-- comment -->
<td>
{{ federation.feed_problem_desc.value }}
</td>
<!-- comment -->
</tr>
<tr>
<th>
{{ federation.creationinstant.display_title }}
</th>
<!-- comment -->
<td>
{{ federation.creationinstant.value | date("Y-m-d H:i:s") }}
</td>
<!-- comment -->
</tr>
<tr>
<th>
{{ federation.valid_until.display_title }}
</th>
<!-- comment -->
<td>
{{ federation.valid_until.value | date("Y-m-d H:i:s") }}
</td>
<!-- comment -->
</tr>
<tr>
<th>
{{ federation.feed_pull_time.display_title }}
</th>
<!-- comment -->
<td>
{{ federation.feed_pull_time.value | date("Y-m-d H:i:s") }}
</td>
<!-- comment -->
</tr>
<tr>
<th>
{{ federation.last_validation.display_title }}
</th>
<!-- comment -->
<td>
{{ federation.last_validation.value | date("Y-m-d H:i:s") }}
</td>
<!-- comment -->
</tr>
<tr>
<th>
{{ federation.contact_email.display_title }}
</th>
<!-- comment -->
<td><a
href=
"mailto:{{ federation.contact_email.value }}"
>
{{ federation.contact_email.value }}
</a></td>
<!-- comment -->
</tr>
{% endfor %}
</table>
{% else %}
<h1>
Currently there are no issues
</h1>
<!-- comment -->
{% endif %}
</div>
{% endblock main_body %}
This diff is collapsed.
Click to expand it.
web/css/master.css
+
21
−
0
View file @
d5662718
...
...
@@ -400,3 +400,24 @@ div.api-help dt {
top
:
50%
;
display
:
none
;
}
#issues
{
font-size
:
14px
;
}
#issues
td
.issues-title
{
font-size
:
1.2em
;
background-color
:
#F1893B
;
color
:
#FFF
;
padding-left
:
0.5em
;
padding-right
:
1em
;
}
#issues
td
{
}
#issues
th
{
text-align
:
left
;
padding-left
:
2em
;
}
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