lesli_shield 1.0.3 → 1.0.4
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/assets/stylesheets/lesli_shield/confirmations.css +18732 -0
- data/app/assets/stylesheets/lesli_shield/passwords.css +2 -238
- data/app/assets/stylesheets/lesli_shield/registrations.css +2 -238
- data/app/assets/stylesheets/lesli_shield/sessions.css +2 -238
- data/app/controllers/lesli_shield/dashboards_controller.rb +1 -8
- data/app/controllers/lesli_shield/invites_controller.rb +80 -0
- data/app/controllers/lesli_shield/role/actions_controller.rb +32 -20
- data/app/controllers/lesli_shield/roles_controller.rb +16 -8
- data/app/controllers/lesli_shield/sessions_controller.rb +5 -8
- data/app/controllers/lesli_shield/user/roles_controller.rb +62 -0
- data/app/controllers/lesli_shield/users_controller.rb +57 -20
- data/app/controllers/users/confirmations_controller.rb +42 -8
- data/app/controllers/users/passwords_controller.rb +52 -37
- data/app/controllers/users/registrations_controller.rb +2 -8
- data/app/controllers/users/sessions_controller.rb +57 -50
- data/app/helpers/lesli_shield/invites_helper.rb +4 -0
- data/app/helpers/lesli_shield/user/roles_helper.rb +4 -0
- data/app/interfaces/lesli_shield/authorization_interface.rb +8 -2
- data/app/mailers/lesli_shield/devise_mailer.rb +98 -0
- data/app/mailers/lesli_shield/invitation.html.erb +23 -0
- data/app/models/concerns/lesli_shield/user_security.rb +222 -0
- data/app/models/lesli_shield/account.rb +1 -1
- data/app/models/lesli_shield/dashboard.rb +1 -4
- data/app/models/lesli_shield/invite.rb +24 -0
- data/{lib/vue/confirmations.js → app/models/lesli_shield/role/action.rb} +17 -10
- data/{db/migrate/v1/0801003010_create_lesli_shield_dashboards.rb → app/models/lesli_shield/role/privilege.rb} +5 -4
- data/app/models/lesli_shield/user/role.rb +8 -0
- data/app/models/lesli_shield/user/session.rb +80 -0
- data/app/services/lesli_shield/invite_service.rb +43 -0
- data/app/services/lesli_shield/role_action_service.rb +118 -0
- data/app/services/lesli_shield/role_privilege_service.rb +112 -0
- data/app/{operators/lesli_shield/user_registration_operator.rb → services/lesli_shield/user_registration_service.rb} +26 -29
- data/app/services/lesli_shield/user_session_service.rb +78 -0
- data/app/services/lesli_shield/user_validator_service.rb +221 -0
- data/app/views/devise/confirmations/show.html.erb +4 -6
- data/app/views/devise/passwords/edit.html.erb +1 -2
- data/app/views/devise/passwords/new.html.erb +1 -1
- data/app/views/devise/registrations/new.html.erb +5 -4
- data/app/views/devise/sessions/new.html.erb +3 -2
- data/app/views/devise/shared/_application-devise-simple.erb +59 -0
- data/app/views/devise/shared/_application-devise.html.erb +76 -0
- data/app/views/lesli_shield/dashboards/_component-calendar.html.erb +1 -0
- data/app/views/lesli_shield/dashboards/_component-chart-bar.html.erb +6 -0
- data/app/views/lesli_shield/dashboards/_component-chart-line.html.erb +8 -0
- data/app/views/lesli_shield/dashboards/_component-count.html.erb +1 -0
- data/app/views/lesli_shield/dashboards/_component-date.html.erb +1 -0
- data/app/views/lesli_shield/dashboards/_component-weather.html.erb +1 -0
- data/app/views/lesli_shield/invites/_form.html.erb +10 -0
- data/app/views/lesli_shield/invites/_invite.html.erb +2 -0
- data/app/views/lesli_shield/invites/edit.html.erb +12 -0
- data/app/views/lesli_shield/invites/index.html.erb +66 -0
- data/{db/migrate/v1/0801001710_create_lesli_shield_settings.rb → app/views/lesli_shield/invites/new.html.erb} +9 -10
- data/{lib/vue/apps/dashboards/components/engine-version.vue → app/views/lesli_shield/invites/show.html.erb} +26 -43
- data/app/views/lesli_shield/partials/_navigation.html.erb +2 -4
- data/app/views/lesli_shield/{roles/_form-privileges.html.erb → role/actions/_form.html.erb} +5 -30
- data/app/views/lesli_shield/role/actions/index.html.erb +14 -0
- data/app/views/lesli_shield/roles/index.html.erb +2 -6
- data/app/views/lesli_shield/roles/new.html.erb +0 -11
- data/app/views/lesli_shield/roles/show.html.erb +5 -8
- data/app/views/lesli_shield/user/roles/_form.html.erb +17 -0
- data/app/views/lesli_shield/user/roles/_role.html.erb +2 -0
- data/app/views/lesli_shield/user/roles/edit.html.erb +12 -0
- data/app/views/lesli_shield/user/roles/index.html.erb +16 -0
- data/app/views/lesli_shield/user/roles/new.html.erb +11 -0
- data/app/views/lesli_shield/user/roles/show.html.erb +10 -0
- data/app/views/lesli_shield/users/{_viewer-activities.html.erb → _activities-viewer.html.erb} +2 -4
- data/app/views/lesli_shield/users/_information-card.html.erb +3 -3
- data/app/views/lesli_shield/users/_management-privileges.html.erb +74 -0
- data/app/views/lesli_shield/users/_management-security.html.erb +5 -0
- data/app/views/lesli_shield/users/index.html.erb +3 -7
- data/app/views/lesli_shield/users/new.html.erb +5 -11
- data/app/views/lesli_shield/users/show.html.erb +7 -5
- data/config/initializers/devise.rb +305 -304
- data/config/locales/translations.en.yml +4 -1
- data/config/locales/translations.es.yml +4 -1
- data/config/locales/translations.it.yml +4 -1
- data/config/routes.rb +7 -8
- data/db/migrate/v1/0801100210_create_lesli_shield_role_actions.rb +48 -0
- data/db/migrate/v1/0801100410_create_lesli_shield_role_privileges.rb +45 -0
- data/db/migrate/v1/0801110110_create_lesli_shield_user_roles.rb +43 -0
- data/db/migrate/v1/0801111210_create_lesli_shield_user_sessions.rb +56 -0
- data/db/migrate/v1/0801120110_create_lesli_shield_invites.rb +49 -0
- data/lib/lesli_shield/router.rb +21 -0
- data/lib/lesli_shield/version.rb +2 -2
- data/lib/lesli_shield.rb +1 -1
- data/lib/scss/confirmations.scss +24 -24
- data/lib/tasks/lesli_shield_tasks.rake +1 -1
- data/readme.md +59 -20
- metadata +57 -33
- data/app/controllers/lesli_shield/dashboard/components_controller.rb +0 -60
- data/app/models/lesli_shield/dashboard/component.rb +0 -18
- data/app/views/lesli_shield/dashboards/edit.html.erb +0 -1
- data/app/views/lesli_shield/dashboards/index.html.erb +0 -9
- data/app/views/lesli_shield/dashboards/new.html.erb +0 -1
- data/app/views/lesli_shield/dashboards/show.html.erb +0 -1
- data/app/views/lesli_shield/roles/_session.html.erb +0 -2
- data/app/views/lesli_shield/roles/edit.html.erb +0 -12
- data/app/views/lesli_shield/roles/update.turbo_stream.erb +0 -3
- data/app/views/lesli_shield/users/update.turbo_stream.erb +0 -3
- data/lib/lesli_shield/routing.rb +0 -23
- data/lib/vue/application.js +0 -83
- data/lib/vue/apps/sessions/index.vue +0 -50
- data/lib/vue/passwords.js +0 -137
- data/lib/vue/registrations.js +0 -144
- data/lib/vue/sessions.js +0 -148
- data/lib/vue/stores/sessions.js +0 -43
- data/lib/vue/stores/translations.json +0 -162
- /data/app/views/lesli_shield/roles/{_form-information.html.erb → _form.html.erb} +0 -0
- /data/db/migrate/v1/{0801120310_create_lesli_shield_user_shortcuts.rb → 0801111010_create_lesli_shield_user_shortcuts.rb} +0 -0
- /data/db/migrate/v1/{0801120410_create_lesli_shield_user_tokens.rb → 0801111110_create_lesli_shield_user_tokens.rb} +0 -0
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lesli_shield
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '5.0'
|
|
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: '5.0'
|
|
40
40
|
description: "Provides a complete authentication and authorization solution for The
|
|
41
41
|
Lesli Framework, \nincluding user session management, secure login and logout, role-based
|
|
42
42
|
access control, \nand permission handling.\n"
|
|
@@ -62,12 +62,13 @@ files:
|
|
|
62
62
|
- app/assets/stylesheets/lesli_shield/sessions.css
|
|
63
63
|
- app/assets/stylesheets/lesli_shield/users.css
|
|
64
64
|
- app/controllers/lesli_shield/application_controller.rb
|
|
65
|
-
- app/controllers/lesli_shield/dashboard/components_controller.rb
|
|
66
65
|
- app/controllers/lesli_shield/dashboards_controller.rb
|
|
66
|
+
- app/controllers/lesli_shield/invites_controller.rb
|
|
67
67
|
- app/controllers/lesli_shield/role/actions_controller.rb
|
|
68
68
|
- app/controllers/lesli_shield/roles_controller.rb
|
|
69
69
|
- app/controllers/lesli_shield/sessions_controller.rb
|
|
70
70
|
- app/controllers/lesli_shield/settings_controller.rb
|
|
71
|
+
- app/controllers/lesli_shield/user/roles_controller.rb
|
|
71
72
|
- app/controllers/lesli_shield/users_controller.rb
|
|
72
73
|
- app/controllers/users/confirmations_controller.rb
|
|
73
74
|
- app/controllers/users/omniauth_callbacks_controller.rb
|
|
@@ -77,21 +78,35 @@ files:
|
|
|
77
78
|
- app/controllers/users/unlocks_controller.rb
|
|
78
79
|
- app/helpers/lesli_shield/application_helper.rb
|
|
79
80
|
- app/helpers/lesli_shield/dashboards_helper.rb
|
|
81
|
+
- app/helpers/lesli_shield/invites_helper.rb
|
|
80
82
|
- app/helpers/lesli_shield/sessions_helper.rb
|
|
81
83
|
- app/helpers/lesli_shield/settings_helper.rb
|
|
84
|
+
- app/helpers/lesli_shield/user/roles_helper.rb
|
|
82
85
|
- app/helpers/lesli_shield/users_helper.rb
|
|
83
86
|
- app/interfaces/lesli_shield/authentication_interface.rb
|
|
84
87
|
- app/interfaces/lesli_shield/authorization_interface.rb
|
|
85
88
|
- app/jobs/lesli_shield/application_job.rb
|
|
86
89
|
- app/mailers/lesli_shield/application_mailer.rb
|
|
90
|
+
- app/mailers/lesli_shield/devise_mailer.rb
|
|
91
|
+
- app/mailers/lesli_shield/invitation.html.erb
|
|
92
|
+
- app/models/concerns/lesli_shield/user_security.rb
|
|
87
93
|
- app/models/lesli_shield/account.rb
|
|
88
94
|
- app/models/lesli_shield/application_record.rb
|
|
89
95
|
- app/models/lesli_shield/dashboard.rb
|
|
90
|
-
- app/models/lesli_shield/
|
|
96
|
+
- app/models/lesli_shield/invite.rb
|
|
97
|
+
- app/models/lesli_shield/role/action.rb
|
|
98
|
+
- app/models/lesli_shield/role/privilege.rb
|
|
91
99
|
- app/models/lesli_shield/setting.rb
|
|
92
100
|
- app/models/lesli_shield/user.rb
|
|
93
|
-
- app/
|
|
101
|
+
- app/models/lesli_shield/user/role.rb
|
|
102
|
+
- app/models/lesli_shield/user/session.rb
|
|
103
|
+
- app/services/lesli_shield/invite_service.rb
|
|
104
|
+
- app/services/lesli_shield/role_action_service.rb
|
|
105
|
+
- app/services/lesli_shield/role_privilege_service.rb
|
|
94
106
|
- app/services/lesli_shield/tokens.rb
|
|
107
|
+
- app/services/lesli_shield/user_registration_service.rb
|
|
108
|
+
- app/services/lesli_shield/user_session_service.rb
|
|
109
|
+
- app/services/lesli_shield/user_validator_service.rb
|
|
95
110
|
- app/views/devise/confirmations/new.html.erb
|
|
96
111
|
- app/views/devise/confirmations/show.html.erb
|
|
97
112
|
- app/views/devise/mailer/confirmation_instructions.html.erb
|
|
@@ -104,23 +119,31 @@ files:
|
|
|
104
119
|
- app/views/devise/registrations/edit.html.erb
|
|
105
120
|
- app/views/devise/registrations/new.html.erb
|
|
106
121
|
- app/views/devise/sessions/new.html.erb
|
|
122
|
+
- app/views/devise/shared/_application-devise-simple.erb
|
|
123
|
+
- app/views/devise/shared/_application-devise.html.erb
|
|
107
124
|
- app/views/devise/shared/_demo.html.erb
|
|
108
125
|
- app/views/devise/shared/_error_messages.html.erb
|
|
109
126
|
- app/views/devise/shared/_links.html.erb
|
|
110
127
|
- app/views/devise/unlocks/new.html.erb
|
|
111
|
-
- app/views/lesli_shield/dashboards/
|
|
112
|
-
- app/views/lesli_shield/dashboards/
|
|
113
|
-
- app/views/lesli_shield/dashboards/
|
|
114
|
-
- app/views/lesli_shield/dashboards/
|
|
128
|
+
- app/views/lesli_shield/dashboards/_component-calendar.html.erb
|
|
129
|
+
- app/views/lesli_shield/dashboards/_component-chart-bar.html.erb
|
|
130
|
+
- app/views/lesli_shield/dashboards/_component-chart-line.html.erb
|
|
131
|
+
- app/views/lesli_shield/dashboards/_component-count.html.erb
|
|
132
|
+
- app/views/lesli_shield/dashboards/_component-date.html.erb
|
|
133
|
+
- app/views/lesli_shield/dashboards/_component-weather.html.erb
|
|
134
|
+
- app/views/lesli_shield/invites/_form.html.erb
|
|
135
|
+
- app/views/lesli_shield/invites/_invite.html.erb
|
|
136
|
+
- app/views/lesli_shield/invites/edit.html.erb
|
|
137
|
+
- app/views/lesli_shield/invites/index.html.erb
|
|
138
|
+
- app/views/lesli_shield/invites/new.html.erb
|
|
139
|
+
- app/views/lesli_shield/invites/show.html.erb
|
|
115
140
|
- app/views/lesli_shield/partials/_navigation.html.erb
|
|
116
|
-
- app/views/lesli_shield/
|
|
117
|
-
- app/views/lesli_shield/
|
|
118
|
-
- app/views/lesli_shield/roles/
|
|
119
|
-
- app/views/lesli_shield/roles/edit.html.erb
|
|
141
|
+
- app/views/lesli_shield/role/actions/_form.html.erb
|
|
142
|
+
- app/views/lesli_shield/role/actions/index.html.erb
|
|
143
|
+
- app/views/lesli_shield/roles/_form.html.erb
|
|
120
144
|
- app/views/lesli_shield/roles/index.html.erb
|
|
121
145
|
- app/views/lesli_shield/roles/new.html.erb
|
|
122
146
|
- app/views/lesli_shield/roles/show.html.erb
|
|
123
|
-
- app/views/lesli_shield/roles/update.turbo_stream.erb
|
|
124
147
|
- app/views/lesli_shield/sessions/_form.html.erb
|
|
125
148
|
- app/views/lesli_shield/sessions/_session.html.erb
|
|
126
149
|
- app/views/lesli_shield/sessions/edit.html.erb
|
|
@@ -133,15 +156,22 @@ files:
|
|
|
133
156
|
- app/views/lesli_shield/settings/index.html.erb
|
|
134
157
|
- app/views/lesli_shield/settings/new.html.erb
|
|
135
158
|
- app/views/lesli_shield/settings/show.html.erb
|
|
159
|
+
- app/views/lesli_shield/user/roles/_form.html.erb
|
|
160
|
+
- app/views/lesli_shield/user/roles/_role.html.erb
|
|
161
|
+
- app/views/lesli_shield/user/roles/edit.html.erb
|
|
162
|
+
- app/views/lesli_shield/user/roles/index.html.erb
|
|
163
|
+
- app/views/lesli_shield/user/roles/new.html.erb
|
|
164
|
+
- app/views/lesli_shield/user/roles/show.html.erb
|
|
165
|
+
- app/views/lesli_shield/users/_activities-viewer.html.erb
|
|
136
166
|
- app/views/lesli_shield/users/_information-card.html.erb
|
|
137
167
|
- app/views/lesli_shield/users/_information-form.html.erb
|
|
168
|
+
- app/views/lesli_shield/users/_management-privileges.html.erb
|
|
169
|
+
- app/views/lesli_shield/users/_management-security.html.erb
|
|
138
170
|
- app/views/lesli_shield/users/_management-sessions.html.erb
|
|
139
|
-
- app/views/lesli_shield/users/_viewer-activities.html.erb
|
|
140
171
|
- app/views/lesli_shield/users/edit.html.erb
|
|
141
172
|
- app/views/lesli_shield/users/index.html.erb
|
|
142
173
|
- app/views/lesli_shield/users/new.html.erb
|
|
143
174
|
- app/views/lesli_shield/users/show.html.erb
|
|
144
|
-
- app/views/lesli_shield/users/update.turbo_stream.erb
|
|
145
175
|
- config/initializers/devise.rb
|
|
146
176
|
- config/locales/translations.en.yml
|
|
147
177
|
- config/locales/translations.es.yml
|
|
@@ -150,13 +180,16 @@ files:
|
|
|
150
180
|
- config/locales/translations.pt.yml
|
|
151
181
|
- config/routes.rb
|
|
152
182
|
- db/migrate/v1/0801000110_create_lesli_shield_accounts.rb
|
|
153
|
-
- db/migrate/v1/
|
|
154
|
-
- db/migrate/v1/
|
|
155
|
-
- db/migrate/v1/
|
|
156
|
-
- db/migrate/v1/
|
|
183
|
+
- db/migrate/v1/0801100210_create_lesli_shield_role_actions.rb
|
|
184
|
+
- db/migrate/v1/0801100410_create_lesli_shield_role_privileges.rb
|
|
185
|
+
- db/migrate/v1/0801110110_create_lesli_shield_user_roles.rb
|
|
186
|
+
- db/migrate/v1/0801111010_create_lesli_shield_user_shortcuts.rb
|
|
187
|
+
- db/migrate/v1/0801111110_create_lesli_shield_user_tokens.rb
|
|
188
|
+
- db/migrate/v1/0801111210_create_lesli_shield_user_sessions.rb
|
|
189
|
+
- db/migrate/v1/0801120110_create_lesli_shield_invites.rb
|
|
157
190
|
- lib/lesli_shield.rb
|
|
158
191
|
- lib/lesli_shield/engine.rb
|
|
159
|
-
- lib/lesli_shield/
|
|
192
|
+
- lib/lesli_shield/router.rb
|
|
160
193
|
- lib/lesli_shield/version.rb
|
|
161
194
|
- lib/scss/_devise-simple.scss
|
|
162
195
|
- lib/scss/_devise.scss
|
|
@@ -168,15 +201,6 @@ files:
|
|
|
168
201
|
- lib/scss/sessions.scss
|
|
169
202
|
- lib/scss/users.scss
|
|
170
203
|
- lib/tasks/lesli_shield_tasks.rake
|
|
171
|
-
- lib/vue/application.js
|
|
172
|
-
- lib/vue/apps/dashboards/components/engine-version.vue
|
|
173
|
-
- lib/vue/apps/sessions/index.vue
|
|
174
|
-
- lib/vue/confirmations.js
|
|
175
|
-
- lib/vue/passwords.js
|
|
176
|
-
- lib/vue/registrations.js
|
|
177
|
-
- lib/vue/sessions.js
|
|
178
|
-
- lib/vue/stores/sessions.js
|
|
179
|
-
- lib/vue/stores/translations.json
|
|
180
204
|
- license
|
|
181
205
|
- readme.md
|
|
182
206
|
homepage: https://www.lesli.dev/
|
|
@@ -195,7 +219,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
195
219
|
requirements:
|
|
196
220
|
- - ">="
|
|
197
221
|
- !ruby/object:Gem::Version
|
|
198
|
-
version: '
|
|
222
|
+
version: '0'
|
|
199
223
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
224
|
requirements:
|
|
201
225
|
- - ">="
|
|
@@ -204,5 +228,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
204
228
|
requirements: []
|
|
205
229
|
rubygems_version: 3.7.1
|
|
206
230
|
specification_version: 4
|
|
207
|
-
summary:
|
|
231
|
+
summary: Users & security management for the Lesli Framework.
|
|
208
232
|
test_files: []
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
module LesliShield
|
|
2
|
-
class Dashboard::ComponentsController < ApplicationController
|
|
3
|
-
before_action :set_dashboard_component, only: %i[ show edit update destroy ]
|
|
4
|
-
|
|
5
|
-
# GET /dashboard/components
|
|
6
|
-
def index
|
|
7
|
-
@dashboard_components = Dashboard::Component.all
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
# GET /dashboard/components/1
|
|
11
|
-
def show
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
# GET /dashboard/components/new
|
|
15
|
-
def new
|
|
16
|
-
@dashboard_component = Dashboard::Component.new
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# GET /dashboard/components/1/edit
|
|
20
|
-
def edit
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
# POST /dashboard/components
|
|
24
|
-
def create
|
|
25
|
-
@dashboard_component = Dashboard::Component.new(dashboard_component_params)
|
|
26
|
-
|
|
27
|
-
if @dashboard_component.save
|
|
28
|
-
redirect_to @dashboard_component, notice: "Component was successfully created."
|
|
29
|
-
else
|
|
30
|
-
render :new, status: :unprocessable_entity
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# PATCH/PUT /dashboard/components/1
|
|
35
|
-
def update
|
|
36
|
-
if @dashboard_component.update(dashboard_component_params)
|
|
37
|
-
redirect_to @dashboard_component, notice: "Component was successfully updated.", status: :see_other
|
|
38
|
-
else
|
|
39
|
-
render :edit, status: :unprocessable_entity
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# DELETE /dashboard/components/1
|
|
44
|
-
def destroy
|
|
45
|
-
@dashboard_component.destroy
|
|
46
|
-
redirect_to dashboard_components_url, notice: "Component 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_dashboard_component
|
|
52
|
-
@dashboard_component = Dashboard::Component.find(params[:id])
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
# Only allow a list of trusted parameters through.
|
|
56
|
-
def dashboard_component_params
|
|
57
|
-
params.fetch(:dashboard_component, {})
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
module LesliShield
|
|
2
|
-
class Dashboard::Component < ApplicationRecord
|
|
3
|
-
|
|
4
|
-
belongs_to :dashboard, inverse_of: :components
|
|
5
|
-
|
|
6
|
-
def self.component_ids
|
|
7
|
-
["audit-users", "audit-roles"]
|
|
8
|
-
end
|
|
9
|
-
# components_ids: {
|
|
10
|
-
# list_new_tickets: "list_new_tickets",
|
|
11
|
-
# list_my_tickets: "list_my_tickets",
|
|
12
|
-
# list_unassigned_tickets: "list_unassigned_tickets",
|
|
13
|
-
# chart_tickets_by_type: "chart_tickets_by_type",
|
|
14
|
-
# chart_tickets_by_category: "chart_tickets_by_category",
|
|
15
|
-
# hours_worked: "hours_worked"
|
|
16
|
-
# }
|
|
17
|
-
end
|
|
18
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<router-view></router-view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<router-view></router-view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<%= render("/lesli/shared/dashboards/show") %>
|
data/lib/lesli_shield/routing.rb
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module LesliShield
|
|
2
|
-
module Routing
|
|
3
|
-
def self.mount_login_at path=""
|
|
4
|
-
Rails.application.routes.draw do
|
|
5
|
-
devise_for :users, class_name: "Lesli::User", module: :devise,
|
|
6
|
-
:path => path,
|
|
7
|
-
:path_names => {
|
|
8
|
-
:sign_in => "login",
|
|
9
|
-
:sign_out => "logout",
|
|
10
|
-
:sign_up => "register",
|
|
11
|
-
:password => "password",
|
|
12
|
-
:confirmation => "confirmation"
|
|
13
|
-
},
|
|
14
|
-
:controllers => {
|
|
15
|
-
:registrations => "users/registrations",
|
|
16
|
-
:confirmations => "users/confirmations",
|
|
17
|
-
:passwords => "users/passwords",
|
|
18
|
-
:sessions => "users/sessions"
|
|
19
|
-
}
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
data/lib/vue/application.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Lesli
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2023, Lesli Technologies, S. A.
|
|
5
|
-
|
|
6
|
-
This program is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
This program is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
|
|
19
|
-
Lesli · Ruby on Rails SaaS Development Framework.
|
|
20
|
-
|
|
21
|
-
Made with ♥ by LesliTech
|
|
22
|
-
Building a better future, one line of code at a time.
|
|
23
|
-
|
|
24
|
-
@contact hello@lesli.tech
|
|
25
|
-
@website https://www.lesli.tech
|
|
26
|
-
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
27
|
-
|
|
28
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
29
|
-
// ·
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// · Import Lesli builders
|
|
34
|
-
import application from "Lesli/vue/application"
|
|
35
|
-
import translation from "Lesli/vue/translation"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// · Import engine translations
|
|
39
|
-
import translations from "LesliShield/vue/stores/translations.json"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// ·
|
|
43
|
-
import appDashboardShow from "Lesli/vue/shared/dashboards/apps/show.vue"
|
|
44
|
-
import appDashboardEdit from "Lesli/vue/shared/dashboards/apps/edit.vue"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// ·
|
|
48
|
-
import appSessionIndex from "LesliShield/vue/apps/sessions/index.vue"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// ·
|
|
52
|
-
import componentDashboardEngineVersion from "LesliShield/vue/apps/dashboards/components/engine-version.vue"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// ·
|
|
56
|
-
const dashboardProps = {
|
|
57
|
-
components: {
|
|
58
|
-
"engine-version": componentDashboardEngineVersion
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// · Buil Lesli translations
|
|
64
|
-
translation(translations)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// · Build a new Lesli application
|
|
68
|
-
application("LesliShield", [{
|
|
69
|
-
path: "/",
|
|
70
|
-
component: appDashboardShow,
|
|
71
|
-
props: dashboardProps
|
|
72
|
-
}, {
|
|
73
|
-
path: "/dashboard",
|
|
74
|
-
component: appDashboardShow,
|
|
75
|
-
props: dashboardProps
|
|
76
|
-
}, {
|
|
77
|
-
path: "/dashboards/:id/edit",
|
|
78
|
-
component: appDashboardEdit,
|
|
79
|
-
props: dashboardProps
|
|
80
|
-
}, {
|
|
81
|
-
path: "/sessions",
|
|
82
|
-
component: appSessionIndex
|
|
83
|
-
}])
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
|
|
3
|
-
import { onMounted } from "vue"
|
|
4
|
-
import { useSessions } from "LesliShield/vue/stores/sessions"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// · implement stores
|
|
8
|
-
const storeSessions = useSessions()
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
// ·
|
|
13
|
-
const columns = [{
|
|
14
|
-
field: "id",
|
|
15
|
-
label: "ID"
|
|
16
|
-
}, {
|
|
17
|
-
field: "first_name",
|
|
18
|
-
label: "User name"
|
|
19
|
-
}, {
|
|
20
|
-
field: "session_source",
|
|
21
|
-
label: "Source"
|
|
22
|
-
}, {
|
|
23
|
-
field: "created_at_string",
|
|
24
|
-
label: "Created at"
|
|
25
|
-
}, {
|
|
26
|
-
field: "last_used_at_string",
|
|
27
|
-
label: "Last used at"
|
|
28
|
-
}, {
|
|
29
|
-
field: "device",
|
|
30
|
-
label: "Device"
|
|
31
|
-
}]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// ·
|
|
35
|
-
onMounted(() => {
|
|
36
|
-
storeSessions.get()
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
</script>
|
|
40
|
-
<template>
|
|
41
|
-
<lesli-application-container>
|
|
42
|
-
<lesli-header title="Sessions"></lesli-header>
|
|
43
|
-
<lesli-toolbar></lesli-toolbar>
|
|
44
|
-
<lesli-table
|
|
45
|
-
:columns="columns"
|
|
46
|
-
:records="storeSessions.sessions.records"
|
|
47
|
-
:pagination="storeSessions.sessions.pagination">
|
|
48
|
-
</lesli-table>
|
|
49
|
-
</lesli-application-container>
|
|
50
|
-
</template>
|
data/lib/vue/passwords.js
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Lesli
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2023, Lesli Technologies, S. A.
|
|
5
|
-
|
|
6
|
-
This program is free software: you can redistribute it and/or modify
|
|
7
|
-
it under the terms of the GNU General Public License as published by
|
|
8
|
-
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
-
(at your option) any later version.
|
|
10
|
-
|
|
11
|
-
This program is distributed in the hope that it will be useful,
|
|
12
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
-
GNU General Public License for more details.
|
|
15
|
-
|
|
16
|
-
You should have received a copy of the GNU General Public License
|
|
17
|
-
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
-
|
|
19
|
-
Lesli · Ruby on Rails SaaS Development Framework.
|
|
20
|
-
|
|
21
|
-
Made with ♥ by https://www.lesli.tech
|
|
22
|
-
Building a better future, one line of code at a time.
|
|
23
|
-
|
|
24
|
-
@contact hello@lesli.tech
|
|
25
|
-
@website https://www.lesli.tech
|
|
26
|
-
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
27
|
-
|
|
28
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
29
|
-
// ·
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// ·
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// ·
|
|
37
|
-
import application from "Lesli/vue/public"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// ·
|
|
41
|
-
application({
|
|
42
|
-
|
|
43
|
-
data() {
|
|
44
|
-
return {
|
|
45
|
-
loading: false,
|
|
46
|
-
translations: {
|
|
47
|
-
main: {}
|
|
48
|
-
},
|
|
49
|
-
sign_in: {
|
|
50
|
-
email: "",
|
|
51
|
-
password: ""
|
|
52
|
-
},
|
|
53
|
-
password_edit: {
|
|
54
|
-
new_password: "",
|
|
55
|
-
new_password_confirmation: ""
|
|
56
|
-
},
|
|
57
|
-
notification: {
|
|
58
|
-
message: "",
|
|
59
|
-
show: false,
|
|
60
|
-
type: ""
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
methods: {
|
|
65
|
-
|
|
66
|
-
postPasswordNew(event) {
|
|
67
|
-
|
|
68
|
-
this.notification.show = false
|
|
69
|
-
|
|
70
|
-
this.loading = true
|
|
71
|
-
|
|
72
|
-
event.preventDefault();
|
|
73
|
-
|
|
74
|
-
let data = {
|
|
75
|
-
user: {
|
|
76
|
-
email: this.sign_in.email.toLowerCase(),
|
|
77
|
-
password: this.sign_in.password
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
this.http.post("/password", data).then(response => {
|
|
82
|
-
this.showNotification("this.translations.main.notification_reset_password_instructions_sent", "success")
|
|
83
|
-
}).catch(error => {
|
|
84
|
-
this.showNotification(error.message)
|
|
85
|
-
}).finally(() => {
|
|
86
|
-
this.loading = false
|
|
87
|
-
})
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
putPasswordEdit(event) {
|
|
91
|
-
|
|
92
|
-
this.notification.show = false
|
|
93
|
-
|
|
94
|
-
this.loading = true
|
|
95
|
-
|
|
96
|
-
event.preventDefault();
|
|
97
|
-
|
|
98
|
-
// check if passwords match
|
|
99
|
-
if (this.password_edit.new_password != this.password_edit.new_password_confirmation) {
|
|
100
|
-
this.showNotification("this.translations.main.error_passwords_do_not_match", "danger")
|
|
101
|
-
return
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
var token=null
|
|
105
|
-
|
|
106
|
-
try {
|
|
107
|
-
token = Object.fromEntries(new URLSearchParams(window.location.search)).reset_password_token
|
|
108
|
-
} catch (error) {
|
|
109
|
-
token=null
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
this.http.put("/password", {
|
|
113
|
-
user: {
|
|
114
|
-
password: this.password_edit.new_password,
|
|
115
|
-
password_confirmation: this.password_edit.new_password_confirmation,
|
|
116
|
-
reset_password_token: token
|
|
117
|
-
}
|
|
118
|
-
}).then(response => {
|
|
119
|
-
this.showNotification("this.translations.main.notification_password_updated", "success")
|
|
120
|
-
//setTimeout(() => { this.url.go("/login") }, 2000)
|
|
121
|
-
}).catch(error => {
|
|
122
|
-
this.showNotification(error.message, "danger")
|
|
123
|
-
}).finally(() => {
|
|
124
|
-
this.loading = false
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
showNotification(message, type="danger"){
|
|
130
|
-
this.notification.message = message;
|
|
131
|
-
this.notification.type = "is-"+type;
|
|
132
|
-
this.notification.show = true;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
})
|