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

Commit 7287409

Browse files
tauceti2vyskocilpavel
authored andcommitted
Merge pull request #1 from BaranekD/v1.1
Dictionary and Czech translation added
1 parent b741de0 commit 7287409

File tree

9 files changed

+340
-201
lines changed

9 files changed

+340
-201
lines changed

CHANGELOG.md

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

44
## [Unreleased]
5+
[Added]
56
- Classes SimpleSAML_Logger and SimpleSAML_Module renamed to SimpleSAML\Logger and SimpleSAML\Module
7+
- Dictionary
8+
- Czech translation
69

710
## [v1.1.0]
811
[Added]
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"summary": {
3+
"en": "Summary",
4+
"cs": "Shrnutí"
5+
},
6+
"templates/statistics-tpl_graphs": {
7+
"en": "Graphs",
8+
"cs": "Grafy"
9+
},
10+
"templates/statistics-tpl_tables": {
11+
"en": "Tables",
12+
"cs": "Tabulky"
13+
},
14+
"templates/summary_overall_logins": {
15+
"en": "Overall number of logins",
16+
"cs": "Celkový počet přihlášení"
17+
},
18+
"templates/summary_accessed_providers": {
19+
"en": "Total number of accessed service providers",
20+
"cs": "Celkový počet používaných služeb"
21+
},
22+
"templates/summary_used_identity_providers": {
23+
"en": "Total number of used identity providers",
24+
"cs": "Celkový počet použitých poskytovatelů identit"
25+
},
26+
"templates/summary_logins_today": {
27+
"en": "Number of logins for today",
28+
"cs": "Počet přihlášení během dnešního dne"
29+
},
30+
"templates/summary_average_logins": {
31+
"en": "Average number of logins per day",
32+
"cs": "Průměrný počet přihlášení za den"
33+
},
34+
"templates/summary_max_logins": {
35+
"en": "Maximal number of logins per day",
36+
"cs": "Maximální počet přihlášení za den"
37+
},
38+
"templates/summary_name": {
39+
"en": "Name",
40+
"cs": "Jméno"
41+
},
42+
"templates/count": {
43+
"en": "Count",
44+
"cs": "Počet"
45+
},
46+
"templates/graphs_logins": {
47+
"en": "Number of logins",
48+
"cs": "Počet přihlášení"
49+
},
50+
"templates/graphs_id_providers": {
51+
"en": "Identity providers",
52+
"cs": "Poskytovatelé identit"
53+
},
54+
"templates/graphs_service_providers": {
55+
"en": "Service providers",
56+
"cs": "Poskytovatelé služeb"
57+
},
58+
"templates/logins_day": {
59+
"en": "Number of logins per day",
60+
"cs": "Počet přihlášení za den"
61+
},
62+
"templates/logins_identity": {
63+
"en": "Overall logins per identity provider",
64+
"cs": "Počet přihlášení podle poskytovatele identity"
65+
},
66+
"templates/logins_service": {
67+
"en": "Overall logins to service providers",
68+
"cs": "Počet přihlášení ke službám"
69+
},
70+
"templates/tables_date": {
71+
"en": "Date",
72+
"cs": "Datum"
73+
},
74+
"templates/tables_month": {
75+
"en": "Month",
76+
"cs": "Měsíc"
77+
},
78+
"templates/tables_identity_provider": {
79+
"en": "Identity provider",
80+
"cs": "Poskytovatel identity"
81+
},
82+
"templates/tables_service_provider": {
83+
"en": "Service provider",
84+
"cs": "Služba"
85+
},
86+
"templates/statistics_header": {
87+
"en": "SimpleSAMLphp Statistics",
88+
"cs": "SimpleSAMLphp Statistiky"
89+
}
90+
}

templates/graphs-tpl.php

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
<?php
2+
include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
3+
4+
/**
5+
* @author Pavel Vyskočil <[email protected]>
6+
* @author Dominik Baránek <[email protected]>
7+
*/
8+
9+
?>
10+
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_logins}'); ?></h2>
11+
<div>
12+
<script type="text/javascript">
13+
google.charts.load('current', {'packages':['corechart', 'controls']});
14+
google.charts.setOnLoadCallback(drawChart);
15+
16+
function drawChart() {
17+
var data = google.visualization.arrayToDataTable([
18+
['Date', 'Count'],
19+
<?php DatabaseCommand::getLoginCountPerDay()?>
20+
]);
21+
22+
var dashboard = new google.visualization.Dashboard(
23+
document.getElementById('dashboard_div'));
24+
25+
var chartRangeFilter=new google.visualization.ControlWrapper({
26+
'controlType': 'ChartRangeFilter',
27+
'containerId': 'control_div',
28+
'options': {
29+
'filterColumnLabel': 'Date'
30+
}
31+
});
32+
33+
var chart = new google.visualization.ChartWrapper({
34+
'chartType' : 'LineChart',
35+
'containerId' : 'line_div',
36+
'options':{
37+
'title' :'<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_day}'); ?>',
38+
'legend' : 'none'
39+
}
40+
});
41+
42+
43+
dashboard.bind(chartRangeFilter, chart);
44+
dashboard.draw(data);
45+
}
46+
</script>
47+
48+
<div id="dashboard_div" style="width: 900px; height: 600px">
49+
<div id="line_div" style="width: 900px; height: 550px"></div>
50+
<div id="control_div" style="width: 900px; height: 50px"></div>
51+
</div>
52+
53+
</div>
54+
55+
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_id_providers}'); ?></h2>
56+
<div>
57+
<script type="text/javascript">
58+
google.charts.load('current', {'packages':['corechart']});
59+
google.charts.setOnLoadCallback(drawChart);
60+
61+
function drawChart() {
62+
63+
var data = google.visualization.arrayToDataTable([
64+
['sourceIdp', 'Count'],
65+
<?php DatabaseCommand::getLoginCountPerIdp()?>
66+
]);
67+
68+
var options = {
69+
title: '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_identity}'); ?>',
70+
pieSliceText: 'value'
71+
};
72+
73+
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
74+
75+
data.sort([{column: 1, desc: true}]);
76+
chart.draw(data, options);
77+
}
78+
</script>
79+
<div id="piechart" style="width: 900px; height: 500px;"></div>
80+
</div>
81+
82+
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_service_providers}'); ?></h2>
83+
<div>
84+
<script type="text/javascript">
85+
google.charts.load('current', {'packages':['corechart']});
86+
google.charts.setOnLoadCallback(drawChart);
87+
88+
function drawChart() {
89+
90+
var data = google.visualization.arrayToDataTable([
91+
['service', 'Count'],
92+
<?php DatabaseCommand::getAccessCountPerService()?>
93+
]);
94+
95+
var options = {
96+
title: '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_service}'); ?>',
97+
pieSliceText: 'value'
98+
};
99+
100+
var chart = new google.visualization.PieChart(document.getElementById('piechart2'));
101+
102+
data.sort([{column: 1, desc: true}]);
103+
chart.draw(data, options);
104+
}
105+
</script>
106+
<div id="piechart2" style="width: 900px; height: 500px;"></div>
107+
</div>

templates/statistics-tpl.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
33
/**
44
* @author Pavel Vyskočil <[email protected]>
5+
* @author Dominik Baránek <[email protected]>
56
*/
6-
$this->data['header'] = 'SimpleSAMLphp Statistics';
7+
$this->data['header'] = $this->t('{proxystatistics:Proxystatistics:templates/statistics_header}');
78

89
$this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
910
$this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="' . SimpleSAML\Module::getModuleUrl('proxystatistics/statisticsproxy.css') . '" />';
@@ -18,9 +19,9 @@
1819
?>
1920
<div id="tabdiv">
2021
<ul class="tabset_tabs" width="100px">
21-
<li><a href='summary.php'>Summary</a></li>
22-
<li><a href='graphs.php'>Graphs</a></li>
23-
<li><a href='tables.php'>Tables</a></li>
22+
<li><a href='summary.php'><?php echo $this->t('{proxystatistics:Proxystatistics:summary}'); ?></a></li>
23+
<li><a href='graphs.php'><?php echo $this->t('{proxystatistics:Proxystatistics:templates/statistics-tpl_graphs}'); ?></a></li>
24+
<li><a href='tables.php'><?php echo $this->t('{proxystatistics:Proxystatistics:templates/statistics-tpl_tables}'); ?></a></li>
2425
</ul>
2526

2627
</div>

templates/summary-tpl.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
3+
/**
4+
* @author Pavel Vyskočil <[email protected]>
5+
* @author Dominik Baránek <[email protected]>
6+
*/
7+
?>
8+
<link rel="stylesheet" media="screen" type="text/css" href="<?php SimpleSAML\Module::getModuleUrl('proxystatistics/statisticsproxy.css')?>" />
9+
10+
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:summary}'); ?></h2>
11+
<div id="summary" >
12+
<script type="text/javascript">
13+
google.charts.load('current', {'packages':['table']});
14+
google.charts.setOnLoadCallback(drawTable);
15+
16+
function drawTable() {
17+
var data = new google.visualization.DataTable();
18+
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_name}'); ?>');
19+
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
20+
data.addRows([
21+
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_overall_logins}'); ?>', <?php DatabaseCommand::getCountOfAllLogins()?> ],
22+
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_accessed_providers}'); ?>', <?php DatabaseCommand::getCountOfAccesedServices()?>],
23+
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_used_identity_providers}'); ?>', <?php DatabaseCommand::getCountOfUsedIdp()?>],
24+
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_logins_today}'); ?>', <?php DatabaseCommand::getCountOfAllLoginsForToday()?>],
25+
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_average_logins}'); ?>', <?php DatabaseCommand::getAverageLoginCountPerDay()?>],
26+
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_max_logins}'); ?>', <?php DatabaseCommand::getMaxLoginCountPerDay()?>]
27+
]);
28+
29+
var table = new google.visualization.Table(document.getElementById('summaryTable'));
30+
31+
table.draw(data, {showRowNumber: false, width: '80%', height: '300px'});
32+
}
33+
</script>
34+
35+
<div id="summaryTable" ></div>
36+
</div>

templates/tables-tpl.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
3+
/**
4+
* @author Pavel Vyskočil <[email protected]>
5+
* @author Dominik Baránek <[email protected]>
6+
*/
7+
?>
8+
<link rel="stylesheet" media="screen" type="text/css" href="<?php SimpleSAML_Module::getModuleUrl('proxystatistics/statisticsproxy.css')?>" />
9+
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_day}'); ?></h2>
10+
<div id="tableOfAllLogin">
11+
<script type="text/javascript">
12+
google.charts.load('current', {'packages':['table']});
13+
google.charts.setOnLoadCallback(drawTable);
14+
15+
function drawTable() {
16+
var data = new google.visualization.DataTable();
17+
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_date}'); ?>');
18+
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
19+
data.addRows([<?php DatabaseCommand::getLoginCountPerDay()?>]);
20+
21+
var table = new google.visualization.Table(document.getElementById('tableOfAllLogin'));
22+
23+
var formatter = new google.visualization.DateFormat({pattern:"d MMMM yyyy"});
24+
formatter.format(data, 0); // Apply formatter to second column
25+
26+
table.draw(data, {showRowNumber: false, width: '60%', height: '300px'});
27+
}
28+
</script>
29+
30+
<div id="tableOfAllLogin" ></div>
31+
</div>
32+
33+
34+
35+
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_identity}'); ?></h2>
36+
<div>
37+
<script type="text/javascript">
38+
google.charts.load('current', {'packages':['table']});
39+
google.charts.setOnLoadCallback(drawTable);
40+
41+
function drawTable() {
42+
var data = new google.visualization.DataTable();
43+
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>');
44+
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_identity_provider}'); ?>');
45+
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
46+
data.addRows([<?php DatabaseCommand::getLoginCountPerDeyPerService()?>]);
47+
48+
var table = new google.visualization.Table(document.getElementById('tablePerIdP'));
49+
50+
var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"});
51+
formatter.format(data, 0); // Apply formatter to second column
52+
53+
table.draw(data, {showRowNumber: false, width: '100%', height: '300px'});
54+
}
55+
</script>
56+
57+
<div id="tablePerIdP"></div>
58+
</div>
59+
60+
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_service}'); ?></h2>
61+
<div>
62+
<script type="text/javascript">
63+
google.charts.load('current', {'packages':['table']});
64+
google.charts.setOnLoadCallback(drawTable);
65+
66+
function drawTable() {
67+
var data = new google.visualization.DataTable();
68+
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>');
69+
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_service_provider}'); ?>');
70+
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
71+
data.addRows([<?php DatabaseCommand::getAccessToServicesPerMonth()?>]);
72+
73+
var table = new google.visualization.Table(document.getElementById('accessToServices'));
74+
75+
var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"});
76+
formatter.format(data, 0); // Apply formatter to second column
77+
78+
table.draw(data, {showRowNumber: false, width: '100%', height: '300px'});
79+
}
80+
</script>
81+
82+
<div id="accessToServices"></div>
83+
</div>
84+

0 commit comments

Comments
 (0)