Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 6e1f701

Browse files
committed
Added legends to charts, header is taken from config
1 parent 9c562fc commit 6e1f701

File tree

7 files changed

+71
-3
lines changed

7 files changed

+71
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
[Added]
6+
- Added legends to charts
7+
- Instance name in header is taken from config file
8+
59
[Fixed]
610
- set default value of lastDays and tab in index.php: no error logs when user open statistics for the first time
711

dictionaries/Proxystatistics.definition.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,27 @@
104104
"cs": "Služba"
105105
},
106106
"templates/statistics_header": {
107-
"en": "SimpleSAMLphp Statistics",
108-
"cs": "SimpleSAMLphp Statistiky"
107+
"en": "AAI Statistics",
108+
"cs": "AAI Statistiky"
109+
},
110+
"templates/identityProviders_legend": {
111+
"en": "The chart and the table show number of logins from each identity provider in selected time range.",
112+
"cs": "Graf s tabulkou ukazují počet přihlášení od každého poskytovatele identity ve zvoleném časovém rozmezí."
113+
},
114+
"templates/serviceProviders_legend": {
115+
"en": "The chart and the table show number of logins to each service provider in selected time range. Only first access to the service is counted, following single sign-on accesses are not counted, because they are not going through the Proxy.",
116+
"cs": "Graf s tabulkou ukazují přihlášení ke každé službě ve zvoleném časovém rozmezí. Počítá se pouze první přístup ke službě, protože další již nejdou přes Proxy."
117+
},
118+
"templates/summary_logins_info": {
119+
"en": "The chart shows overall number of logins from identity providers for each day.",
120+
"cs": "Graf zobrazuje počet přihlášení za každý den."
121+
},
122+
"templates/summary_idps_info": {
123+
"en": "The chart shows number of logins from each identity provider in selected time range.",
124+
"cs": "Graf zobrazuje počet přihlášení od každého poskytovatele identity ve zvoleném časovém rozmezí."
125+
},
126+
"templates/summary_sps_info": {
127+
"en": "The chart shows number of logins to each service provider in selected time range. Only first access to the service is counted, following single sign-on accesses are not counted, because they are not going through the Proxy.",
128+
"cs": "Graf zobrazuje počet přihlášení ke každé službě ve zvoleném časovém rozmezí. Počítá se pouze první přístup ke službě, následující přístupy neprocházejí přes Proxy."
109129
}
110130
}

templates/identityProviders-tpl.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ function drawIdpsTable() {
6969
</div>
7070

7171
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_id_providers}'); ?></h2>
72+
<div class="legend">
73+
<div><?php echo $this->t('{proxystatistics:Proxystatistics:templates/identityProviders_legend}'); ?></div>
74+
</div>
7275
<div class="row">
7376
<div class="col-md-8">
7477
<div id="idpsChartDetail" ></div>

templates/serviceProviders-tpl.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ function drawSpsTable() {
6969
</div>
7070

7171
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_service_providers}'); ?></h2>
72+
<div class="legend">
73+
<div><?php echo $this->t('{proxystatistics:Proxystatistics:templates/serviceProviders_legend}'); ?></div>
74+
</div>
7275
<div class="row">
7376
<div class="col-md-8">
7477
<div id="spsChartDetail" ></div>

templates/statistics-tpl.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@
44
* @author Pavel Vyskočil <vyskocilpavel@muni.cz>
55
* @author Dominik Baránek <0Baranek.dominik0@gmail.com>
66
*/
7-
$this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/statistics_header}');
7+
const CONFIG_FILE_NAME = 'config.php';
8+
const INSTANCE_NAME = 'instance_name';
9+
10+
$config = SimpleSAML_Configuration::getConfig(CONFIG_FILE_NAME);
11+
$instanceName = $config->getString(INSTANCE_NAME, null);
12+
if (!is_null($instanceName)) {
13+
$this->data['header'] = $instanceName . ' ' . $this->t('{proxystatistics:Proxystatistics:templates/statistics_header}');
14+
} else {
15+
$this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/statistics_header}');
16+
SimpleSAML\Logger::warning('Missing configuration: config.php - instance_name is not set.');
17+
}
818

919
$this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
1020
$this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="' . SimpleSAML\Module::getModuleUrl('proxystatistics/statisticsproxy.css') . '" />';

templates/summary-tpl.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ function drawSpsChart() {
105105
</div>
106106

107107
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_logins}'); ?></h2>
108+
<div class="legend-logins">
109+
<div>
110+
<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_logins_info}'); ?>
111+
</div>
112+
</div>
108113
<div id="loginsDashboard" >
109114
<div id="line_div"></div>
110115
<div id="control_div"></div>
@@ -113,10 +118,20 @@ function drawSpsChart() {
113118
<div class="row tableMaxHeight">
114119
<div class="col-md-6 graph">
115120
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_id_providers}'); ?></h2>
121+
<div class="legend">
122+
<div id="summaryIdp">
123+
<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_idps_info}'); ?>
124+
</div>
125+
</div>
116126
<div id="idpsChart" ></div>
117127
</div>
118128
<div class="col-md-6">
119129
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_service_providers}'); ?></h2>
130+
<div class="legend">
131+
<div>
132+
<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_sps_info}'); ?>
133+
</div>
134+
</div>
120135
<div id="spsChart" ></div>
121136
</div>
122137
</div>

www/statisticsproxy.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,23 @@ table{
4343
font-weight: normal;
4444
}
4545

46+
#summaryIdp {
47+
padding-bottom: 20px;
48+
}
49+
4650
.tabset_tabs {
4751
padding-left: 20px;
4852
}
4953

5054
.timeRange {
5155
padding-left: 40px;
5256
}
57+
58+
.legend-logins {
59+
padding-left: 40px;
60+
}
61+
62+
.legend {
63+
padding-left: 40px;
64+
padding-bottom: 20px;
65+
}

0 commit comments

Comments
 (0)