lesli_audit 0.4.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/lesli_audit/application.js +2776 -1688
- data/app/assets/stylesheets/lesli_audit/application.css +35 -0
- data/app/controllers/lesli_audit/dashboards_controller.rb +26 -49
- data/app/controllers/lesli_audit/users_controller.rb +35 -0
- data/app/helpers/lesli_audit/dashboard/components_helper.rb +4 -0
- data/app/models/lesli_audit/account.rb +7 -0
- data/app/models/lesli_audit/dashboard/component.rb +18 -0
- data/app/models/lesli_audit/dashboard.rb +30 -2
- data/app/services/lesli_audit/account/activity_services.rb +2 -2
- data/app/services/lesli_audit/analytics/trend_services.rb +2 -2
- data/app/services/lesli_audit/user_service.rb +63 -0
- data/app/services/lesli_audit/users/activity_services.rb +2 -2
- data/app/services/lesli_audit/users/log_services.rb +2 -2
- data/app/services/lesli_audit/users/registration_services.rb +2 -2
- data/app/services/lesli_audit/users/role_services.rb +2 -2
- data/app/services/lesli_audit/users/working_hour_services.rb +2 -2
- data/app/views/lesli_audit/dashboard/components/_component.html.erb +2 -0
- data/app/views/lesli_audit/dashboard/components/_form.html.erb +17 -0
- data/app/views/lesli_audit/dashboard/components/edit.html.erb +1 -0
- data/app/views/lesli_audit/dashboard/components/index.html.erb +14 -0
- data/app/views/lesli_audit/dashboard/components/new.html.erb +9 -0
- data/app/views/lesli_audit/dashboard/components/show.html.erb +1 -0
- data/app/views/lesli_audit/dashboards/edit.html.erb +1 -10
- data/app/views/lesli_audit/partials/_engine-navigation.html.erb +4 -4
- data/config/locales/translations.en.yml +17 -1
- data/config/locales/translations.es.yml +17 -1
- data/config/locales/translations.fr.yml +21 -0
- data/config/locales/translations.it.yml +21 -0
- data/config/locales/translations.pt.yml +21 -0
- data/config/routes.rb +17 -3
- data/db/seeds.rb +4 -1
- data/lib/lesli_audit/version.rb +2 -2
- data/{app/assets/stylesheets/lesli_audit → lib/scss}/application.scss +0 -4
- data/lib/vue/application.js +47 -5
- data/lib/vue/apps/analytics/index.vue +1 -1
- data/lib/vue/apps/analytics/trends.vue +2 -3
- data/lib/vue/apps/dashboards/components/roles.vue +71 -0
- data/lib/vue/apps/dashboards/components/users.vue +71 -0
- data/lib/vue/apps/dashboards/show.vue +8 -0
- data/lib/vue/apps/requests/index.vue +1 -1
- data/lib/vue/apps/users/index.vue +80 -22
- data/lib/vue/apps/users/registrations.vue +21 -44
- data/lib/vue/components/requests.vue +1 -1
- data/lib/vue/components/visitors.vue +1 -1
- data/lib/vue/stores/analytics.js +24 -9
- data/lib/vue/stores/translations.json +133 -19
- data/lib/vue/stores/users.js +56 -0
- metadata +25 -10
- data/app/assets/javascripts/lesli_audit/application.js.LICENSE.txt +0 -327
- data/app/assets/stylesheets/lesli_audit/dashboard.scss +0 -0
- /data/db/migrate/v1.0/{0803000110_create_lesli_audit_accounts.rb → 0503000110_create_lesli_audit_accounts.rb} +0 -0
- /data/db/migrate/v1.0/{0803050110_create_lesli_audit_dashboards.rb → 0503050110_create_lesli_audit_dashboards.rb} +0 -0
- /data/db/migrate/v1.0/{0803050210_create_lesli_audit_dashboard_components.rb → 0503050210_create_lesli_audit_dashboard_components.rb} +0 -0
- /data/db/migrate/v1.0/{0803100010_create_lesli_audit_account_requests.rb → 0503100010_create_lesli_audit_account_requests.rb} +0 -0
- /data/db/migrate/v1.0/{0803110010_create_lesli_audit_user_requests.rb → 0503110010_create_lesli_audit_user_requests.rb} +0 -0
data/lib/lesli_audit/version.rb
CHANGED
data/lib/vue/application.js
CHANGED
@@ -30,15 +30,27 @@ Building a better future, one line of code at a time.
|
|
30
30
|
*/
|
31
31
|
|
32
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 "LesliAudit/vue/stores/translations.json"
|
40
|
+
|
41
|
+
|
33
42
|
// ·
|
34
|
-
import
|
35
|
-
import
|
36
|
-
import
|
37
|
-
|
43
|
+
import appAnalytics from "LesliAudit/vue/apps/analytics/index.vue"
|
44
|
+
import appRequests from "LesliAudit/vue/apps/requests/index.vue"
|
45
|
+
import appUsers from "LesliAudit/vue/apps/users/index.vue"
|
46
|
+
|
47
|
+
//import appDashboardShow from "LesliAudit/vue/apps/dashboards/show.vue"
|
48
|
+
import appDashboardShow from "Lesli/vue/shared/dashboards/apps/show.vue"
|
49
|
+
import appDashboardEdit from "Lesli/vue/shared/dashboards/apps/edit.vue"
|
38
50
|
|
39
51
|
// ·
|
40
52
|
/*
|
41
|
-
import dashboard from "Lesli/shared/dashboards/apps/show.vue"
|
53
|
+
import dashboard from "Lesli/vue/shared/dashboards/apps/show.vue"
|
42
54
|
import appUsersRegistrations from "CloudAudit/apps/users/registrations.vue"
|
43
55
|
import appUsersWorkingHours from "CloudAudit/apps/users/workingHours.vue"
|
44
56
|
import appUsersActivities from "CloudAudit/apps/users/activities.vue"
|
@@ -56,7 +68,37 @@ import appSecurityPasswords from "CloudAudit/apps/security/passwords.vue"
|
|
56
68
|
|
57
69
|
|
58
70
|
// ·
|
71
|
+
import componentDashboardUsers from "LesliAudit/vue/apps/dashboards/components/users.vue"
|
72
|
+
import componentDashboardRoles from "LesliAudit/vue/apps/dashboards/components/roles.vue"
|
73
|
+
|
74
|
+
|
75
|
+
// ·
|
76
|
+
const dashboardProps = {
|
77
|
+
components: {
|
78
|
+
// "audit-users": componentDashboardUsers,
|
79
|
+
// "audit-roles": componentDashboardRoles
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
// · Buil Lesli translations
|
85
|
+
translation(translations)
|
86
|
+
|
87
|
+
|
88
|
+
// · Build a new Lesli application
|
59
89
|
application("LesliAudit", [{
|
90
|
+
path: "/",
|
91
|
+
component: appDashboardShow,
|
92
|
+
props: dashboardProps
|
93
|
+
}, {
|
94
|
+
path: "/dashboard",
|
95
|
+
component: appDashboardShow,
|
96
|
+
props: dashboardProps
|
97
|
+
}, {
|
98
|
+
path: "/dashboards/:id/edit",
|
99
|
+
component: appDashboardEdit,
|
100
|
+
props: dashboardProps
|
101
|
+
}, {
|
60
102
|
path: "/analytics",
|
61
103
|
component: appAnalytics,
|
62
104
|
props: { engine: "audit" }
|
@@ -22,12 +22,11 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
|
|
22
22
|
|
23
23
|
|
24
24
|
// . import Lesli components
|
25
|
-
import
|
26
|
-
import chartLine from "Lesli/components/charts/line.vue"
|
25
|
+
import { lesliChartBar, lesliChartLine } from "lesli-vue/components"
|
27
26
|
|
28
27
|
|
29
28
|
// · import lesli stores
|
30
|
-
import { useAnalytics } from "
|
29
|
+
import { useAnalytics } from "LesliAudit/vue/stores/analytics"
|
31
30
|
|
32
31
|
|
33
32
|
// · implement stores
|
@@ -0,0 +1,71 @@
|
|
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
|
+
// ·
|
35
|
+
import { onMounted } from "vue"
|
36
|
+
|
37
|
+
|
38
|
+
// ·
|
39
|
+
import { useUsers } from "LesliSecurity/vue/stores/users"
|
40
|
+
|
41
|
+
|
42
|
+
// ·
|
43
|
+
const storeUsers = useUsers()
|
44
|
+
|
45
|
+
|
46
|
+
// ·
|
47
|
+
const props = defineProps({
|
48
|
+
component: {
|
49
|
+
type: Object,
|
50
|
+
required: true
|
51
|
+
}
|
52
|
+
})
|
53
|
+
|
54
|
+
|
55
|
+
// ·
|
56
|
+
onMounted(() => {
|
57
|
+
//storeUsers.getUsersList()
|
58
|
+
})
|
59
|
+
|
60
|
+
</script>
|
61
|
+
<template>
|
62
|
+
<lesli-card>
|
63
|
+
<h6 class="title is-6 mb-4">{{ props.component.name }}</h6>
|
64
|
+
<p>{ { storeUsers.list.length } }</p>
|
65
|
+
</lesli-card>
|
66
|
+
</template>
|
67
|
+
<style scoped>
|
68
|
+
p {
|
69
|
+
font-size: 2rem;
|
70
|
+
}
|
71
|
+
</style>
|
@@ -0,0 +1,71 @@
|
|
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
|
+
// ·
|
35
|
+
import { onMounted } from "vue"
|
36
|
+
|
37
|
+
|
38
|
+
// ·
|
39
|
+
import { useUsers } from "LesliSecurity/vue/stores/users"
|
40
|
+
|
41
|
+
|
42
|
+
// ·
|
43
|
+
const storeUsers = useUsers()
|
44
|
+
|
45
|
+
|
46
|
+
// ·
|
47
|
+
const props = defineProps({
|
48
|
+
component: {
|
49
|
+
type: Object,
|
50
|
+
required: true
|
51
|
+
}
|
52
|
+
})
|
53
|
+
|
54
|
+
|
55
|
+
// ·
|
56
|
+
onMounted(() => {
|
57
|
+
//storeUsers.getUsersList()
|
58
|
+
})
|
59
|
+
|
60
|
+
</script>
|
61
|
+
<template>
|
62
|
+
<lesli-card>
|
63
|
+
<h6 class="title is-6 mb-4">{{ props.component.name }}</h6>
|
64
|
+
|
65
|
+
</lesli-card>
|
66
|
+
</template>
|
67
|
+
<style scoped>
|
68
|
+
p {
|
69
|
+
font-size: 2rem;
|
70
|
+
}
|
71
|
+
</style>
|
@@ -1,31 +1,89 @@
|
|
1
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
|
+
}
|
2
60
|
|
3
61
|
</script>
|
4
62
|
<template>
|
5
63
|
<lesli-application-container>
|
6
|
-
<lesli-
|
7
|
-
<lesli-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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>
|
23
86
|
</lesli-application-container>
|
24
87
|
</template>
|
25
88
|
<style>
|
26
|
-
.number {
|
27
|
-
padding: 1rem;
|
28
|
-
font-size: 3rem;
|
29
|
-
text-align: center;
|
30
|
-
}
|
31
89
|
</style>
|
@@ -22,77 +22,54 @@ import { ref, reactive, onMounted, watch, computed } from "vue"
|
|
22
22
|
|
23
23
|
|
24
24
|
// · import Lesli components
|
25
|
-
import
|
25
|
+
import { lesliChartBar } from "lesli-vue/components"
|
26
26
|
|
27
27
|
|
28
28
|
// · import stores
|
29
|
-
import {
|
29
|
+
import { useUsers } from "LesliAudit/vue/stores/users"
|
30
30
|
|
31
31
|
|
32
32
|
// · implement stores
|
33
|
-
const
|
33
|
+
const storeUsers = useUsers()
|
34
34
|
|
35
35
|
|
36
36
|
// · define variables
|
37
37
|
var registrationSeries = ref([]);
|
38
|
-
var registrationLabels = ref([]);
|
39
|
-
var selectedPeriod = ref("month");
|
40
|
-
var filterPeriod = ref("");
|
41
|
-
var selectOptions = ref([]);
|
42
38
|
|
43
39
|
|
44
40
|
// · initializing
|
45
41
|
onMounted(() => {
|
46
|
-
|
47
|
-
storeUsersRegistrations.getOptions()
|
42
|
+
storeUsers.getRegistrations()
|
48
43
|
})
|
49
44
|
|
50
45
|
|
51
46
|
// ·
|
52
|
-
watch(() =>
|
53
|
-
selectOptions.value = storeUsersRegistrations.periods
|
54
|
-
})
|
47
|
+
watch(() => storeUsers.registrations, (oldData, newData) => {
|
55
48
|
|
49
|
+
if (storeUsers.registrations.length == 0) {
|
50
|
+
return
|
51
|
+
}
|
56
52
|
|
57
|
-
// ·
|
58
|
-
watch(() => storeUsersRegistrations.records, () => {
|
59
|
-
registrationLabels.value = storeUsersRegistrations.records.map(visit => visit.date)
|
60
53
|
registrationSeries.value = [{
|
61
|
-
|
62
|
-
|
54
|
+
data: storeUsers.registrations.map(registration => {
|
55
|
+
return {
|
56
|
+
x: registration.date,
|
57
|
+
y: registration.count
|
58
|
+
}
|
59
|
+
})
|
63
60
|
}]
|
64
61
|
})
|
65
62
|
|
66
|
-
|
67
|
-
// ·
|
68
|
-
function updateDate(){
|
69
|
-
filterPeriod = selectedPeriod.value;
|
70
|
-
storeUsersRegistrations.fetch(filterPeriod)
|
71
|
-
}
|
72
|
-
|
73
63
|
</script>
|
74
64
|
<template>
|
75
65
|
<section class="application-component">
|
76
|
-
<lesli-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
v-model = "selectedPeriod"
|
84
|
-
:options="selectOptions">
|
85
|
-
</lesli-select>
|
86
|
-
</div>
|
87
|
-
<div class="card">
|
88
|
-
<div class="card-content">
|
89
|
-
<chartLine
|
90
|
-
:series="registrationSeries"
|
91
|
-
:labels="registrationLabels"
|
92
|
-
@marker-click="markerClick">
|
93
|
-
</chartLine>
|
94
|
-
</div>
|
95
|
-
</div>
|
66
|
+
<lesli-card>
|
67
|
+
<lesli-chart-bar
|
68
|
+
title="Registrations by date"
|
69
|
+
:series="registrationSeries"
|
70
|
+
@marker-click="markerClick">
|
71
|
+
</lesli-chart-bar>
|
72
|
+
</lesli-card>
|
96
73
|
</section>
|
97
74
|
</template>
|
98
75
|
|
data/lib/vue/stores/analytics.js
CHANGED
@@ -1,17 +1,32 @@
|
|
1
1
|
/*
|
2
|
-
Copyright (c) 2022, all rights reserved.
|
3
2
|
|
4
|
-
|
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.
|
3
|
+
Lesli
|
8
4
|
|
9
|
-
|
10
|
-
transmission, publication is strictly forbidden.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
11
6
|
|
12
|
-
|
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.
|
13
11
|
|
14
|
-
|
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
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
15
30
|
// ·
|
16
31
|
*/
|
17
32
|
|