]> git.mxchange.org Git - friendica.git/blob - view/templates/admin/federation.tpl
Merge pull request #4692 from Rudloff/patch-1
[friendica.git] / view / templates / admin / federation.tpl
1 <script src="{{$baseurl}}/view/asset/Chart-js/dist/Chart.min.js"></script>
2 <div id="adminpage">
3         <h1>{{$title}} - {{$page}}</h1>
4
5         <canvas id="FederationChart" class="federation-graph" width="320" height="320"></canvas>
6         <p>{{$intro}}</p>
7
8         {{if not $autoactive}}
9         <p class="error-message">{{$hint}}</p>
10         {{/if}}
11
12         <p>{{$legendtext}}</p>
13
14         <ul>
15                 {{foreach $counts as $c}}
16                         {{if $c[0]['total'] > 0}}
17                         <li>{{$c[0]['platform']}} ({{$c[0]['total']}}/{{$c[0]['users']}})</li>
18                         {{/if}}
19                 {{/foreach}}
20         </ul>
21
22         <script>
23         var FedData = {
24                 datasets: [{
25                         data: [
26                                 {{foreach $counts as $c}}
27                                         {{$c[0]['total']}},
28                                 {{/foreach}}
29                         ],
30                         backgroundColor: [
31                                 {{foreach $counts as $c}}
32                                         '{{$c[3]}}',
33                                 {{/foreach}}
34                                 ],
35                         hoverBackgroundColor: [
36                                 {{foreach $counts as $c}}
37                                         '#EE90A1',
38                                 {{/foreach}}
39                         ]
40                 }],
41                 labels: [
42                         {{foreach $counts as $c}}
43                                 "{{$c[0]['platform']}}",
44                         {{/foreach}}
45                 ]
46         };
47         var ctx = document.getElementById("FederationChart").getContext("2d");
48         var myDoughnutChart = new Chart(ctx, {
49                 type: 'doughnut',
50                 data: FedData,
51                 options: {
52                     legend: {display: false},
53                     animation: {animateRotate: false},
54                     responsive: false
55                 }
56         });
57         </script>
58
59         <table id="federation-stats">
60         {{foreach $counts as $c}}
61                 {{if $c[0]['total'] > 0}}
62                 <tr>
63                         <th>{{$c[0]['platform']}}</th>
64                         <th><strong>{{$c[0]['total']}}</strong></td>
65                         <td>{{$c[0]['network']}}</td>
66                 </tr>
67                 <tr>
68                         <td colspan="3" class="federation-data">
69                                 <canvas id="{{$c[2]}}Chart" class="federation-network-graph" width="240" height="240"></canvas>
70                                 <script>
71                                         var {{$c[2]}}data = {
72                                                 datasets: [{
73                                                         data: [
74                                                         {{foreach $c[1] as $v}}
75                                                                 {{$v['total']}},
76                                                         {{/foreach}}
77                                                         ],
78                                                         backgroundColor: [
79                                                         {{foreach $c[1] as $v}}
80                                                                 '{{$c[3]}}',
81                                                         {{/foreach}}
82                                                         ],
83                                                         hoverBackgroundColor: [
84                                                         {{foreach $c[1] as $v}}
85                                                                 '#EE90A1',
86                                                         {{/foreach}}
87                                                         ]
88                                                 }],
89                                                 labels: [
90                                                         {{foreach $c[1] as $v}}
91                                                                 '{{$v['version']}}',
92                                                         {{/foreach}}
93                                                 ]
94                                         };
95                                         var ctx = document.getElementById("{{$c[2]}}Chart").getContext("2d");
96                                         var my{{$c[2]}}DoughnutChart = new Chart(ctx, {
97                                                 type: 'doughnut',
98                                                 data: {{$c[2]}}data,
99                                                 options: {
100                                                 legend: {display: false},
101                                                         animation: {animateRotate: false},
102                                                         responsive: false
103                                                 }
104                                         });
105                                 </script>
106                                 <ul class="federation-stats">
107                                 {{foreach $c[1] as $v}}
108                                         <li>
109                                                 {{if ($c[0]['platform']==='Friendica' and  $version===$v['version']) }}
110                                                 <span class="version-match">{{$v['version']}}</span>
111                                                 {{else}}
112                                                 {{$v['version']}}
113                                                 {{/if}}
114                                                 ({{$v['total']}})
115                                         </li>
116                                 {{/foreach}}
117                                 </ul>
118                         </td>
119                 </tr>
120                 {{/if}}
121         {{/foreach}}
122         </table>
123 </div>