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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/lesli_audit/users_controller.rb +1 -2
  3. data/app/controllers/lesli_audit/visitors_controller.rb +14 -0
  4. data/app/interfaces/lesli_audit/logger_interface.rb +22 -29
  5. data/app/services/lesli_audit/user_service.rb +105 -12
  6. data/app/services/lesli_audit/{analytic_service.rb → visitor_service.rb} +121 -24
  7. data/app/views/lesli_audit/partials/_navigation.html.erb +1 -1
  8. data/app/views/lesli_audit/requests/index.html.erb +1 -1
  9. data/app/views/lesli_audit/users/index.html.erb +36 -4
  10. data/app/views/lesli_audit/visitors/index.html.erb +118 -0
  11. data/config/routes.rb +1 -1
  12. data/db/migrate/v1.0/0501110210_create_lesli_audit_account_devices.rb +2 -1
  13. data/db/seed/devices.rb +23 -15
  14. data/db/seed/users.rb +117 -0
  15. data/db/seeds.rb +2 -2
  16. data/lib/lesli_audit/version.rb +2 -2
  17. metadata +10 -50
  18. data/app/assets/config/lesli_audit_manifest.js +0 -37
  19. data/app/controllers/lesli_audit/analytics_controller.rb +0 -23
  20. data/app/controllers/lesli_audit/user_journals_controller.rb +0 -60
  21. data/app/helpers/lesli_audit/analytics_helper.rb +0 -4
  22. data/app/views/lesli_audit/analytics/index.html.erb +0 -44
  23. data/app/views/lesli_audit/user_journals/_form.html.erb +0 -17
  24. data/app/views/lesli_audit/user_journals/_user_journal.html.erb +0 -2
  25. data/app/views/lesli_audit/user_journals/edit.html.erb +0 -12
  26. data/app/views/lesli_audit/user_journals/index.html.erb +0 -16
  27. data/app/views/lesli_audit/user_journals/new.html.erb +0 -11
  28. data/app/views/lesli_audit/user_journals/show.html.erb +0 -10
  29. data/app/views/lesli_audit/users/show.html.erb +0 -10
  30. data/lib/scss/application.scss +0 -31
  31. data/lib/vue/application.js +0 -146
  32. data/lib/vue/apps/accounts/activities.vue +0 -48
  33. data/lib/vue/apps/analytics/index.vue +0 -56
  34. data/lib/vue/apps/analytics/trends.vue +0 -148
  35. data/lib/vue/apps/dashboards/components/roles.vue +0 -71
  36. data/lib/vue/apps/dashboards/components/users.vue +0 -71
  37. data/lib/vue/apps/dashboards/show.vue +0 -8
  38. data/lib/vue/apps/requests/index.vue +0 -125
  39. data/lib/vue/apps/security/passwords.vue +0 -52
  40. data/lib/vue/apps/security/sessions.vue +0 -63
  41. data/lib/vue/apps/users/activities.vue +0 -49
  42. data/lib/vue/apps/users/index.vue +0 -89
  43. data/lib/vue/apps/users/logs.vue +0 -49
  44. data/lib/vue/apps/users/registrations.vue +0 -73
  45. data/lib/vue/apps/users/roles.vue +0 -70
  46. data/lib/vue/apps/users/workingHours.vue +0 -52
  47. data/lib/vue/components/requests.vue +0 -63
  48. data/lib/vue/components/visitors.vue +0 -76
  49. data/lib/vue/stores/accounts/activities.js +0 -87
  50. data/lib/vue/stores/analytics.js +0 -127
  51. data/lib/vue/stores/request.js +0 -70
  52. data/lib/vue/stores/security/password.js +0 -75
  53. data/lib/vue/stores/security/session.js +0 -78
  54. data/lib/vue/stores/translations.json +0 -162
  55. data/lib/vue/stores/users/activities.js +0 -76
  56. data/lib/vue/stores/users/logs.js +0 -74
  57. data/lib/vue/stores/users/registrations.js +0 -61
  58. data/lib/vue/stores/users/roles.js +0 -52
  59. data/lib/vue/stores/users/working_hours.js +0 -92
  60. data/lib/vue/stores/users.js +0 -56
@@ -1,52 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
4
-
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { onMounted } from "vue"
22
-
23
-
24
- // · import lesli stores
25
- import { useSecurityPassword } from "CloudAudit/stores/security/password"
26
-
27
-
28
- // · implement lesli stores
29
- const store = useSecurityPassword()
30
-
31
-
32
- // · initializing
33
- onMounted(() => {
34
- store.fetchIfEmpty()
35
- })
36
-
37
- </script>
38
- <template>
39
- <section class="application-component">
40
- <lesli-header
41
- title="Restore password emails"
42
- @reload="store.fetch()">
43
- </lesli-header>
44
- <lesli-toolbar @search="store.search"></lesli-toolbar>
45
- <lesli-table
46
- :pagination="store.pagination"
47
- :loading="store.loading"
48
- :columns="store.columns"
49
- :records="store.records">
50
- </lesli-table>
51
- </section>
52
- </template>
@@ -1,63 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
4
-
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { ref, reactive, onMounted, watch, computed } from "vue"
22
-
23
-
24
- // · import lesli stores
25
- import { useSecuritySession } from "CloudAudit/stores/security/session"
26
-
27
-
28
- // · implement lesli stores
29
- const store = useSecuritySession()
30
-
31
-
32
- // · initializing
33
- onMounted(() => {
34
- store.fetchIfEmpty()
35
- })
36
-
37
- </script>
38
- <script>
39
- export default {
40
- methods: {
41
- // Method that allow to go to a user profile from the sessions table
42
- showUser(user) {
43
- this.url.admin("users/:id", user.id).go()
44
- }
45
- }
46
- }
47
- </script>
48
- <template>
49
- <section class="application-component">
50
- <lesli-header
51
- title="User sessions"
52
- @reload="store.fetch()">
53
- </lesli-header>
54
- <lesli-toolbar @search="store.search"></lesli-toolbar>
55
- <lesli-table
56
- :pagination="store.pagination"
57
- :loading="store.loading"
58
- :columns="store.columns"
59
- :records="store.records"
60
- @click="showUser">
61
- </lesli-table>
62
- </section>
63
- </template>
@@ -1,49 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
4
-
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { ref, reactive, onMounted, watch, computed } from "vue"
22
-
23
-
24
- // · import stores
25
- import { useUsersActivities } from "CloudAudit/stores/users/activities"
26
-
27
-
28
- // · implement stores
29
- const storeUsersActivities = useUsersActivities()
30
-
31
-
32
- // · initializing
33
- onMounted(() => {
34
- storeUsersActivities.fetchIfEmpty()
35
- })
36
-
37
- </script>
38
- <template>
39
- <application-component>
40
- <lesli-header title="Working hours"></lesli-header>
41
- <lesli-toolbar @search="storeUsersActivities.search"></lesli-toolbar>
42
- <lesli-table
43
- :pagination="storeUsersActivities.pagination"
44
- :columns="storeUsersActivities.columns"
45
- :records="storeUsersActivities.records"
46
- @sort="storeUsersActivities.sort">
47
- </lesli-table>
48
- </application-component>
49
- </template>
@@ -1,89 +0,0 @@
1
- <script setup>
2
- /*
3
-
4
- Lesli
5
-
6
- Copyright (c) 2023, Lesli Technologies, S. A.
7
-
8
- This program is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 3 of the License, or
11
- (at your option) any later version.
12
-
13
- This program is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with this program. If not, see http://www.gnu.org/licenses/.
20
-
21
- Lesli · Ruby on Rails SaaS Development Framework.
22
-
23
- Made with ♥ by LesliTech
24
- Building a better future, one line of code at a time.
25
-
26
- @contact hello@lesli.tech
27
- @website https://www.lesli.tech
28
- @license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
29
-
30
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
31
- // ·
32
- */
33
-
34
-
35
- // · import vue tools
36
- import { onMounted, ref } from "vue"
37
-
38
-
39
- // · import stores
40
- import componentRegistrations from "./registrations.vue"
41
-
42
-
43
- // · import stores
44
- import { useUsers } from "LesliAudit/vue/stores/users"
45
-
46
-
47
- // · implement stores
48
- const storeUsers = useUsers()
49
-
50
-
51
- // ·
52
- var selectedPeriod = ref("month");
53
-
54
-
55
- // ·
56
- function updateDate(){
57
- // filterPeriod = selectedPeriod.value;
58
- // storeUsersRegistrations.fetch(filterPeriod)
59
- }
60
-
61
- </script>
62
- <template>
63
- <lesli-application-container>
64
- <lesli-header title="Users">
65
- <lesli-select
66
- id = "selectPeriod"
67
- @change="updateDate"
68
- v-model = "selectedPeriod"
69
- :options="[{
70
- label: 'Year',
71
- value: 'year'
72
- }, {
73
- label: 'Month',
74
- value: 'month'
75
- }, {
76
- label: 'Week',
77
- value: 'week'
78
- }, {
79
- label: 'Day',
80
- value: 'day'
81
- }]">
82
- </lesli-select>
83
- </lesli-header>
84
- <component-registrations>
85
- </component-registrations>
86
- </lesli-application-container>
87
- </template>
88
- <style>
89
- </style>
@@ -1,49 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
4
-
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { ref, reactive, onMounted, watch, computed } from "vue"
22
-
23
-
24
- // · import stores
25
- import { useUsersLogs } from "CloudAudit/stores/users/logs"
26
-
27
-
28
- // · implement stores
29
- const storeUsersLogs = useUsersLogs()
30
-
31
-
32
- // · initializing
33
- onMounted(() => {
34
- storeUsersLogs.fetchIfEmpty()
35
- })
36
-
37
- </script>
38
- <template>
39
- <application-component>
40
- <lesli-header title="User logs"></lesli-header>
41
- <lesli-toolbar @search="storeUsersLogs.search"></lesli-toolbar>
42
- <lesli-table
43
- :pagination="storeUsersLogs.pagination"
44
- :columns="storeUsersLogs.columns"
45
- :records="storeUsersLogs.records"
46
- @sort="storeUsersLogs.sort">
47
- </lesli-table>
48
- </application-component>
49
- </template>
@@ -1,73 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
4
-
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { ref, reactive, onMounted, watch, computed } from "vue"
22
-
23
-
24
- // · import Lesli components
25
- import { lesliChartBar } from "lesli-vue/components"
26
-
27
-
28
- // · import stores
29
- import { useUsers } from "LesliAudit/vue/stores/users"
30
-
31
-
32
- // · implement stores
33
- const storeUsers = useUsers()
34
-
35
-
36
- // · define variables
37
- var registrationSeries = ref([]);
38
-
39
-
40
- // · initializing
41
- onMounted(() => {
42
- storeUsers.getRegistrations()
43
- })
44
-
45
-
46
- // ·
47
- watch(() => storeUsers.registrations, (oldData, newData) => {
48
-
49
- if (storeUsers.registrations.length == 0) {
50
- return
51
- }
52
-
53
- registrationSeries.value = [{
54
- data: storeUsers.registrations.map(registration => {
55
- return {
56
- x: registration.date,
57
- y: registration.count
58
- }
59
- })
60
- }]
61
- })
62
-
63
- </script>
64
- <template>
65
- <lesli-application-component>
66
- <lesli-chart-bar
67
- title="Registrations by date"
68
- :series="registrationSeries"
69
- @marker-click="markerClick">
70
- </lesli-chart-bar>
71
- </lesli-application-component>
72
- </template>
73
-
@@ -1,70 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
4
-
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { ref, reactive, onMounted, watch, computed } from "vue"
22
-
23
-
24
- // · import Lesli components
25
- import chartBar from "Lesli/components/charts/bar.vue"
26
-
27
-
28
- // · import stores
29
- import { useUsersRoles } from "CloudAudit/stores/users/roles"
30
-
31
-
32
- // · implement stores
33
- const storeUsersRoles = useUsersRoles()
34
-
35
-
36
- // · define variables
37
- const usersByRole = ref([]);
38
-
39
-
40
- // · initializing
41
- onMounted(() => {
42
- storeUsersRoles.fetchIfEmpty()
43
- })
44
-
45
-
46
- // · users by role
47
- watch(() => storeUsersRoles.records, () => {
48
- usersByRole.value = []
49
- storeUsersRoles.records.forEach(role => {
50
- usersByRole.value.push({
51
- x: role.name,
52
- y: role.users
53
- })
54
- })
55
- })
56
-
57
- </script>
58
- <template>
59
- <section class="application-component">
60
- <lesli-header title="Users by role" @reload="storeRegistration.reload()">
61
- </lesli-header>
62
- <div class="card">
63
- <div class="card-content">
64
- <chartBar :series="usersByRole">
65
- </chartBar>
66
- </div>
67
- </div>
68
- </section>
69
- </template>
70
-
@@ -1,52 +0,0 @@
1
- <script setup>
2
- /*
3
- Copyright (c) 2022, all rights reserved.
4
-
5
- All the information provided by this platform is protected by international laws related to
6
- industrial property, intellectual property, copyright and relative international laws.
7
- All intellectual or industrial property rights of the code, texts, trade mark, design,
8
- pictures and any other information belongs to the owner of this platform.
9
-
10
- Without the written permission of the owner, any replication, modification,
11
- transmission, publication is strictly forbidden.
12
-
13
- For more information read the license file including with this software.
14
-
15
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
- // ·
17
- */
18
-
19
-
20
- // · import vue tools
21
- import { ref, reactive, onMounted, watch, computed } from "vue"
22
-
23
-
24
- // · import Lesli components
25
- import chartLine from "Lesli/components/charts/line.vue"
26
-
27
-
28
- // · import stores
29
- import { useUsersWorkingHours } from "CloudAudit/stores/users/working_hours"
30
-
31
-
32
- // · implement stores
33
- const storeUsersWorkingHours = useUsersWorkingHours()
34
-
35
-
36
- // · initializing
37
- onMounted(() => {
38
- storeUsersWorkingHours.fetch()
39
- })
40
-
41
- </script>
42
- <template>
43
- <application-component>
44
- <lesli-header title="Working hours"></lesli-header>
45
- <lesli-toolbar @search="storeUsersWorkingHours.search"></lesli-toolbar>
46
- <lesli-table
47
- :columns="storeUsersWorkingHours.columns"
48
- :records="storeUsersWorkingHours.records"
49
- @sort="storeUsersWorkingHours.sort">
50
- </lesli-table>
51
- </application-component>
52
- </template>
@@ -1,63 +0,0 @@
1
- <script setup>
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
- */
32
-
33
-
34
- // · import vue tools
35
- import { } from "vue"
36
-
37
-
38
- // · import stores
39
- import { useAnalytics } from "LesliAudit/vue/stores/analytics"
40
-
41
-
42
- // · implement stores
43
- const storeAnalytics = useAnalytics()
44
-
45
- </script>
46
- <template>
47
- <div class="columns">
48
- <div class="column">
49
- <h3>Most active users</h3>
50
- <lesli-table
51
- :columns="storeAnalytics.users.columns"
52
- :records="storeAnalytics.users.records">
53
- </lesli-table>
54
- </div>
55
- <div class="column">
56
- <h3>Most active controllers</h3>
57
- <lesli-table
58
- :columns="storeAnalytics.controllers.columns"
59
- :records="storeAnalytics.controllers.records">
60
- </lesli-table>
61
- </div>
62
- </div>
63
- </template>
@@ -1,76 +0,0 @@
1
- <script setup>
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
- */
32
-
33
-
34
- // · import vue tools
35
- import { ref, reactive, onMounted, watch, computed } from "vue"
36
-
37
-
38
- // · import Lesli components
39
- import { lesliChartLine } from "lesli-vue/components"
40
-
41
-
42
- // · import stores
43
- import { useAnalytics } from "LesliAudit/vue/stores/analytics"
44
-
45
-
46
- // · implement stores
47
- const storeAnalytics = useAnalytics()
48
-
49
-
50
- // · define variables
51
- var series = ref([]);
52
- var labels = ref([]);
53
-
54
-
55
- // ·
56
- watch(() => storeAnalytics.visitors.records, () => {
57
- labels.value = storeAnalytics.visitors.records.map(visit => visit.date)
58
- series.value = [{
59
- name: "Requests",
60
- data: storeAnalytics.visitors.records.map(visit => visit.requests)
61
- }, {
62
- name: "Resources",
63
- data: storeAnalytics.visitors.records.map(visit => visit.resources)
64
- }]
65
- })
66
-
67
- </script>
68
- <template>
69
- <lesli-application-component>
70
- <lesli-chart-line
71
- :title="'Visitors'"
72
- :series="series"
73
- :labels="labels">
74
- </lesli-chart-line>
75
- </lesli-application-component>
76
- </template>