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

Commit f26a7a2

Browse files
author
Dominik František Bučík
authored
Merge pull request #49 from CESNET/chartjs3
chore(deps): update Chart.js to 3.5.1
2 parents 2e02943 + bfabef2 commit f26a7a2

28 files changed

+153
-243
lines changed

config-templates/module_proxystatistics.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
/**
66
* This is an example configuration of SimpleSAMLphp Perun interface and additional features. Copy this file to default
77
* config directory and edit the properties.
8-
*
9-
* @author Pavel Vyskočil <vyskocilpavel@muni.cz>
10-
* @author Pavel Břoušek <brousek@ics.muni.cz>
118
*/
129

1310
$config = [

hooks/hook_cron.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Hook to run a cron job.
1010
*
1111
* @param array $croninfo Output
12-
* @author Pavel Břoušek <brousek@ics.muni.cz>
1312
*/
1413
function proxystatistics_hook_cron(&$croninfo)
1514
{

lib/Auth/Process/Statistics.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* @author Pavel Vyskočil <vyskocilpavel@muni.cz>
7-
* @author Pavel Břoušek <brousek@ics.muni.cz>
8-
*/
9-
105
namespace SimpleSAML\Module\proxystatistics\Auth\Process;
116

127
use DateTime;

lib/Config.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* @author Pavel Břoušek <brousek@ics.muni.cz>
7-
*/
8-
95
namespace SimpleSAML\Module\proxystatistics;
106

117
use SimpleSAML\Configuration;

lib/DatabaseCommand.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* @author Pavel Vyskočil <vyskocilpavel@muni.cz>
7-
* @author Pavel Břoušek <brousek@ics.muni.cz>
8-
*/
9-
105
namespace SimpleSAML\Module\proxystatistics;
116

127
use PDO;

lib/Templates.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
<?php declare(strict_types=1);
22

3-
/**
4-
* @author Pavel Břoušek <brousek@ics.muni.cz>
5-
* @author Pavel Vyskočil <vyskocilpavel@muni.cz>
6-
*/
7-
83
namespace SimpleSAML\Module\proxystatistics;
94

105
use SimpleSAML\Auth\Simple;
@@ -34,7 +29,7 @@ public static function pieChart($id)
3429
<div class="canvas-container col-md-7">
3530
<canvas id="<?php echo $id; ?>" class="pieChart chart-<?php echo $id; ?>"></canvas>
3631
</div>
37-
<div class="legend-container col-md-5"></div>
32+
<div class="legend-container col-md-5" id="legend-container"></div>
3833
</div>
3934
<?php
4035
}
@@ -92,6 +87,9 @@ public static function showDetail($side)
9287

9388
$translations = [
9489
'count' => $t->t('{proxystatistics:stats:count}'),
90+
'other' => $t->t('{proxystatistics:stats:other}'),
91+
'of_logins' => $t->t('{proxystatistics:stats:of_logins}'),
92+
'of_users' => $t->t('{proxystatistics:stats:of_users}'),
9593
];
9694
foreach (Config::SIDES as $s) {
9795
$translations['tables_' . $s] = $t->t('{proxystatistics:stats:side_' . $s . '}');
@@ -262,20 +260,16 @@ private static function headIncludes($t)
262260
self::getFullUrl('assets/css/bootstrap.min.css') . '" />';
263261
$t->data['head'] .= '<link rel="stylesheet" media="screen" type="text/css" href="' .
264262
self::getFullUrl('assets/css/statisticsproxy.css') . '" />';
265-
$t->data['head'] .= '<link rel="stylesheet" type="text/css" href="' .
266-
self::getFullUrl('assets/css/Chart.min.css') . '">';
267263
$t->data['head'] .= '<script type="text/javascript" src="' .
268-
self::getFullUrl('assets/js/moment.min.js') . '"></script>';
269-
if ($t->getLanguage() === 'cs') {
270-
$t->data['head'] .= '<script type="text/javascript" src="' .
271-
self::getFullUrl('assets/js/moment.cs.min.js') . '"></script>';
272-
}
264+
self::getFullUrl('assets/js/moment-with-locales.min.js') . '"></script>';
273265
$t->data['head'] .= '<script type="text/javascript" src="' .
274-
self::getFullUrl('assets/js/Chart.min.js') . '"></script>';
266+
self::getFullUrl('assets/js/chart.min.js') . '"></script>';
275267
$t->data['head'] .= '<script type="text/javascript" src="' .
276268
self::getFullUrl('assets/js/hammer.min.js') . '"></script>';
277269
$t->data['head'] .= '<script type="text/javascript" src="' .
278270
self::getFullUrl('assets/js/chartjs-plugin-zoom.min.js') . '"></script>';
271+
$t->data['head'] .= '<script type="text/javascript" src="' .
272+
self::getFullUrl('assets/js/chartjs-adapter-moment.js') . '"></script>';
279273
$t->data['head'] .= '<script type="text/javascript" src="' .
280274
self::getFullUrl('assets/js/index.js') . '"></script>';
281275

lib/Utils.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
declare(strict_types=1);
44

5-
/**
6-
* @author Pavel Břoušek <brousek@ics.muni.cz>
7-
*/
8-
95
namespace SimpleSAML\Module\proxystatistics;
106

117
class Utils

templates/detail-tpl.php

Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,41 @@
11
<?php declare(strict_types=1);
22

3-
/**
4-
* @author Pavel Břoušek <brousek@ics.muni.cz>
5-
*/
6-
73
use SimpleSAML\Module\proxystatistics\Templates;
84

95
$this->includeAtTemplateBase('includes/header.php');
106
?>
11-
</head>
12-
<body>
13-
<div class="go-to-stats-btn">
14-
<a href="./" class="btn btn-md btn-default">
15-
<span class="glyphicon glyphicon-home"></span>
16-
<?php echo $this->t('{proxystatistics:stats:back_to_stats}'); ?>
17-
</a>
7+
<div class="go-to-stats-btn">
8+
<a href="./" class="btn btn-md btn-default">
9+
<span class="glyphicon glyphicon-home"></span>
10+
<?php echo $this->t('{proxystatistics:stats:back_to_stats}'); ?>
11+
</a>
12+
</div>
13+
<?php Templates::timeRange([
14+
'side' => $this->data['side'],
15+
'id' => $this->data['id'],
16+
]); ?>
17+
<h3><?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_dashboard_header}'); ?></h3>
18+
<div class="legend">
19+
<div>
20+
<?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_dashboard_legend}'); ?>
1821
</div>
19-
<?php Templates::timeRange([
20-
'side' => $this->data['side'],
21-
'id' => $this->data['id'],
22-
]); ?>
23-
<h3><?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_dashboard_header}'); ?></h3>
22+
</div>
23+
<?php Templates::loginsDashboard(); ?>
24+
<div class="<?php echo $this->data['detailGraphClass'] ?>">
25+
<h3><?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_graph_header}'); ?></h3>
2426
<div class="legend">
2527
<div>
26-
<?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_dashboard_legend}'); ?>
28+
<?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_graph_legend}'); ?>
2729
</div>
2830
</div>
29-
<?php Templates::loginsDashboard(); ?>
30-
<div class="<?php echo $this->data['detailGraphClass'] ?>">
31-
<h3><?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_graph_header}'); ?></h3>
32-
<div class="legend">
33-
<div>
34-
<?php echo $this->t('{proxystatistics:stats:' . $this->data['side'] . 'Detail_graph_legend}'); ?>
35-
</div>
31+
<div class="row">
32+
<div class="col-md-8">
33+
<?php Templates::pieChart('detail' . $this->data['other_side'] . 'Chart'); ?>
3634
</div>
37-
<div class="row">
38-
<div class="col-md-8">
39-
<?php Templates::pieChart('detail' . $this->data['other_side'] . 'Chart'); ?>
40-
</div>
41-
<div class="col-md-4">
42-
<div id="detail<?php echo $this->data['other_side']; ?>Table" class="table-container"></div>
43-
</div>
35+
<div class="col-md-4">
36+
<div id="detail<?php echo $this->data['other_side']; ?>Table" class="table-container"></div>
4437
</div>
4538
</div>
46-
</body>
39+
</div>
4740
<?php
4841
$this->includeAtTemplateBase('includes/footer.php');

templates/index-tpl.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
<?php declare(strict_types=1);
1+
<?php
22

3-
/**
4-
* @author Pavel Břoušek <brousek@ics.muni.cz>
5-
*/
3+
declare(strict_types=1);
64

75
use SimpleSAML\Module\proxystatistics\Config;
86

97
$this->includeAtTemplateBase('includes/header.php');
108
?>
119

12-
<div id="tabdiv" data-activetab="<?php echo htmlspecialchars($this->data['tab']); ?>">
10+
<div id="tabdiv" data-activetab="<?php echo htmlspecialchars(strval($this->data['tab'])); ?>">
1311
<ul class="tabset_tabs" width="100px">
1412
<li>
1513
<a <?php echo $this->data['tabsAttributes']['PROXY'] ?>>

templates/loginsDashboard-tpl.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
<?php declare(strict_types=1);
22

3-
/**
4-
* @author Pavel Břoušek <brousek@ics.muni.cz>
5-
*/
6-
73
?>
84

95
<div class="canvas-container">
10-
<canvas id="loginsDashboard"<?php echo $this->getLanguage() === 'cs' ? ' data-locale="cs"' : ''; ?>
11-
height="250"></canvas>
6+
<canvas id="loginsDashboard" data-locale="<?php echo $this->getLanguage(); ?>" height="250"></canvas>
127
</div>

0 commit comments

Comments
 (0)