lesli_shield 0.1.1 → 1.0.1

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.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/lesli_shield/application.js +1 -4415
  3. data/app/assets/javascripts/lesli_shield/confirmations.js +1 -47
  4. data/app/assets/javascripts/lesli_shield/passwords.js +1 -699
  5. data/app/assets/javascripts/lesli_shield/registrations.js +1 -699
  6. data/app/assets/javascripts/lesli_shield/sessions.js +1 -699
  7. data/app/assets/stylesheets/lesli_shield/application.css +0 -3
  8. data/app/assets/stylesheets/lesli_shield/confirmations.css +0 -25828
  9. data/app/assets/stylesheets/lesli_shield/devise/oauth.css +1 -0
  10. data/app/assets/stylesheets/lesli_shield/passwords.css +1 -25812
  11. data/app/assets/stylesheets/lesli_shield/registrations.css +1 -26168
  12. data/app/assets/stylesheets/lesli_shield/sessions.css +1 -26168
  13. data/app/assets/stylesheets/lesli_shield/users.css +1 -0
  14. data/app/controllers/lesli_shield/application_controller.rb +2 -2
  15. data/app/controllers/lesli_shield/dashboards_controller.rb +8 -1
  16. data/app/controllers/lesli_shield/role/actions_controller.rb +46 -0
  17. data/app/controllers/lesli_shield/roles_controller.rb +182 -0
  18. data/app/controllers/lesli_shield/sessions_controller.rb +67 -0
  19. data/app/controllers/lesli_shield/settings_controller.rb +61 -0
  20. data/app/controllers/lesli_shield/users_controller.rb +90 -0
  21. data/app/controllers/users/confirmations_controller.rb +2 -1
  22. data/app/controllers/users/passwords_controller.rb +31 -35
  23. data/app/controllers/users/registrations_controller.rb +28 -33
  24. data/app/controllers/users/sessions_controller.rb +38 -48
  25. data/app/helpers/lesli_shield/sessions_helper.rb +4 -0
  26. data/app/helpers/lesli_shield/settings_helper.rb +4 -0
  27. data/app/helpers/lesli_shield/users_helper.rb +4 -0
  28. data/app/interfaces/lesli_shield/authentication_interface.rb +64 -0
  29. data/app/interfaces/lesli_shield/authorization_interface.rb +40 -0
  30. data/{db/migrate/v1/0801050210_create_lesli_shield_dashboard_components.rb → app/models/lesli_shield/account.rb} +8 -18
  31. data/app/models/lesli_shield/application_record.rb +3 -3
  32. data/app/models/lesli_shield/setting.rb +4 -0
  33. data/app/models/lesli_shield/user.rb +5 -0
  34. data/app/services/lesli_shield/tokens.rb +39 -0
  35. data/app/views/devise/confirmations/new.html.erb +14 -0
  36. data/app/views/devise/passwords/edit.html.erb +27 -69
  37. data/app/views/devise/passwords/new.html.erb +31 -73
  38. data/app/views/devise/registrations/new.html.erb +43 -97
  39. data/app/views/devise/sessions/new.html.erb +48 -68
  40. data/app/views/devise/shared/_demo.html.erb +6 -7
  41. data/app/views/devise/shared/_error_messages.html.erb +27 -13
  42. data/app/views/devise/shared/_links.html.erb +1 -1
  43. data/app/views/lesli_shield/dashboards/index.html.erb +8 -0
  44. data/app/views/lesli_shield/dashboards/show.html.erb +1 -1
  45. data/app/views/lesli_shield/partials/_navigation.html.erb +39 -0
  46. data/app/views/lesli_shield/roles/_form-information.html.erb +21 -0
  47. data/app/views/lesli_shield/roles/_form-privileges.html.erb +104 -0
  48. data/app/views/lesli_shield/roles/_session.html.erb +2 -0
  49. data/app/views/lesli_shield/roles/edit.html.erb +12 -0
  50. data/app/views/lesli_shield/roles/index.html.erb +45 -0
  51. data/app/views/lesli_shield/roles/new.html.erb +11 -0
  52. data/app/views/lesli_shield/roles/show.html.erb +13 -0
  53. data/app/views/lesli_shield/roles/update.turbo_stream.erb +3 -0
  54. data/app/views/lesli_shield/sessions/_form.html.erb +17 -0
  55. data/app/views/lesli_shield/sessions/_session.html.erb +2 -0
  56. data/app/views/lesli_shield/sessions/edit.html.erb +12 -0
  57. data/app/views/lesli_shield/sessions/index.html.erb +37 -0
  58. data/app/views/lesli_shield/sessions/new.html.erb +11 -0
  59. data/app/views/lesli_shield/sessions/show.html.erb +6 -0
  60. data/app/views/lesli_shield/settings/_form.html.erb +17 -0
  61. data/app/views/lesli_shield/settings/_setting.html.erb +2 -0
  62. data/app/views/lesli_shield/settings/edit.html.erb +12 -0
  63. data/app/views/lesli_shield/settings/index.html.erb +16 -0
  64. data/app/views/lesli_shield/settings/new.html.erb +11 -0
  65. data/app/views/lesli_shield/settings/show.html.erb +9 -0
  66. data/app/views/lesli_shield/users/_information-card.html.erb +49 -0
  67. data/app/views/lesli_shield/users/_information-form.html.erb +12 -0
  68. data/app/views/lesli_shield/users/_management-sessions.html.erb +27 -0
  69. data/app/views/lesli_shield/users/_viewer-activities.html.erb +5 -0
  70. data/app/views/lesli_shield/users/edit.html.erb +0 -0
  71. data/app/views/lesli_shield/users/index.html.erb +45 -0
  72. data/app/views/lesli_shield/users/new.html.erb +11 -0
  73. data/app/views/lesli_shield/users/show.html.erb +27 -0
  74. data/app/views/lesli_shield/users/update.turbo_stream.erb +3 -0
  75. data/config/locales/translations.en.yml +1 -22
  76. data/config/locales/translations.es.yml +1 -22
  77. data/config/locales/translations.fr.yml +1 -22
  78. data/config/locales/translations.it.yml +1 -22
  79. data/config/locales/translations.pt.yml +1 -22
  80. data/config/routes.rb +31 -7
  81. data/db/migrate/v1/0801000110_create_lesli_shield_accounts.rb +3 -8
  82. data/db/migrate/v1/0801001710_create_lesli_shield_settings.rb +37 -0
  83. data/db/migrate/v1/{0801050110_create_lesli_shield_dashboards.rb → 0801003010_create_lesli_shield_dashboards.rb} +3 -17
  84. data/db/migrate/v1/0801120310_create_lesli_shield_user_shortcuts.rb +44 -0
  85. data/db/migrate/v1/0801120410_create_lesli_shield_user_tokens.rb +46 -0
  86. data/lib/lesli_shield/engine.rb +1 -5
  87. data/lib/lesli_shield/routing.rb +0 -3
  88. data/lib/lesli_shield/version.rb +2 -2
  89. data/lib/scss/_devise-simple.scss +90 -0
  90. data/lib/scss/_devise.scss +162 -0
  91. data/lib/scss/application.scss +6 -0
  92. data/lib/scss/confirmations.scss +24 -24
  93. data/lib/scss/devise/oauth.scss +1 -1
  94. data/lib/scss/passwords.scss +4 -2
  95. data/lib/scss/registrations.scss +2 -2
  96. data/lib/scss/sessions.scss +2 -2
  97. data/lib/scss/users.scss +58 -0
  98. data/lib/tasks/lesli_shield_tasks.rake +49 -4
  99. data/lib/vue/application.js +7 -0
  100. data/lib/vue/apps/sessions/index.vue +50 -0
  101. data/lib/vue/stores/sessions.js +43 -0
  102. data/readme.md +32 -18
  103. metadata +67 -15
  104. data/app/views/layouts/lesli_shield/application.html.erb +0 -15
@@ -0,0 +1,44 @@
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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
+ =end
32
+
33
+ class CreateLesliShieldUserShortcuts < ActiveRecord::Migration[6.1]
34
+ def change
35
+ create_table :lesli_shield_user_shortcuts do |t|
36
+ t.string :name
37
+ t.string :icon
38
+ t.string :url
39
+ t.timestamps
40
+ end
41
+
42
+ add_reference(:lesli_shield_user_shortcuts, :user, foreign_key: { to_table: :lesli_users })
43
+ end
44
+ end
@@ -0,0 +1,46 @@
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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
+ =end
32
+
33
+ class CreateLesliShieldUserTokens < ActiveRecord::Migration[7.0]
34
+ def change
35
+ create_table :lesli_shield_user_tokens do |t|
36
+ t.string :name, null: false
37
+ t.string :token, null: false
38
+ t.string :source, null: false # OTP, Pass, Integration
39
+ t.datetime :expiration_at, index: true
40
+ t.datetime :deleted_at, index: true
41
+ t.timestamps
42
+ end
43
+ add_reference(:lesli_shield_user_tokens, :user, foreign_key: { to_table: :lesli_users }, index: true)
44
+ add_index(:lesli_shield_user_tokens, :token, unique: true)
45
+ end
46
+ end
@@ -30,15 +30,11 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  =end
32
32
 
33
-
34
- # · Tools used to build the Lesli Framework
35
- require "devise"
36
-
37
33
  module LesliShield
38
34
  class Engine < ::Rails::Engine
39
35
  isolate_namespace LesliShield
40
36
 
41
- initializer :lesli_admin do |app|
37
+ initializer :lesli_shield do |app|
42
38
 
43
39
  # register assets manifest
44
40
  config.assets.precompile += %w[lesli_shield_manifest.js]
@@ -1,8 +1,5 @@
1
1
  module LesliShield
2
2
  module Routing
3
- def self.mount_login
4
- mount_login_at()
5
- end
6
3
  def self.mount_login_at path=""
7
4
  Rails.application.routes.draw do
8
5
  devise_for :users, class_name: "Lesli::User", module: :devise,
@@ -1,4 +1,4 @@
1
1
  module LesliShield
2
- VERSION = "0.1.1"
3
- BUILD = "1728877698"
2
+ VERSION = "1.0.1"
3
+ BUILD = "1752635550"
4
4
  end
@@ -0,0 +1,90 @@
1
+ /*
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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
+
34
+ // ·
35
+ @use "lesli-css" as lesli;
36
+ @use "LesliAssets/lib/lesli_assets_css/templates/public";
37
+
38
+
39
+ // ·
40
+ main {
41
+ background: white;
42
+
43
+ // logo container
44
+ .hero-head {
45
+ padding: 8rem 0 4rem;
46
+
47
+ .lesli-logo {
48
+ max-width: 130px;
49
+ margin-bottom: 1rem;
50
+ }
51
+ }
52
+
53
+ // form container
54
+ .hero-body {
55
+ flex-direction: column;
56
+ background-color: whitesmoke;
57
+ border-top: 1px solid #ebebeb;
58
+
59
+ form {
60
+ width: 100%;
61
+ padding: 4rem;
62
+ max-width: 750px;
63
+ margin: 2rem auto;
64
+ border-radius: 6px;
65
+ border: 1px solid #ececec;
66
+ background-color: white;
67
+
68
+ .label {
69
+ font-size: 1.1rem;
70
+ font-weight: 600;
71
+ margin-bottom: 0;
72
+ color: lesli.lesli-color(slate, 500);
73
+ }
74
+ }
75
+
76
+ .links {
77
+ display: flex;
78
+
79
+ a {
80
+ display: flex;
81
+ align-items: center;
82
+ font-family: "OpenSans";
83
+ // add margin only to the middle links
84
+ &:not(:first-child):not(:last-child) {
85
+ margin: 0 1rem;
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,162 @@
1
+ /*
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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
+
34
+
35
+ // ·
36
+ @use "lesli-css" as lesli;
37
+ @use "LesliAssets/lib/lesli_assets_css/templates/public";
38
+
39
+
40
+ // ·
41
+ .shield-form-demo {
42
+ width: 100%;
43
+ border-radius: 4px;
44
+ border: 1px solid silver;
45
+ }
46
+
47
+
48
+ // · reusable background styles
49
+ @mixin lesli-login-background() {
50
+ background: linear-gradient(0deg,
51
+ rgba(49, 106, 255, 0.4),
52
+ rgba(49, 106, 255, 0.4)),
53
+ url("lesli/brand/login-background.jpg");
54
+ background-position: center;
55
+ background-size: cover;
56
+ }
57
+
58
+
59
+ // column with image background right side
60
+ .column.background {
61
+ @include lesli-login-background;
62
+ }
63
+
64
+
65
+ // login form container
66
+ .column.login-form {
67
+ max-width: 550px;
68
+ margin: 0 auto;
69
+
70
+ // logo container
71
+ .logo {
72
+ img {
73
+ width: initial;
74
+ height: initial;
75
+ }
76
+ p {
77
+ font-weight: 600;
78
+ text-align: left;
79
+ }
80
+ }
81
+
82
+ .is-title {
83
+ line-height: 1.2;
84
+ max-width: 400px;
85
+ }
86
+
87
+ form {
88
+ max-width: 310px;
89
+
90
+ label {
91
+ font-weight: 400;
92
+ font-size: 15px;
93
+ line-height: 150%;
94
+ }
95
+
96
+ input {
97
+ border-radius: 6px;
98
+ box-shadow: none;
99
+ }
100
+
101
+ input[type="password"] {
102
+ font-family: Verdana;
103
+ letter-spacing: 0.1rem;
104
+ }
105
+
106
+ p.help {
107
+ font-weight: 600;
108
+ }
109
+
110
+ p.account {
111
+ font-size: 15px;
112
+ font-weight: 400;
113
+ }
114
+ }
115
+
116
+ .links {
117
+
118
+ a {
119
+ width: 100%;
120
+ display: flex;
121
+ flex-grow: 1;
122
+ padding: .8rem 0;
123
+ &:not(:last-child) {
124
+ border-bottom: 1px solid lesli-css-color(silver, 300);
125
+ }
126
+ }
127
+
128
+ span {
129
+ font-family: "Domine";
130
+ font-weight: 500;
131
+ font-size: 14px;
132
+ }
133
+ }
134
+
135
+ .terms {
136
+ font-size: 13px;
137
+ line-height: 19px;
138
+ }
139
+ }
140
+
141
+ @include lesli.lesli-breakpoint-until-tablet() {
142
+
143
+ // login column must be full width on mobile
144
+ .column.login-form {
145
+ width: 100%;
146
+ max-width: 100%;
147
+ @include lesli-login-background;
148
+
149
+ .hero {
150
+ padding: 2rem 0;
151
+ }
152
+
153
+ // center the form
154
+ .hero-body {
155
+ margin: 0 auto;
156
+ max-width: 500px;
157
+ background-color: white;
158
+ border-radius: 6px;
159
+ padding: 1rem 3rem;
160
+ }
161
+ }
162
+ }
@@ -0,0 +1,6 @@
1
+
2
+
3
+ // // ·
4
+ // body.lesli_shield-users {
5
+ // @import "./users";
6
+ // }
@@ -32,27 +32,27 @@ Building a better future, one line of code at a time.
32
32
 
33
33
 
34
34
  // ·
35
- @import "Lesli/scss/pages/devise-simple";
36
-
37
-
38
- // ·
39
- div.confirmation-message {
40
- //box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
41
- padding: 4rem 0 5rem;
42
- text-align: center;
43
- max-width: 800px;
44
- margin: 0 auto;
45
- width: 90%;
46
-
47
- svg {
48
- max-width: 90px;
49
- margin-bottom: 1rem;
50
- fill: lesli-css-color(lime, 300);
51
- }
52
-
53
- p {
54
- font-weight: 100;
55
- font-size: 2rem;
56
- }
57
-
58
- }
35
+ // @import "Lesli/scss/pages/devise-simple";
36
+
37
+
38
+ // // ·
39
+ // div.confirmation-message {
40
+ // //box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
41
+ // padding: 4rem 0 5rem;
42
+ // text-align: center;
43
+ // max-width: 800px;
44
+ // margin: 0 auto;
45
+ // width: 90%;
46
+
47
+ // svg {
48
+ // max-width: 90px;
49
+ // margin-bottom: 1rem;
50
+ // fill: lesli-css-color(lime, 300);
51
+ // }
52
+
53
+ // p {
54
+ // font-weight: 100;
55
+ // font-size: 2rem;
56
+ // }
57
+
58
+ // }
@@ -31,4 +31,4 @@ Building a better future, one line of code at a time.
31
31
 
32
32
  */
33
33
 
34
- @import "templates/component";
34
+ //@import "templates/component";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Lesli
4
4
 
5
- Copyright (c) 2023, Lesli Technologies, S. A.
5
+ Copyright (c) 2025, Lesli Technologies, S. A.
6
6
 
7
7
  This program is free software: you can redistribute it and/or modify
8
8
  it under the terms of the GNU General Public License as published by
@@ -30,4 +30,6 @@ Building a better future, one line of code at a time.
30
30
  // ·
31
31
  */
32
32
 
33
- @import "Lesli/scss/pages/devise-simple";
33
+
34
+ // ·
35
+ @use "devise-simple";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Lesli
4
4
 
5
- Copyright (c) 2023, Lesli Technologies, S. A.
5
+ Copyright (c) 2025, Lesli Technologies, S. A.
6
6
 
7
7
  This program is free software: you can redistribute it and/or modify
8
8
  it under the terms of the GNU General Public License as published by
@@ -32,4 +32,4 @@ Building a better future, one line of code at a time.
32
32
 
33
33
 
34
34
  // ·
35
- @import "Lesli/scss/pages/devise";
35
+ @use "devise";
@@ -2,7 +2,7 @@
2
2
 
3
3
  Lesli
4
4
 
5
- Copyright (c) 2023, Lesli Technologies, S. A.
5
+ Copyright (c) 2025, Lesli Technologies, S. A.
6
6
 
7
7
  This program is free software: you can redistribute it and/or modify
8
8
  it under the terms of the GNU General Public License as published by
@@ -32,4 +32,4 @@ Building a better future, one line of code at a time.
32
32
 
33
33
 
34
34
  // ·
35
- @import "Lesli/scss/pages/devise";
35
+ @use "devise";
@@ -0,0 +1,58 @@
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
+ // @import "Lesli/scss/templates/component";
33
+
34
+
35
+ // // ·
36
+ // .user-information-card {
37
+
38
+ // .lesli-element-avatar {
39
+ // border: 2px solid var(--lesli-color-primary, lesli-css-color(blue));
40
+ // span {
41
+ // color: var(--lesli-color-primary, lesli-css-color(blue)) !important;
42
+ // }
43
+ // }
44
+ // }
45
+
46
+
47
+ // @include lesli-css-breakpoint-mobile {
48
+ // .user-information-card {
49
+
50
+ // .level.is-mobile {
51
+ // justify-content: center;
52
+ // }
53
+
54
+ // p, a, h5 {
55
+ // text-align: center;
56
+ // }
57
+ // }
58
+ // }
@@ -1,4 +1,49 @@
1
- # desc "Explaining what the task does"
2
- # task :lesli_shield do
3
- # # Task goes here
4
- # end
1
+ =begin
2
+
3
+ Lesli
4
+
5
+ Copyright (c) 2025, 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 LesliTech
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
+ =end
32
+
33
+ namespace :lesli_shield do
34
+
35
+ desc "Syncing privileges for all the available roles"
36
+ task :privileges => :environment do |task, args|
37
+ role_sync_privileges()
38
+ end
39
+
40
+ # Drop, build, migrate & seed database (development only)
41
+ def role_sync_privileges
42
+
43
+ Lesli::Role.all.each do |role|
44
+ Lesli::RoleOperator.new(role).synchronize
45
+ end
46
+
47
+ L2.msg("LesliShield: Syncing privileges for all the available roles")
48
+ end
49
+ end
@@ -44,6 +44,10 @@ import appDashboardShow from "Lesli/vue/shared/dashboards/apps/show.vue"
44
44
  import appDashboardEdit from "Lesli/vue/shared/dashboards/apps/edit.vue"
45
45
 
46
46
 
47
+ // ·
48
+ import appSessionIndex from "LesliShield/vue/apps/sessions/index.vue"
49
+
50
+
47
51
  // ·
48
52
  import componentDashboardEngineVersion from "LesliShield/vue/apps/dashboards/components/engine-version.vue"
49
53
 
@@ -73,4 +77,7 @@ application("LesliShield", [{
73
77
  path: "/dashboards/:id/edit",
74
78
  component: appDashboardEdit,
75
79
  props: dashboardProps
80
+ }, {
81
+ path: "/sessions",
82
+ component: appSessionIndex
76
83
  }])
@@ -0,0 +1,50 @@
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>