snapstats 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/snapstats/main/main_controller.js +7 -7
- data/app/assets/stylesheets/snapstats/app.css +8 -0
- data/app/controllers/snapstats/reports_controller.rb +22 -0
- data/app/views/snapstats/application/_main_menu.html.erb +1 -1
- data/app/views/snapstats/reports/show.html.erb +55 -0
- data/app/views/snapstats/users/activity.html.erb +6 -2
- data/app/views/snapstats/users/show.html.erb +6 -2
- data/config/routes.rb +4 -1
- data/lib/event_reader/event_reader.rb +1 -1
- data/lib/snapstats/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ea346969f2718f2e4b4627bc28abb0919980baf
|
4
|
+
data.tar.gz: 347d3a69764313c5d483efb82eca978fabcb8aa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80018a8d0502e8e1166b7ddf35bc85c724401e23b78fc3789b1a4c7532c5872886e9ac3d80676866aeb7ea0e6dbe9c56fd61a87b1dc4800fc0dd149b8d960bdd
|
7
|
+
data.tar.gz: f15424b5810879f418b4c4a1b4b175c25ba3285cdd8c750bc22e2e5d034f00837d521d9cd904aded6b0b9a11c0dc62818fd9121e2ba696dbfbf00f9cd8424c74
|
@@ -1,8 +1,9 @@
|
|
1
1
|
$(document).ready(function () {
|
2
2
|
({
|
3
3
|
|
4
|
-
when_cat
|
4
|
+
when_cat : "li.section-main",
|
5
5
|
data_path : ($(location).attr('pathname') + '/main/chart').replace('//', '/'),
|
6
|
+
torso : { width : 375, height : 200, right : 20 },
|
6
7
|
|
7
8
|
init : function () {
|
8
9
|
var self = this;
|
@@ -25,12 +26,11 @@ $(document).ready(function () {
|
|
25
26
|
}
|
26
27
|
|
27
28
|
MG.data_graphic({
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
height: 250,
|
29
|
+
data: data,
|
30
|
+
full_width: true,
|
31
|
+
height: self.torso.height * 3 / 2,
|
32
|
+
right: self.torso.right,
|
33
|
+
|
34
34
|
target: ".chart",
|
35
35
|
x_extended_ticks: true,
|
36
36
|
x_accessor: "date",
|
@@ -55,4 +55,12 @@ ul.menu li.active a, ul.menu li a:hover { color: white; }
|
|
55
55
|
.panel-wgt .panel-title {
|
56
56
|
padding-top: 10px;
|
57
57
|
text-align: center;
|
58
|
+
}
|
59
|
+
|
60
|
+
.limit-cell {
|
61
|
+
max-width: 400px;
|
62
|
+
display: block;
|
63
|
+
overflow: hidden;
|
64
|
+
text-overflow: ellipsis;
|
65
|
+
white-space: nowrap;
|
58
66
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Snapstats
|
2
|
+
class ReportsController < ApplicationController
|
3
|
+
|
4
|
+
def index
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
def show
|
9
|
+
# @users = EventReader::UserActivity.fetch_all
|
10
|
+
end
|
11
|
+
|
12
|
+
def activity
|
13
|
+
# @user_email = EventReader::UserActivity.fetch_email_by_uid params[:id]
|
14
|
+
# @activity = EventReader::UserActivity.fetch_for_user params[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
def chart
|
18
|
+
# render json: EventReader::UserActivity.fetch_chart_for_user(params[:id])
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -3,6 +3,6 @@
|
|
3
3
|
<li <%= active_cat? :main %>> <%= link_to 'Daily report', root_path %> </li>
|
4
4
|
<li <%= active_cat? :user %>> <a href="#"><%= link_to 'Users', user_path %></a></li>
|
5
5
|
<li <%= active_cat? :performance %>> <a href="#"><%= link_to 'Performance', performance_path %></li>
|
6
|
-
<li <%= active_cat? :reports %>> <a href="#"><%= link_to 'Reports', performance_path %></li>
|
6
|
+
<!-- <li <%= active_cat? :reports %>> <a href="#"><%= link_to 'Reports', performance_path %></li> -->
|
7
7
|
</ul>
|
8
8
|
</div>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<div class="container animated fadeIn">
|
2
|
+
|
3
|
+
<div class="row">
|
4
|
+
|
5
|
+
<div class="col-lg-4">
|
6
|
+
|
7
|
+
<div class="panel panel-wgt">
|
8
|
+
<div class="panel-heading">
|
9
|
+
<h3 class="panel-title">13 March</h3>
|
10
|
+
</div>
|
11
|
+
<div class="panel-body">
|
12
|
+
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="col-lg-4">
|
18
|
+
<div class="panel panel-wgt">
|
19
|
+
|
20
|
+
<div class="panel-heading">
|
21
|
+
<h3 class="panel-title">12 March</h3>
|
22
|
+
</div>
|
23
|
+
<div class="panel-body">
|
24
|
+
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="col-lg-4">
|
30
|
+
<div class="panel panel-wgt">
|
31
|
+
<div class="panel-heading">
|
32
|
+
<h3 class="panel-title">11 March</h3>
|
33
|
+
</div>
|
34
|
+
<div class="panel-body">
|
35
|
+
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<div class="col-lg-4">
|
41
|
+
<div class="panel panel-wgt">
|
42
|
+
<div class="panel-heading">
|
43
|
+
<h3 class="panel-title">10 March</h3>
|
44
|
+
</div>
|
45
|
+
<div class="panel-body">
|
46
|
+
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
55
|
+
|
@@ -30,10 +30,14 @@
|
|
30
30
|
<th>Browser</th>
|
31
31
|
</tr>
|
32
32
|
|
33
|
-
<% @activity.each do |i| %>
|
33
|
+
<% @activity.sort_by{ |i| -i.date.to_i }.each do |i| %>
|
34
34
|
|
35
35
|
<tr>
|
36
|
-
<td>
|
36
|
+
<td>
|
37
|
+
<span class="limit-cell">
|
38
|
+
<%= i.path %>
|
39
|
+
</span>
|
40
|
+
</td>
|
37
41
|
<td> <%= time_ago_in_words i.date %> </td>
|
38
42
|
<td> <%= i.render_time %> </td>
|
39
43
|
<td> <%= i.os %> </td>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<table class="table">
|
11
11
|
|
12
12
|
<tr>
|
13
|
-
<th class="col-lg-5"> User
|
13
|
+
<th class="col-lg-5"> User login </th>
|
14
14
|
<th class="col-lg-3"> Time </th>
|
15
15
|
<th>Path</th>
|
16
16
|
</tr>
|
@@ -20,7 +20,11 @@
|
|
20
20
|
<tr>
|
21
21
|
<td> <%= link_to i.email, activity_user_path(i.user_id) %> </td>
|
22
22
|
<td> <%= time_ago_in_words i.date %> </td>
|
23
|
-
<td>
|
23
|
+
<td>
|
24
|
+
<span class="limit-cell">
|
25
|
+
<%= i.path %>
|
26
|
+
</span>
|
27
|
+
</td>
|
24
28
|
</tr>
|
25
29
|
|
26
30
|
<% end %>
|
data/config/routes.rb
CHANGED
@@ -17,8 +17,11 @@ Snapstats::Engine.routes.draw do
|
|
17
17
|
|
18
18
|
resource :user do
|
19
19
|
collection do
|
20
|
-
get 'activity/:id'
|
20
|
+
get 'activity/:id' => 'users#activity', :as => :activity
|
21
21
|
get 'activity/:id/chart' => 'users#chart', :as => :chart
|
22
22
|
end
|
23
23
|
end
|
24
|
+
|
25
|
+
resource :reports
|
26
|
+
|
24
27
|
end
|
@@ -83,7 +83,7 @@ module Snapstats
|
|
83
83
|
|
84
84
|
def self.fetch_browsers
|
85
85
|
data = Snapstats.redis.hgetall(Snapstats.mday("browsers")).values.group_by{ |browser| browser }.map{ |name, browsers|{ name => browsers.count} }
|
86
|
-
data.map{|i| self.new(name: i.keys.try(:first), total: i.values.try(:first)) }
|
86
|
+
data.map{|i| self.new(name: i.keys.try(:first), total: (i.values.try(:first).present? ? i.values.try(:first) : 'Other') ) }
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
data/lib/snapstats/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snapstats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- s3k
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- app/controllers/snapstats/application_controller.rb
|
94
94
|
- app/controllers/snapstats/mains_controller.rb
|
95
95
|
- app/controllers/snapstats/performances_controller.rb
|
96
|
+
- app/controllers/snapstats/reports_controller.rb
|
96
97
|
- app/controllers/snapstats/users_controller.rb
|
97
98
|
- app/helpers/snapstats/application_helper.rb
|
98
99
|
- app/views/layouts/snapstats/application.html.erb
|
@@ -100,6 +101,7 @@ files:
|
|
100
101
|
- app/views/snapstats/mains/show.html.erb
|
101
102
|
- app/views/snapstats/mains/unavailable.html.erb
|
102
103
|
- app/views/snapstats/performances/show.html.erb
|
104
|
+
- app/views/snapstats/reports/show.html.erb
|
103
105
|
- app/views/snapstats/users/activity.html.erb
|
104
106
|
- app/views/snapstats/users/show.html.erb
|
105
107
|
- config/routes.rb
|