|
10 | 10 | $this->data['header'] = ''; |
11 | 11 | $this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="' . |
12 | 12 | Module::getModuleUrl('perun/res/css/listOfSps.css') . '" />'; |
13 | | -$this->includeAtTemplateBase('includes/header.php'); |
| 13 | + |
| 14 | +$this->data['head'] .= '<meta name="translations" id="translations" content="'.htmlspecialchars(json_encode([ |
| 15 | + 'saml_production' => $this->t('{perun:listOfSps:saml_production}'), |
| 16 | + 'saml_test' => $this->t('{perun:listOfSps:saml_test}'), |
| 17 | + 'oidc_production' => $this->t('{perun:listOfSps:oidc_production}'), |
| 18 | + 'oidc_test' => $this->t('{perun:listOfSps:oidc_test}'), |
| 19 | +])).'">'; |
14 | 20 |
|
15 | 21 | $statistics = $this->data['statistics']; |
16 | 22 | $attributesToShow = $this->data['attributesToShow']; |
|
24 | 30 | $testServicesCount = $statistics['samlTestServicesCount'] + $statistics['oidcTestServicesCount']; |
25 | 31 | $samlProductionCount = $statistics['samlServicesCount'] - $statistics['samlTestServicesCount']; |
26 | 32 | $oidcProductionCount = $statistics['oidcServicesCount'] - $statistics['oidcTestServicesCount']; |
| 33 | + |
| 34 | +$this->data['head'] .= '<meta name="data" id="data" content="'.htmlspecialchars(json_encode([ |
| 35 | + 'samlProductionCount' => $samlProductionCount, |
| 36 | + 'samlTestServicesCount' => $statistics['samlTestServicesCount'], |
| 37 | + 'oidcProductionCount' => $oidcProductionCount, |
| 38 | + 'oidcTestServicesCount' => $statistics['oidcTestServicesCount'], |
| 39 | +])).'">'; |
| 40 | + |
| 41 | +$this->includeAtTemplateBase('includes/header.php'); |
27 | 42 | ?> |
28 | 43 |
|
29 | 44 | <div class="row"> |
@@ -199,65 +214,4 @@ function getClass($attribute) |
199 | 214 |
|
200 | 215 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.bundle.js"></script> |
201 | 216 |
|
202 | | -<script> |
203 | | - var ctx = document.getElementById("myChart").getContext('2d'); |
204 | | - var myChart = new Chart(ctx, { |
205 | | - type: 'bar', |
206 | | - data: { |
207 | | - labels: [ |
208 | | - <?php echo |
209 | | - '"' . $this->t('{perun:listOfSps:saml_production}') . '"' . ", " . |
210 | | - '"' . $this->t('{perun:listOfSps:saml_test}') . '"' . ", " . |
211 | | - '"' . $this->t('{perun:listOfSps:oidc_production}') . '"' . ", " . |
212 | | - '"' . $this->t('{perun:listOfSps:oidc_test}') . '"' |
213 | | - ?> |
214 | | - ], |
215 | | - datasets: [{ |
216 | | - label: '', |
217 | | - data: [ |
218 | | - <?php echo |
219 | | - $samlProductionCount . ', ' . $statistics['samlTestServicesCount'] . |
220 | | - ', ' . $oidcProductionCount . ', ' . $statistics['oidcTestServicesCount'] |
221 | | - ?> |
222 | | - ], |
223 | | - backgroundColor: [ |
224 | | - 'rgba(255, 99, 132, 0.2)', |
225 | | - 'rgba(54, 162, 235, 0.2)', |
226 | | - 'rgba(255, 206, 86, 0.2)', |
227 | | - 'rgba(75, 192, 192, 0.2)' |
228 | | - ], |
229 | | - borderColor: [ |
230 | | - 'rgba(255,99,132,1)', |
231 | | - 'rgba(54, 162, 235, 1)', |
232 | | - 'rgba(255, 206, 86, 1)', |
233 | | - 'rgba(75, 192, 192, 1)' |
234 | | - ], |
235 | | - borderWidth: 1 |
236 | | - }] |
237 | | - }, |
238 | | - options: { |
239 | | - scales: { |
240 | | - yAxes: [{ |
241 | | - ticks: { |
242 | | - beginAtZero: true, |
243 | | - callback: function (value) { |
244 | | - if (Number.isInteger(value)) { |
245 | | - return value; |
246 | | - } |
247 | | - } |
248 | | - } |
249 | | - }] |
250 | | - }, |
251 | | - legend: { |
252 | | - display: false |
253 | | - }, |
254 | | - tooltips: { |
255 | | - callbacks: { |
256 | | - label: function (tooltipItem) { |
257 | | - return tooltipItem.yLabel; |
258 | | - } |
259 | | - } |
260 | | - } |
261 | | - } |
262 | | - }); |
263 | | -</script> |
| 217 | +<script src="<?php echo htmlspecialchars(\SimpleSAML\Module::getModuleURL('perun/listOfSps.js'));?>"></script> |
0 commit comments