lesli_audit 1.0.2 → 1.1.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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/lesli_audit/application.tailwind.css +2 -0
  3. data/app/controllers/lesli_audit/users_controller.rb +1 -2
  4. data/app/controllers/lesli_audit/visitors_controller.rb +14 -0
  5. data/app/interfaces/lesli_audit/logger_interface.rb +22 -29
  6. data/app/models/concerns/lesli_audit/user_associations.rb +11 -0
  7. data/app/services/lesli_audit/user_service.rb +105 -12
  8. data/app/services/lesli_audit/{analytic_service.rb → visitor_service.rb} +121 -24
  9. data/app/views/lesli_audit/partials/_navigation.html.erb +1 -1
  10. data/app/views/lesli_audit/requests/index.html.erb +1 -1
  11. data/app/views/lesli_audit/users/index.html.erb +75 -37
  12. data/app/views/lesli_audit/visitors/index.html.erb +164 -0
  13. data/config/routes.rb +1 -1
  14. data/db/migrate/v1.0/0501110210_create_lesli_audit_account_devices.rb +2 -1
  15. data/db/seed/devices.rb +23 -15
  16. data/db/seed/users.rb +117 -0
  17. data/db/seeds.rb +2 -2
  18. data/lib/lesli_audit/engine.rb +6 -0
  19. data/lib/lesli_audit/version.rb +2 -2
  20. data/readme.md +113 -49
  21. metadata +12 -50
  22. data/app/assets/config/lesli_audit_manifest.js +0 -37
  23. data/app/controllers/lesli_audit/analytics_controller.rb +0 -23
  24. data/app/controllers/lesli_audit/user_journals_controller.rb +0 -60
  25. data/app/helpers/lesli_audit/analytics_helper.rb +0 -4
  26. data/app/views/lesli_audit/analytics/index.html.erb +0 -44
  27. data/app/views/lesli_audit/user_journals/_form.html.erb +0 -17
  28. data/app/views/lesli_audit/user_journals/_user_journal.html.erb +0 -2
  29. data/app/views/lesli_audit/user_journals/edit.html.erb +0 -12
  30. data/app/views/lesli_audit/user_journals/index.html.erb +0 -16
  31. data/app/views/lesli_audit/user_journals/new.html.erb +0 -11
  32. data/app/views/lesli_audit/user_journals/show.html.erb +0 -10
  33. data/app/views/lesli_audit/users/show.html.erb +0 -10
  34. data/lib/scss/application.scss +0 -31
  35. data/lib/vue/application.js +0 -146
  36. data/lib/vue/apps/accounts/activities.vue +0 -48
  37. data/lib/vue/apps/analytics/index.vue +0 -56
  38. data/lib/vue/apps/analytics/trends.vue +0 -148
  39. data/lib/vue/apps/dashboards/components/roles.vue +0 -71
  40. data/lib/vue/apps/dashboards/components/users.vue +0 -71
  41. data/lib/vue/apps/dashboards/show.vue +0 -8
  42. data/lib/vue/apps/requests/index.vue +0 -125
  43. data/lib/vue/apps/security/passwords.vue +0 -52
  44. data/lib/vue/apps/security/sessions.vue +0 -63
  45. data/lib/vue/apps/users/activities.vue +0 -49
  46. data/lib/vue/apps/users/index.vue +0 -89
  47. data/lib/vue/apps/users/logs.vue +0 -49
  48. data/lib/vue/apps/users/registrations.vue +0 -73
  49. data/lib/vue/apps/users/roles.vue +0 -70
  50. data/lib/vue/apps/users/workingHours.vue +0 -52
  51. data/lib/vue/components/requests.vue +0 -63
  52. data/lib/vue/components/visitors.vue +0 -76
  53. data/lib/vue/stores/accounts/activities.js +0 -87
  54. data/lib/vue/stores/analytics.js +0 -127
  55. data/lib/vue/stores/request.js +0 -70
  56. data/lib/vue/stores/security/password.js +0 -75
  57. data/lib/vue/stores/security/session.js +0 -78
  58. data/lib/vue/stores/translations.json +0 -162
  59. data/lib/vue/stores/users/activities.js +0 -76
  60. data/lib/vue/stores/users/logs.js +0 -74
  61. data/lib/vue/stores/users/registrations.js +0 -61
  62. data/lib/vue/stores/users/roles.js +0 -52
  63. data/lib/vue/stores/users/working_hours.js +0 -92
  64. data/lib/vue/stores/users.js +0 -56
@@ -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>
@@ -1,87 +0,0 @@
1
- /*
2
- Copyright (c) 2022, all rights reserved.
3
-
4
- All the information provided by this platform is protected by international laws related to
5
- industrial property, intellectual property, copyright and relative international laws.
6
- All intellectual or industrial property rights of the code, texts, trade mark, design,
7
- pictures and any other information belongs to the owner of this platform.
8
-
9
- Without the written permission of the owner, any replication, modification,
10
- transmission, publication is strictly forbidden.
11
-
12
- For more information read the license file including with this software.
13
-
14
- // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
15
- // ·
16
- */
17
-
18
-
19
- // ·
20
- import { defineStore } from "pinia"
21
-
22
-
23
- // ·
24
- export const useAccountsActivities = defineStore("accountsActivities", {
25
- state: () => {
26
- return {
27
- loading: false,
28
- pagination: {},
29
- records: [],
30
- columns: [{
31
- field: "id",
32
- label: "ID"
33
- }, {
34
- field: "title",
35
- label: "Title"
36
- }, {
37
- field: "description",
38
- label: "Description"
39
- }, {
40
- field: "system_process",
41
- label: "Process"
42
- }, {
43
- field: "system_module",
44
- label: "Module"
45
- }, {
46
- field: "created_at_date",
47
- label: "Date"
48
- },{
49
- field: "send_to",
50
- label: "Send to"
51
- }]
52
- }
53
- },
54
- actions: {
55
-
56
- fetchIfEmpty() {
57
- if (this.records.length <= 0) {
58
- this.fetch()
59
- }
60
- },
61
-
62
- search(string) {
63
- this.http.get(this.url.audit("accounts/activities").search(string)).then(result => {
64
- this.records = result.records
65
- this.pagination = result.pagination
66
- }).catch(error => {
67
- this.msg.danger("Error while trying to fetch data")
68
- }).finally(() => {
69
- this.loading = false
70
- })
71
- },
72
-
73
- fetch() {
74
- this.$reset()
75
- this.loading = true
76
- this.http.get(this.url.audit("accounts/activities")).then(result => {
77
- this.records = result.records
78
- this.pagination = result.pagination
79
- }).catch(error => {
80
-
81
- }).finally(() => {
82
- this.loading = false
83
- })
84
- }
85
-
86
- }
87
- })
@@ -1,127 +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 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
- import { defineStore } from "pinia"
36
-
37
-
38
- // ·
39
- export const useAnalytics = defineStore("analytics", {
40
- state: () => {
41
- return {
42
- users: {
43
- loading: false,
44
- pagination: {},
45
- records: [],
46
- columns: [{
47
- field: 'email',
48
- label: 'User'
49
- }, {
50
- field: 'resources',
51
- label: 'Resources'
52
- }, {
53
- field: 'requests',
54
- label: 'Requests'
55
- }]
56
- },
57
- visitors: {
58
- loading: false,
59
- pagination: {},
60
- records: []
61
- },
62
- controllers: {
63
- loading: false,
64
- pagination: {},
65
- records: [],
66
- columns: [{
67
- field: 'request_controller',
68
- label: 'Controller'
69
- }, {
70
- field: 'requests',
71
- label: 'Requests'
72
- }]
73
- },
74
- trends: {
75
- loading: false,
76
- recordsDays: [],
77
- recordsHours: []
78
- }
79
- }
80
- },
81
- actions: {
82
-
83
- fetchVisits() {
84
- this.visitors.loading = true
85
- this.http.get(this.url.audit("analytics/visitors")).then(result => {
86
- this.visitors.records = result.map(record => {
87
- record.date = this.date(record.date).date()
88
- return record
89
- }).reverse()
90
- }).finally(() => {
91
- this.visitors.loading = false
92
- })
93
- },
94
-
95
- fetchUsers() {
96
- this.users.loading = true
97
- this.http.get(this.url.audit("analytics/users")).then(result => {
98
- this.users.records = result
99
- }).finally(() => {
100
- this.users.loading = false
101
- })
102
- },
103
-
104
- fetchControllers() {
105
- this.controllers.loading = true
106
- this.http.get(this.url.audit("analytics/controllers")).then(result => {
107
- this.controllers.records = result
108
- }).finally(() => {
109
- this.controllers.loading = false
110
- })
111
- },
112
-
113
- time(period,initalDate, endDate){
114
- this.http.get(this.url.audit("analytics/trends")
115
- .filter({ groupBy: [period], startDate: [initalDate], finalDate: [endDate] }))
116
- .then(result => {
117
- if (period ==='day'){
118
- this.trends.recordsDays = result
119
- } else if (period ==='hour'){
120
- this.trends.recordsHours = result
121
- }
122
- }).finally(() => {
123
- this.loading = false
124
- })
125
- }
126
- }
127
- })