-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
177 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,8 @@ def sv_specific_relationship | |
true | ||
end | ||
|
||
def sv_not_specific_relationship | ||
true | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<div class="panel content"> | ||
<h2> Activity of past 24 hours</h2> | ||
|
||
<% d = User.where('last_seen_at > ?', 1.day.ago).group_by_hour_of_day(:last_seen_at, format: "%H").count.sort.collect{|a,b| b} %><br> | ||
|
||
<div style="height: 280px; width: 420px;"> | ||
<canvas id="myChart"></canvas> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
const ctx = document.getElementById('myChart'); | ||
const myChart = new Chart(ctx, { | ||
type: 'polarArea', | ||
|
||
data: { | ||
labels: [<%= (1..24).collect{|t| ('"' + t.to_s + '"').html_safe}.join(', ').html_safe %>], | ||
datasets: [{ | ||
label: 'Users in past 24 hours', | ||
data: <%= d %> , | ||
backgroundColor: [ | ||
'rgb(250, 250, 110)', | ||
'rgb(228, 245, 112)', | ||
'rgb(207, 239, 114)', | ||
'rgb(187, 234, 118)', | ||
'rgb(167, 227, 121)', | ||
'rgb(148, 220, 125)', | ||
'rgb(130, 213, 129)', | ||
'rgb(112, 206, 133)', | ||
'rgb(94, 198, 136)', | ||
'rgb(77, 190, 139)', | ||
'rgb(61, 182, 141)', | ||
'rgb(44, 174, 143)', | ||
'rgb(26, 165, 143)', | ||
'rgb(2, 157, 143)', | ||
'rgb(0, 148, 142)', | ||
'rgb(0, 140, 139)', | ||
'rgb(0, 131, 136)', | ||
'rgb(0, 122, 132)', | ||
'rgb(10, 114, 126)', | ||
'rgb(22, 105, 120)', | ||
'rgb(30, 97, 113)', | ||
'rgb(36, 88, 105)', | ||
'rgb(40, 80, 97)', | ||
'rgb(42, 72, 88)'] | ||
}] | ||
}, | ||
options: { | ||
responsibe: true, | ||
maintainAspectRatio: false, | ||
plugins: { | ||
legend: { | ||
position: 'left', | ||
title: { | ||
text: 'Hours ago', | ||
display: true, | ||
} | ||
}, | ||
title: { | ||
display: false, | ||
} | ||
} | ||
}, | ||
}); | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.