lesli_audit 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/lesli_audit/users_controller.rb +1 -2
- data/app/controllers/lesli_audit/visitors_controller.rb +14 -0
- data/app/interfaces/lesli_audit/logger_interface.rb +22 -29
- data/app/services/lesli_audit/user_service.rb +105 -12
- data/app/services/lesli_audit/{analytic_service.rb → visitor_service.rb} +121 -24
- data/app/views/lesli_audit/partials/_navigation.html.erb +1 -1
- data/app/views/lesli_audit/requests/index.html.erb +1 -1
- data/app/views/lesli_audit/users/index.html.erb +36 -4
- data/app/views/lesli_audit/visitors/index.html.erb +118 -0
- data/config/routes.rb +1 -1
- data/db/migrate/v1.0/0501110210_create_lesli_audit_account_devices.rb +2 -1
- data/db/seed/devices.rb +23 -15
- data/db/seed/users.rb +117 -0
- data/db/seeds.rb +2 -2
- data/lib/lesli_audit/version.rb +2 -2
- metadata +10 -50
- data/app/assets/config/lesli_audit_manifest.js +0 -37
- data/app/controllers/lesli_audit/analytics_controller.rb +0 -23
- data/app/controllers/lesli_audit/user_journals_controller.rb +0 -60
- data/app/helpers/lesli_audit/analytics_helper.rb +0 -4
- data/app/views/lesli_audit/analytics/index.html.erb +0 -44
- data/app/views/lesli_audit/user_journals/_form.html.erb +0 -17
- data/app/views/lesli_audit/user_journals/_user_journal.html.erb +0 -2
- data/app/views/lesli_audit/user_journals/edit.html.erb +0 -12
- data/app/views/lesli_audit/user_journals/index.html.erb +0 -16
- data/app/views/lesli_audit/user_journals/new.html.erb +0 -11
- data/app/views/lesli_audit/user_journals/show.html.erb +0 -10
- data/app/views/lesli_audit/users/show.html.erb +0 -10
- data/lib/scss/application.scss +0 -31
- data/lib/vue/application.js +0 -146
- data/lib/vue/apps/accounts/activities.vue +0 -48
- data/lib/vue/apps/analytics/index.vue +0 -56
- data/lib/vue/apps/analytics/trends.vue +0 -148
- data/lib/vue/apps/dashboards/components/roles.vue +0 -71
- data/lib/vue/apps/dashboards/components/users.vue +0 -71
- data/lib/vue/apps/dashboards/show.vue +0 -8
- data/lib/vue/apps/requests/index.vue +0 -125
- data/lib/vue/apps/security/passwords.vue +0 -52
- data/lib/vue/apps/security/sessions.vue +0 -63
- data/lib/vue/apps/users/activities.vue +0 -49
- data/lib/vue/apps/users/index.vue +0 -89
- data/lib/vue/apps/users/logs.vue +0 -49
- data/lib/vue/apps/users/registrations.vue +0 -73
- data/lib/vue/apps/users/roles.vue +0 -70
- data/lib/vue/apps/users/workingHours.vue +0 -52
- data/lib/vue/components/requests.vue +0 -63
- data/lib/vue/components/visitors.vue +0 -76
- data/lib/vue/stores/accounts/activities.js +0 -87
- data/lib/vue/stores/analytics.js +0 -127
- data/lib/vue/stores/request.js +0 -70
- data/lib/vue/stores/security/password.js +0 -75
- data/lib/vue/stores/security/session.js +0 -78
- data/lib/vue/stores/translations.json +0 -162
- data/lib/vue/stores/users/activities.js +0 -76
- data/lib/vue/stores/users/logs.js +0 -74
- data/lib/vue/stores/users/registrations.js +0 -61
- data/lib/vue/stores/users/roles.js +0 -52
- data/lib/vue/stores/users/working_hours.js +0 -92
- data/lib/vue/stores/users.js +0 -56
data/db/seed/devices.rb
CHANGED
|
@@ -44,25 +44,33 @@ current_user = Lesli::User.first
|
|
|
44
44
|
|
|
45
45
|
# controllers to seed
|
|
46
46
|
[
|
|
47
|
-
"
|
|
47
|
+
"Mac",
|
|
48
48
|
"Windows"
|
|
49
49
|
].each do |platform|
|
|
50
50
|
|
|
51
51
|
[
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
].each do |
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
52
|
+
"smartphone",
|
|
53
|
+
"tablet",
|
|
54
|
+
"desktop"
|
|
55
|
+
].each do |device|
|
|
56
|
+
|
|
57
|
+
[
|
|
58
|
+
"Firefox",
|
|
59
|
+
"Chrome",
|
|
60
|
+
"Safari"
|
|
61
|
+
].each do |browser|
|
|
62
|
+
# Iterate through the dates
|
|
63
|
+
(start_date..end_date).each do |date|
|
|
64
|
+
|
|
65
|
+
current_user.account.audit.account_devices.create_with(
|
|
66
|
+
:agent_count => rand(40..80),
|
|
67
|
+
).find_or_create_by(
|
|
68
|
+
:agent_platform => platform,
|
|
69
|
+
:agent_browser => browser,
|
|
70
|
+
:agent_device => device,
|
|
71
|
+
:created_at => date,
|
|
72
|
+
)
|
|
73
|
+
end
|
|
66
74
|
end
|
|
67
75
|
end
|
|
68
76
|
end
|
data/db/seed/users.rb
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
return unless Rails.env.development?
|
|
4
|
+
|
|
5
|
+
account = Lesli::Account.first!
|
|
6
|
+
|
|
7
|
+
password = if defined?(Devise)
|
|
8
|
+
Devise::Encryptor.digest(Lesli::User, "password123")
|
|
9
|
+
else
|
|
10
|
+
BCrypt::Password.create("password123")
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
now = Time.current
|
|
14
|
+
|
|
15
|
+
# Adjust these numbers freely while building the dashboard.
|
|
16
|
+
TOTAL_USERS = 1_000
|
|
17
|
+
TOTAL_INACTIVE_USERS = 120
|
|
18
|
+
TOTAL_LOCKED_USERS = 45
|
|
19
|
+
TOTAL_UNCONFIRMED_USERS = 80
|
|
20
|
+
TOTAL_USERS_NEVER_SIGNED_IN = 140
|
|
21
|
+
TOTAL_USERS_ACTIVE_LAST_30_DAYS = 520
|
|
22
|
+
TOTAL_NEW_USERS_LAST_30_DAYS = 75
|
|
23
|
+
TOTAL_USERS_WITH_FAILED_ATTEMPTS = 60
|
|
24
|
+
TOTAL_DELETED_USERS = 25
|
|
25
|
+
|
|
26
|
+
users = []
|
|
27
|
+
|
|
28
|
+
TOTAL_USERS.times do |index|
|
|
29
|
+
uid = "DEV-USR-#{index.to_s.rjust(5, "0")}"
|
|
30
|
+
|
|
31
|
+
users << {
|
|
32
|
+
uid: uid,
|
|
33
|
+
account_id: account.id,
|
|
34
|
+
|
|
35
|
+
active: true,
|
|
36
|
+
|
|
37
|
+
first_name: "Demo",
|
|
38
|
+
last_name: "User #{index + 1}",
|
|
39
|
+
email: "demo.user.#{index + 1}@lesli.dev",
|
|
40
|
+
encrypted_password: password,
|
|
41
|
+
|
|
42
|
+
confirmed_at: now - rand(1..180).days,
|
|
43
|
+
confirmation_sent_at: nil,
|
|
44
|
+
confirmation_token: nil,
|
|
45
|
+
|
|
46
|
+
sign_in_count: rand(1..80),
|
|
47
|
+
current_sign_in_at: now - rand(1..90).days,
|
|
48
|
+
last_sign_in_at: now - rand(1..90).days,
|
|
49
|
+
current_sign_in_ip: "127.0.0.1",
|
|
50
|
+
last_sign_in_ip: "127.0.0.1",
|
|
51
|
+
|
|
52
|
+
failed_attempts: 0,
|
|
53
|
+
|
|
54
|
+
locked_at: nil,
|
|
55
|
+
locked_until: nil,
|
|
56
|
+
unlock_token: nil,
|
|
57
|
+
|
|
58
|
+
created_at: now - rand(31..365).days,
|
|
59
|
+
updated_at: now,
|
|
60
|
+
deleted_at: nil
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Inactive users
|
|
65
|
+
users.first(TOTAL_INACTIVE_USERS).each do |user|
|
|
66
|
+
user[:active] = false
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Locked users
|
|
70
|
+
users.slice(120, TOTAL_LOCKED_USERS).each do |user|
|
|
71
|
+
user[:locked_at] = now - rand(1..15).days
|
|
72
|
+
user[:locked_until] = now + rand(1..15).days
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Unconfirmed users
|
|
76
|
+
users.slice(200, TOTAL_UNCONFIRMED_USERS).each do |user|
|
|
77
|
+
user[:confirmed_at] = nil
|
|
78
|
+
user[:confirmation_sent_at] = now - rand(1..10).days
|
|
79
|
+
user[:confirmation_token] = SecureRandom.hex(16)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Never signed in
|
|
83
|
+
users.slice(300, TOTAL_USERS_NEVER_SIGNED_IN).each do |user|
|
|
84
|
+
user[:sign_in_count] = 0
|
|
85
|
+
user[:current_sign_in_at] = nil
|
|
86
|
+
user[:last_sign_in_at] = nil
|
|
87
|
+
user[:current_sign_in_ip] = nil
|
|
88
|
+
user[:last_sign_in_ip] = nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Active in the last 30 days
|
|
92
|
+
users.slice(450, TOTAL_USERS_ACTIVE_LAST_30_DAYS).each do |user|
|
|
93
|
+
user[:sign_in_count] = rand(1..100)
|
|
94
|
+
user[:last_sign_in_at] = now - rand(0..29).days
|
|
95
|
+
user[:current_sign_in_at] = user[:last_sign_in_at]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# New users in the last 30 days
|
|
99
|
+
users.last(TOTAL_NEW_USERS_LAST_30_DAYS).each do |user|
|
|
100
|
+
user[:created_at] = now - rand(0..29).days
|
|
101
|
+
user[:updated_at] = now
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Users with failed attempts
|
|
105
|
+
users.slice(700, TOTAL_USERS_WITH_FAILED_ATTEMPTS).each do |user|
|
|
106
|
+
user[:failed_attempts] = rand(1..5)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Soft-deleted users
|
|
110
|
+
users.last(TOTAL_DELETED_USERS).each do |user|
|
|
111
|
+
user[:deleted_at] = now - rand(1..30).days
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Remove previous generated users only
|
|
115
|
+
Lesli::User.where("uid LIKE ?", "DEV-USR-%").delete_all
|
|
116
|
+
|
|
117
|
+
Lesli::User.insert_all!(users)
|
data/db/seeds.rb
CHANGED
|
@@ -30,12 +30,12 @@ Building a better future, one line of code at a time.
|
|
|
30
30
|
// ·
|
|
31
31
|
=end
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
L2.msg("LesliAudit", "Version: #{LesliAudit::VERSION}", "Build: #{LesliAudit::BUILD}")
|
|
33
|
+
Termline.info("Loading seeds for: LesliAudit #{LesliAudit::VERSION} (#{LesliAudit::BUILD})")
|
|
35
34
|
|
|
36
35
|
|
|
37
36
|
# · load specific environment seeds
|
|
38
37
|
if Rails.env.development? || Lesli.config.demo
|
|
39
38
|
load LesliAudit::Engine.root.join("db", "seed", "requests.rb")
|
|
40
39
|
load LesliAudit::Engine.root.join("db", "seed", "devices.rb")
|
|
40
|
+
load LesliAudit::Engine.root.join("db", "seed", "users.rb")
|
|
41
41
|
end
|
data/lib/lesli_audit/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lesli_audit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 5.1.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
25
|
+
version: 5.1.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
|
-
name:
|
|
27
|
+
name: device_detector
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
32
|
+
version: 1.1.3
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version:
|
|
39
|
+
version: 1.1.3
|
|
40
40
|
description: Logs Activities & Analytics for The Lesli Framework
|
|
41
41
|
email:
|
|
42
42
|
- hello@lesli.tech
|
|
@@ -45,20 +45,17 @@ extensions: []
|
|
|
45
45
|
extra_rdoc_files: []
|
|
46
46
|
files:
|
|
47
47
|
- Rakefile
|
|
48
|
-
- app/assets/config/lesli_audit_manifest.js
|
|
49
48
|
- app/assets/images/lesli_audit/audit-logo.svg
|
|
50
49
|
- app/assets/javascripts/lesli_audit/application.js
|
|
51
50
|
- app/assets/stylesheets/lesli_audit/application.css
|
|
52
51
|
- app/controllers/lesli_audit/accounts_controller.rb
|
|
53
|
-
- app/controllers/lesli_audit/analytics_controller.rb
|
|
54
52
|
- app/controllers/lesli_audit/application_controller.rb
|
|
55
53
|
- app/controllers/lesli_audit/dashboards_controller.rb
|
|
56
54
|
- app/controllers/lesli_audit/logs_controller.rb
|
|
57
55
|
- app/controllers/lesli_audit/requests_controller.rb
|
|
58
|
-
- app/controllers/lesli_audit/user_journals_controller.rb
|
|
59
56
|
- app/controllers/lesli_audit/users_controller.rb
|
|
57
|
+
- app/controllers/lesli_audit/visitors_controller.rb
|
|
60
58
|
- app/helpers/lesli_audit/accounts_helper.rb
|
|
61
|
-
- app/helpers/lesli_audit/analytics_helper.rb
|
|
62
59
|
- app/helpers/lesli_audit/application_helper.rb
|
|
63
60
|
- app/helpers/lesli_audit/dashboards_helper.rb
|
|
64
61
|
- app/helpers/lesli_audit/logs_helper.rb
|
|
@@ -77,11 +74,10 @@ files:
|
|
|
77
74
|
- app/models/lesli_audit/user_journal.rb
|
|
78
75
|
- app/models/lesli_audit/user_log.rb
|
|
79
76
|
- app/models/lesli_audit/user_request.rb
|
|
80
|
-
- app/services/lesli_audit/analytic_service.rb
|
|
81
77
|
- app/services/lesli_audit/log_service.rb
|
|
82
78
|
- app/services/lesli_audit/request_service.rb
|
|
83
79
|
- app/services/lesli_audit/user_service.rb
|
|
84
|
-
- app/
|
|
80
|
+
- app/services/lesli_audit/visitor_service.rb
|
|
85
81
|
- app/views/lesli_audit/dashboards/_component-calendar.html.erb
|
|
86
82
|
- app/views/lesli_audit/dashboards/edit.html.erb
|
|
87
83
|
- app/views/lesli_audit/dashboards/index.html.erb
|
|
@@ -91,14 +87,8 @@ files:
|
|
|
91
87
|
- app/views/lesli_audit/logs/show.html.erb
|
|
92
88
|
- app/views/lesli_audit/partials/_navigation.html.erb
|
|
93
89
|
- app/views/lesli_audit/requests/index.html.erb
|
|
94
|
-
- app/views/lesli_audit/user_journals/_form.html.erb
|
|
95
|
-
- app/views/lesli_audit/user_journals/_user_journal.html.erb
|
|
96
|
-
- app/views/lesli_audit/user_journals/edit.html.erb
|
|
97
|
-
- app/views/lesli_audit/user_journals/index.html.erb
|
|
98
|
-
- app/views/lesli_audit/user_journals/new.html.erb
|
|
99
|
-
- app/views/lesli_audit/user_journals/show.html.erb
|
|
100
90
|
- app/views/lesli_audit/users/index.html.erb
|
|
101
|
-
- app/views/lesli_audit/
|
|
91
|
+
- app/views/lesli_audit/visitors/index.html.erb
|
|
102
92
|
- config/locales/translations.en.yml
|
|
103
93
|
- config/locales/translations.es.yml
|
|
104
94
|
- config/locales/translations.fr.yml
|
|
@@ -114,43 +104,13 @@ files:
|
|
|
114
104
|
- db/migrate/v1.0/0501120310_create_lesli_audit_user_requests.rb
|
|
115
105
|
- db/seed/devices.rb
|
|
116
106
|
- db/seed/requests.rb
|
|
107
|
+
- db/seed/users.rb
|
|
117
108
|
- db/seeds.rb
|
|
118
109
|
- db/version_structure.rb
|
|
119
110
|
- lib/lesli_audit.rb
|
|
120
111
|
- lib/lesli_audit/engine.rb
|
|
121
112
|
- lib/lesli_audit/version.rb
|
|
122
|
-
- lib/scss/application.scss
|
|
123
113
|
- lib/tasks/lesli_audit_tasks.rake
|
|
124
|
-
- lib/vue/application.js
|
|
125
|
-
- lib/vue/apps/accounts/activities.vue
|
|
126
|
-
- lib/vue/apps/analytics/index.vue
|
|
127
|
-
- lib/vue/apps/analytics/trends.vue
|
|
128
|
-
- lib/vue/apps/dashboards/components/roles.vue
|
|
129
|
-
- lib/vue/apps/dashboards/components/users.vue
|
|
130
|
-
- lib/vue/apps/dashboards/show.vue
|
|
131
|
-
- lib/vue/apps/requests/index.vue
|
|
132
|
-
- lib/vue/apps/security/passwords.vue
|
|
133
|
-
- lib/vue/apps/security/sessions.vue
|
|
134
|
-
- lib/vue/apps/users/activities.vue
|
|
135
|
-
- lib/vue/apps/users/index.vue
|
|
136
|
-
- lib/vue/apps/users/logs.vue
|
|
137
|
-
- lib/vue/apps/users/registrations.vue
|
|
138
|
-
- lib/vue/apps/users/roles.vue
|
|
139
|
-
- lib/vue/apps/users/workingHours.vue
|
|
140
|
-
- lib/vue/components/requests.vue
|
|
141
|
-
- lib/vue/components/visitors.vue
|
|
142
|
-
- lib/vue/stores/accounts/activities.js
|
|
143
|
-
- lib/vue/stores/analytics.js
|
|
144
|
-
- lib/vue/stores/request.js
|
|
145
|
-
- lib/vue/stores/security/password.js
|
|
146
|
-
- lib/vue/stores/security/session.js
|
|
147
|
-
- lib/vue/stores/translations.json
|
|
148
|
-
- lib/vue/stores/users.js
|
|
149
|
-
- lib/vue/stores/users/activities.js
|
|
150
|
-
- lib/vue/stores/users/logs.js
|
|
151
|
-
- lib/vue/stores/users/registrations.js
|
|
152
|
-
- lib/vue/stores/users/roles.js
|
|
153
|
-
- lib/vue/stores/users/working_hours.js
|
|
154
114
|
- license
|
|
155
115
|
- readme.md
|
|
156
116
|
homepage: https://www.lesli.dev/
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2023, Lesli Technologies, S. A.
|
|
6
|
-
|
|
7
|
-
This program is free software: you can redistribute it and/or modify
|
|
8
|
-
it under the terms of the GNU General Public License as published by
|
|
9
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
-
(at your option) any later version.
|
|
11
|
-
|
|
12
|
-
This program is distributed in the hope that it will be useful,
|
|
13
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
GNU General Public License for more details.
|
|
16
|
-
|
|
17
|
-
You should have received a copy of the GNU General Public License
|
|
18
|
-
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
-
|
|
20
|
-
Lesli · Ruby on Rails SaaS development platform.
|
|
21
|
-
|
|
22
|
-
Made with ♥ by https://www.lesli.tech
|
|
23
|
-
Building a better future, one line of code at a time.
|
|
24
|
-
|
|
25
|
-
@contact hello@lesli.tech
|
|
26
|
-
@website https://www.lesli.tech
|
|
27
|
-
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
-
|
|
29
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
-
// ·
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
//= link_tree ../images/lesli_audit .png
|
|
34
|
-
//= link_tree ../images/lesli_audit .jpg
|
|
35
|
-
//= link_tree ../images/lesli_audit .svg
|
|
36
|
-
|
|
37
|
-
//= link lesli_audit/application.css
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module LesliAudit
|
|
2
|
-
class AnalyticsController < ApplicationController
|
|
3
|
-
|
|
4
|
-
# GET /analytics
|
|
5
|
-
def index
|
|
6
|
-
@visitors = AnalyticService.new(current_user, query).visitors
|
|
7
|
-
@requests = AnalyticService.new(current_user, query).requests
|
|
8
|
-
@browsers = AnalyticService.new(current_user, query).browsers
|
|
9
|
-
@platforms = AnalyticService.new(current_user, query).devices
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
15
|
-
def set_analytic
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# Only allow a list of trusted parameters through.
|
|
19
|
-
def analytic_params
|
|
20
|
-
params.fetch(:analytic, {})
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
module LesliAudit
|
|
2
|
-
class UserJournalsController < ApplicationController
|
|
3
|
-
before_action :set_user_journal, only: %i[ show edit update destroy ]
|
|
4
|
-
|
|
5
|
-
# GET /user_journals
|
|
6
|
-
def index
|
|
7
|
-
@user_journals = UserJournal.all
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# GET /user_journals/1
|
|
11
|
-
def show
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# GET /user_journals/new
|
|
15
|
-
def new
|
|
16
|
-
@user_journal = UserJournal.new
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# GET /user_journals/1/edit
|
|
20
|
-
def edit
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# POST /user_journals
|
|
24
|
-
def create
|
|
25
|
-
@user_journal = UserJournal.new(user_journal_params)
|
|
26
|
-
|
|
27
|
-
if @user_journal.save
|
|
28
|
-
redirect_to @user_journal, notice: "User journal was successfully created."
|
|
29
|
-
else
|
|
30
|
-
render :new, status: :unprocessable_content
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# PATCH/PUT /user_journals/1
|
|
35
|
-
def update
|
|
36
|
-
if @user_journal.update(user_journal_params)
|
|
37
|
-
redirect_to @user_journal, notice: "User journal was successfully updated.", status: :see_other
|
|
38
|
-
else
|
|
39
|
-
render :edit, status: :unprocessable_content
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# DELETE /user_journals/1
|
|
44
|
-
def destroy
|
|
45
|
-
@user_journal.destroy!
|
|
46
|
-
redirect_to user_journals_path, notice: "User journal was successfully destroyed.", status: :see_other
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
private
|
|
50
|
-
# Use callbacks to share common setup or constraints between actions.
|
|
51
|
-
def set_user_journal
|
|
52
|
-
@user_journal = UserJournal.find(params.expect(:id))
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
# Only allow a list of trusted parameters through.
|
|
56
|
-
def user_journal_params
|
|
57
|
-
params.fetch(:user_journal, {})
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<% @visitors = @visitors.reverse %>
|
|
3
|
-
|
|
4
|
-
<%= render(LesliView::Layout::Container.new("audit-analytics")) do %>
|
|
5
|
-
<%= render(LesliView::Components::Header.new("Analytics")) %>
|
|
6
|
-
|
|
7
|
-
<%= render(LesliView::Charts::Line.new(
|
|
8
|
-
title:"Visitors",
|
|
9
|
-
database_to_dataset: @visitors
|
|
10
|
-
))%>
|
|
11
|
-
<br>
|
|
12
|
-
<div class="columns">
|
|
13
|
-
<div class="column">
|
|
14
|
-
<%= render(LesliView::Elements::Table.new(
|
|
15
|
-
columns: [{
|
|
16
|
-
label: "Controller",
|
|
17
|
-
field: "request_controller"
|
|
18
|
-
},{
|
|
19
|
-
label:"Requests",
|
|
20
|
-
field:"requests"
|
|
21
|
-
}],
|
|
22
|
-
records: @requests
|
|
23
|
-
)) %>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<div class="columns">
|
|
28
|
-
<div class="column">
|
|
29
|
-
<%= render(LesliView::Charts::Bar.new(
|
|
30
|
-
title: "Platforms",
|
|
31
|
-
database_to_datasets: @platforms
|
|
32
|
-
))%>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div class="columns">
|
|
37
|
-
<div class="column">
|
|
38
|
-
<%= render(LesliView::Charts::Bar.new(
|
|
39
|
-
title: "Browsers",
|
|
40
|
-
database_to_datasets: @browsers
|
|
41
|
-
))%>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
<% end %>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<%= form_with(model: user_journal) do |form| %>
|
|
2
|
-
<% if user_journal.errors.any? %>
|
|
3
|
-
<div style="color: red">
|
|
4
|
-
<h2><%= pluralize(user_journal.errors.count, "error") %> prohibited this user_journal from being saved:</h2>
|
|
5
|
-
|
|
6
|
-
<ul>
|
|
7
|
-
<% user_journal.errors.each do |error| %>
|
|
8
|
-
<li><%= error.full_message %></li>
|
|
9
|
-
<% end %>
|
|
10
|
-
</ul>
|
|
11
|
-
</div>
|
|
12
|
-
<% end %>
|
|
13
|
-
|
|
14
|
-
<div>
|
|
15
|
-
<%= form.submit %>
|
|
16
|
-
</div>
|
|
17
|
-
<% end %>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<% content_for :title, "Editing user journal" %>
|
|
2
|
-
|
|
3
|
-
<h1>Editing user journal</h1>
|
|
4
|
-
|
|
5
|
-
<%= render "form", user_journal: @user_journal %>
|
|
6
|
-
|
|
7
|
-
<br>
|
|
8
|
-
|
|
9
|
-
<div>
|
|
10
|
-
<%= link_to "Show this user journal", @user_journal %> |
|
|
11
|
-
<%= link_to "Back to user journals", user_journals_path %>
|
|
12
|
-
</div>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<p style="color: green"><%= notice %></p>
|
|
2
|
-
|
|
3
|
-
<% content_for :title, "User journals" %>
|
|
4
|
-
|
|
5
|
-
<h1>User journals</h1>
|
|
6
|
-
|
|
7
|
-
<div id="user_journals">
|
|
8
|
-
<% @user_journals.each do |user_journal| %>
|
|
9
|
-
<%= render user_journal %>
|
|
10
|
-
<p>
|
|
11
|
-
<%= link_to "Show this user journal", user_journal %>
|
|
12
|
-
</p>
|
|
13
|
-
<% end %>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<%= link_to "New user journal", new_user_journal_path %>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<p style="color: green"><%= notice %></p>
|
|
2
|
-
|
|
3
|
-
<%= render @user_journal %>
|
|
4
|
-
|
|
5
|
-
<div>
|
|
6
|
-
<%= link_to "Edit this user journal", edit_user_journal_path(@user_journal) %> |
|
|
7
|
-
<%= link_to "Back to user journals", user_journals_path %>
|
|
8
|
-
|
|
9
|
-
<%= button_to "Destroy this user journal", @user_journal, method: :delete %>
|
|
10
|
-
</div>
|
data/lib/scss/application.scss
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
Lesli
|
|
4
|
-
|
|
5
|
-
Copyright (c) 2023, Lesli Technologies, S. A.
|
|
6
|
-
|
|
7
|
-
This program is free software: you can redistribute it and/or modify
|
|
8
|
-
it under the terms of the GNU General Public License as published by
|
|
9
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
-
(at your option) any later version.
|
|
11
|
-
|
|
12
|
-
This program is distributed in the hope that it will be useful,
|
|
13
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
-
GNU General Public License for more details.
|
|
16
|
-
|
|
17
|
-
You should have received a copy of the GNU General Public License
|
|
18
|
-
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
-
|
|
20
|
-
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
-
|
|
22
|
-
Made with ♥ by https://www.lesli.tech
|
|
23
|
-
Building a better future, one line of code at a time.
|
|
24
|
-
|
|
25
|
-
@contact hello@lesli.tech
|
|
26
|
-
@website https://www.lesli.tech
|
|
27
|
-
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
-
|
|
29
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
-
// ·
|
|
31
|
-
*/
|