Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
StudIP-SimpleBBB-Connector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uni Vechta
Plugins
StudIP-SimpleBBB-Connector
Commits
7a964a0c
Commit
7a964a0c
authored
4 years ago
by
David Siegfried
Browse files
Options
Downloads
Patches
Plain Diff
add more stats
parent
25454a48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
controllers/statistics.php
+8
-4
8 additions, 4 deletions
controllers/statistics.php
models/Metric.php
+13
-9
13 additions, 9 deletions
models/Metric.php
views/statistics/index.php
+106
-43
106 additions, 43 deletions
views/statistics/index.php
with
127 additions
and
56 deletions
controllers/statistics.php
+
8
−
4
View file @
7a964a0c
...
@@ -20,11 +20,15 @@ class StatisticsController extends Controller
...
@@ -20,11 +20,15 @@ class StatisticsController extends Controller
Navigation
::
activateItem
(
'simplebbbconnector/statistics/index'
);
Navigation
::
activateItem
(
'simplebbbconnector/statistics/index'
);
PageLayout
::
setTitle
(
_
(
'Statistik'
));
PageLayout
::
setTitle
(
_
(
'Statistik'
));
$current_month_complete
=
Metric
::
getStatistics
(
'current_month'
);
$current_month_complete
=
Metric
::
getStatistics
(
'current_month'
);
$today_complete
=
Metric
::
getStatistics
(
'today'
);
$current_week_complete
=
Metric
::
getStatistics
(
'current_week'
);
$last_week_complete
=
Metric
::
getStatistics
(
'last_week'
);
$today_complete
=
Metric
::
getStatistics
(
'today'
);
$this
->
labels
=
json_encode
(
array_keys
(
$current_month_complete
));
$this
->
labels
=
json_encode
(
array_keys
(
$current_month_complete
));
$this
->
current_month_complete
=
json_encode
(
array_map
(
'intval'
,
array_values
(
$current_month_complete
)));
$this
->
current_month_complete
=
json_encode
(
array_map
(
'intval'
,
array_values
(
$current_month_complete
)));
$this
->
today_complete
=
json_encode
(
array_map
(
'intval'
,
array_values
(
$today_complete
)));
$this
->
current_week_complete
=
json_encode
(
array_map
(
'intval'
,
array_values
(
$current_week_complete
)));
$this
->
biggest_meetings
=
Metric
::
getStatistics
(
'current_month'
,
'all'
,
10
);
$this
->
last_week_complete
=
json_encode
(
array_map
(
'intval'
,
array_values
(
$last_week_complete
)));
$this
->
today_complete
=
json_encode
(
array_map
(
'intval'
,
array_values
(
$today_complete
)));
$this
->
biggest_meetings
=
Metric
::
getStatistics
(
'current_month'
,
'all'
,
10
);
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
models/Metric.php
+
13
−
9
View file @
7a964a0c
...
@@ -137,22 +137,26 @@ class Metric extends SimpleORMap
...
@@ -137,22 +137,26 @@ class Metric extends SimpleORMap
return
\DBManager
::
get
()
->
fetchOne
(
$sql
,
$attributes
);
return
\DBManager
::
get
()
->
fetchOne
(
$sql
,
$attributes
);
}
}
public
static
function
getBiggestMeetings
(
$filter
=
''
)
{
}
private
static
function
getFilter
(
$filter
=
''
)
private
static
function
getFilter
(
$filter
=
''
)
{
{
$result
=
[];
$result
=
[];
if
(
$filter
===
'current_month'
)
{
if
(
$filter
===
'current_month'
)
{
$result
[]
=
(
new
\DateT
ime
(
'first day of this month 00:00:00'
))
->
format
(
self
::
BBB_DATETIME_FORMAT
)
;
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtot
ime
(
'first day of this month 00:00:00'
));
$result
[]
=
(
new
\DateT
ime
(
'first day of next month 00:00:00'
))
->
format
(
self
::
BBB_DATETIME_FORMAT
)
;
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtot
ime
(
'first day of next month 00:00:00'
));
}
}
if
(
$filter
===
'today'
)
{
if
(
$filter
===
'today'
)
{
$result
[]
=
(
new
\DateTime
(
'today 00:00:00'
))
->
format
(
self
::
BBB_DATETIME_FORMAT
);
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtotime
(
'today 00:00:00'
)
);
$result
[]
=
(
new
\DateTime
(
'next day 00:00:00'
))
->
format
(
self
::
BBB_DATETIME_FORMAT
);
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtotime
(
'next day 00:00:00'
)
);
}
}
if
(
$filter
===
'current_week'
)
{
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtotime
(
'monday this week 00:00:00'
));
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtotime
(
'sunday this week 00:00:00'
));
}
if
(
$filter
===
'last_week'
)
{
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtotime
(
'monday last week 00:00:00'
));
$result
[]
=
date
(
self
::
BBB_DATETIME_FORMAT
,
strtotime
(
'sunday last week 00:00:00'
));
}
return
$result
;
return
$result
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
views/statistics/index.php
+
106
−
43
View file @
7a964a0c
...
@@ -7,7 +7,21 @@
...
@@ -7,7 +7,21 @@
<section>
<section>
<canvas
id=
"bar-chart"
style=
"width: 100%; height: 400px"
></canvas>
<canvas
id=
"bar-chart"
style=
"width: 100%; height: 400px"
></canvas>
<script>
<script>
var
ctx
=
document
.
getElementById
(
'
bar-chart
'
).
getContext
(
'
2d
'
);
var
ctx
=
document
.
getElementById
(
'
bar-chart
'
).
getContext
(
'
2d
'
)
window
.
chartColors
=
{
redDark
:
'
rgba(255, 99, 132, 0.2)
'
,
red
:
'
rgba(255, 99, 132, 1)
'
,
blueDark
:
'
rgba(54, 162, 235, 0.2)
'
,
blue
:
'
rgba(54, 162, 235, 1)
'
,
yellowDark
:
'
rgba(255, 206, 86, 0.2)
'
,
yellow
:
'
rgba(255, 206, 86, 1)
'
,
greenDark
:
'
rgba(75, 192, 192, 0.2)
'
,
green
:
'
rgba(75, 192, 192, 1)
'
,
purpleDark
:
'
rgba(153, 102, 255, 0.2)
'
,
purple
:
'
rgba(153, 102, 255, 1)
'
,
brownDark
:
'
rgba(255, 159, 64, 0.2)
'
,
brown
:
'
rgba(255, 159, 64, 1)
'
};
var
myChart
=
new
Chart
(
ctx
,
{
var
myChart
=
new
Chart
(
ctx
,
{
type
:
'
bar
'
,
type
:
'
bar
'
,
data
:
{
data
:
{
...
@@ -16,43 +30,92 @@
...
@@ -16,43 +30,92 @@
label
:
'
#
<?=
strftime
(
'%B'
)
?>
'
,
label
:
'
#
<?=
strftime
(
'%B'
)
?>
'
,
data
:
<?=
$current_month_complete
?>
,
data
:
<?=
$current_month_complete
?>
,
backgroundColor
:
[
backgroundColor
:
[
'
rgba(255, 99, 132, 0.2)
'
,
window
.
chartColors
.
redDark
,
'
rgba(54, 162, 235, 0.2)
'
,
window
.
chartColors
.
redDark
,
'
rgba(255, 206, 86, 0.2)
'
,
window
.
chartColors
.
redDark
,
'
rgba(75, 192, 192, 0.2)
'
,
window
.
chartColors
.
redDark
,
'
rgba(153, 102, 255, 0.2)
'
,
window
.
chartColors
.
redDark
,
'
rgba(255, 159, 64, 0.2)
'
window
.
chartColors
.
redDark
,
window
.
chartColors
.
redDark
,
],
],
borderColor
:
[
borderColor
:
[
'
rgba(255, 99, 132, 1)
'
,
window
.
chartColors
.
red
,
'
rgba(54, 162, 235, 1)
'
,
window
.
chartColors
.
red
,
'
rgba(255, 206, 86, 1)
'
,
window
.
chartColors
.
red
,
'
rgba(75, 192, 192, 1)
'
,
window
.
chartColors
.
red
,
'
rgba(153, 102, 255, 1)
'
,
window
.
chartColors
.
red
,
'
rgba(255, 159, 64, 1)
'
window
.
chartColors
.
red
,
window
.
chartColors
.
red
,
],
],
borderWidth
:
1
borderWidth
:
1
},
{
},
{
label
:
'
#
<?=
_
(
'Heute'
)
?>
'
,
label
:
'
#
<?=
_
(
'Heute'
)
?>
'
,
data
:
<?=
$today_complete
?>
,
data
:
<?=
$today_complete
?>
,
backgroundColor
:
[
backgroundColor
:
[
'
rgba(255, 99, 132, 0.2)
'
,
window
.
chartColors
.
blueDark
,
'
rgba(54, 162, 235, 0.2)
'
,
window
.
chartColors
.
blueDark
,
'
rgba(255, 206, 86, 0.2)
'
,
window
.
chartColors
.
blueDark
,
'
rgba(75, 192, 192, 0.2)
'
,
window
.
chartColors
.
blueDark
,
'
rgba(153, 102, 255, 0.2)
'
,
window
.
chartColors
.
blueDark
,
'
rgba(255, 159, 64, 0.2)
'
window
.
chartColors
.
blueDark
,
window
.
chartColors
.
blueDark
,
],
],
borderColor
:
[
borderColor
:
[
'
rgba(255, 99, 132, 1)
'
,
window
.
chartColors
.
blue
,
'
rgba(54, 162, 235, 1)
'
,
window
.
chartColors
.
blue
,
'
rgba(255, 206, 86, 1)
'
,
window
.
chartColors
.
blue
,
'
rgba(75, 192, 192, 1)
'
,
window
.
chartColors
.
blue
,
'
rgba(153, 102, 255, 1)
'
,
window
.
chartColors
.
blue
,
'
rgba(255, 159, 64, 1)
'
window
.
chartColors
.
blue
,
window
.
chartColors
.
blue
,
],
],
borderWidth
:
1
borderWidth
:
1
}]
},
{
label
:
'
#
<?=
_
(
'Diese Woche'
)
?>
'
,
data
:
<?=
$current_week_complete
?>
,
backgroundColor
:
[
window
.
chartColors
.
greenDark
,
window
.
chartColors
.
greenDark
,
window
.
chartColors
.
greenDark
,
window
.
chartColors
.
greenDark
,
window
.
chartColors
.
greenDark
,
window
.
chartColors
.
greenDark
,
window
.
chartColors
.
greenDark
,
],
borderColor
:
[
window
.
chartColors
.
green
,
window
.
chartColors
.
green
,
window
.
chartColors
.
green
,
window
.
chartColors
.
green
,
window
.
chartColors
.
green
,
window
.
chartColors
.
green
,
window
.
chartColors
.
green
,
],
borderWidth
:
1
},
{
label
:
'
#
<?=
_
(
'Letzte Woche'
)
?>
'
,
data
:
<?=
$last_week_complete
?>
,
backgroundColor
:
[
window
.
chartColors
.
yellowDark
,
window
.
chartColors
.
yellowDark
,
window
.
chartColors
.
yellowDark
,
window
.
chartColors
.
yellowDark
,
window
.
chartColors
.
yellowDark
,
window
.
chartColors
.
yellowDark
,
window
.
chartColors
.
yellowDark
,
],
borderColor
:
[
window
.
chartColors
.
yellow
,
window
.
chartColors
.
yellow
,
window
.
chartColors
.
yellow
,
window
.
chartColors
.
yellow
,
window
.
chartColors
.
yellow
,
window
.
chartColors
.
yellow
,
window
.
chartColors
.
yellow
,
],
borderWidth
:
1
}
]
},
},
options
:
{
options
:
{
scales
:
{
scales
:
{
...
@@ -68,30 +131,30 @@
...
@@ -68,30 +131,30 @@
</section>
</section>
<?
if
(
!
empty
(
$biggest_meetings
))
:
?>
<?
if
(
!
empty
(
$biggest_meetings
))
:
?>
<table
class=
"default"
>
<table
class=
"default"
>
<caption>
<?=
_
(
'Die größesten Konferezen
'
)
?>
</caption>
<caption>
<?=
sprintf
(
_
(
'Die größesten Konferezen
(im %s)'
),
strftime
(
'%B'
))
?>
</caption>
<thead>
<thead>
<tr>
<tr>
<th>
<?=
_
(
'Meeting-Name'
)
?>
</th>
<th>
<?=
_
(
'Meeting-Name'
)
?>
</th>
<th>
<?=
_
(
'Anzahl TeilnehmerInnen'
)
?>
</th>
<th>
<?=
_
(
'Anzahl TeilnehmerInnen'
)
?>
</th>
<th>
<?=
_
(
'Anzahl Video'
)
?>
</th>
<th>
<?=
_
(
'Anzahl Video'
)
?>
</th>
<th>
<?=
_
(
'Anzahl ZuhörerInnen'
)
?>
</th>
<th>
<?=
_
(
'Anzahl ZuhörerInnen'
)
?>
</th>
<th>
<?=
_
(
'Anzahl Audio'
)
?>
</th>
<th>
<?=
_
(
'Anzahl Audio'
)
?>
</th>
<th>
<?=
_
(
'Anzahl ModeratorenInnen'
)
?>
</th>
<th>
<?=
_
(
'Anzahl ModeratorenInnen'
)
?>
</th>
<th>
<?=
_
(
'Ist BreakOut-Raum'
)
?>
</th>
<th>
<?=
_
(
'Ist BreakOut-Raum'
)
?>
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<?
foreach
(
$biggest_meetings
as
$meeting
)
:
?>
<?
foreach
(
$biggest_meetings
as
$meeting
)
:
?>
<tr>
<tr>
<td>
<?=
htmlReady
(
$meeting
[
'meeting_name'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'meeting_name'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'participant_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'participant_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'video_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'video_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'listener_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'listener_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'voice_participant_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'voice_participant_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'moderator_count'
])
?>
</td>
<td>
<?=
htmlReady
(
$meeting
[
'moderator_count'
])
?>
</td>
<td>
<?=
$meeting
[
'is_break_out'
]
===
1
?
_
(
'Ja'
)
:
_
(
'Nein'
)
?>
</td>
<td>
<?=
$meeting
[
'is_break_out'
]
===
1
?
_
(
'Ja'
)
:
_
(
'Nein'
)
?>
</td>
</tr>
</tr>
<?
endforeach
?>
<?
endforeach
?>
</tbody>
</tbody>
</table>
</table>
<?
endif
?>
<?
endif
?>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment