lesli_admin 0.3.0 → 0.4.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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/lesli_admin/application.js +284 -841
- data/app/controllers/lesli_admin/accounts_controller.rb +3 -5
- data/app/controllers/lesli_admin/dashboard/components_controller.rb +60 -0
- data/app/controllers/lesli_admin/dashboards_controller.rb +26 -50
- data/app/models/lesli_admin/account.rb +6 -0
- data/app/{controllers/lesli_admin/profiles_controller.rb → models/lesli_admin/dashboard/component.rb} +13 -19
- data/app/models/lesli_admin/dashboard.rb +58 -0
- data/app/services/lesli_admin/account_service.rb +39 -0
- data/app/views/lesli_admin/dashboards/edit.html.erb +29 -7
- data/app/views/lesli_admin/dashboards/index.html.erb +29 -11
- data/app/views/lesli_admin/dashboards/new.html.erb +29 -6
- data/app/views/lesli_admin/dashboards/show.html.erb +31 -0
- data/app/views/lesli_admin/partials/_engine-navigation.html.erb +0 -1
- data/config/locales/translations.en.yml +26 -0
- data/config/locales/translations.es.yml +26 -0
- data/config/routes.rb +46 -5
- data/db/migrate/0101050110_create_lesli_admin_dashboards.rb +51 -0
- data/db/migrate/0101050210_create_lesli_admin_dashboard_components.rb +53 -0
- data/lib/lesli_admin/engine.rb +1 -0
- data/lib/lesli_admin/version.rb +1 -1
- data/lib/vue/application.js +28 -15
- data/lib/vue/apps/account/components/{address-form.vue → form-address.vue} +27 -42
- data/lib/vue/apps/account/components/form-contact.vue +122 -0
- data/lib/vue/apps/account/components/form-information.vue +12 -30
- data/lib/vue/apps/account/show.vue +13 -12
- data/lib/vue/apps/{users/components/integrations-information.vue → dashboards/components/lesli-version.vue} +36 -26
- data/lib/vue/apps/{profile/components/change-email.vue → dashboards/show.vue} +9 -6
- data/lib/vue/stores/translations.json +52 -18
- metadata +17 -30
- data/app/controllers/lesli_admin/users_controller.rb +0 -238
- data/app/services/lesli_admin/user_service.rb +0 -265
- data/app/views/lesli_admin/dashboards/_dashboard.html.erb +0 -2
- data/app/views/lesli_admin/dashboards/_form.html.erb +0 -17
- data/lib/vue/apps/account/components/contact-form.vue +0 -162
- data/lib/vue/apps/dashboard/show.vue +0 -30
- data/lib/vue/apps/profile/components/subscriptions.vue +0 -94
- data/lib/vue/apps/profile/show.vue +0 -152
- data/lib/vue/apps/users/components/information-card.vue +0 -116
- data/lib/vue/apps/users/components/information-form.vue +0 -177
- data/lib/vue/apps/users/components/management-roles.vue +0 -109
- data/lib/vue/apps/users/components/management-security.vue +0 -113
- data/lib/vue/apps/users/components/management-sessions.vue +0 -106
- data/lib/vue/apps/users/components/management-settings.vue +0 -94
- data/lib/vue/apps/users/index.vue +0 -206
- data/lib/vue/apps/users/new.vue +0 -181
- data/lib/vue/apps/users/show.vue +0 -116
- data/lib/vue/stores/user.js +0 -331
- data/lib/vue/stores/users.js +0 -175
@@ -1,152 +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 https://www.lesli.tech
|
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
|
-
|
36
|
-
// · import vue tools
|
37
|
-
import { ref, reactive, onMounted, watch, computed, onUnmounted } from "vue"
|
38
|
-
import { useRouter, useRoute } from 'vue-router'
|
39
|
-
|
40
|
-
|
41
|
-
// · import lesli stores
|
42
|
-
import { useUser } from "LesliAdmin/stores/user"
|
43
|
-
|
44
|
-
|
45
|
-
// · implement stores
|
46
|
-
const storeUser = useUser()
|
47
|
-
const router = useRouter()
|
48
|
-
const route = useRoute()
|
49
|
-
|
50
|
-
|
51
|
-
// · import profile components
|
52
|
-
import informationCard from "LesliAdmin/apps/users/components/information-card.vue"
|
53
|
-
import informationForm from "LesliAdmin/apps/users/components/information-form.vue"
|
54
|
-
/*
|
55
|
-
import informationForm from "CloudAdmin/apps/users/components/information-form.vue"
|
56
|
-
|
57
|
-
import managementSession from "CloudAdmin/apps/users/components/management-sessions.vue"
|
58
|
-
import managementSecurity from "CloudAdmin/apps/users/components/management-security.vue"
|
59
|
-
|
60
|
-
import integrationsInformation from "CloudAdmin/apps/users/components/integrations-information.vue"
|
61
|
-
import settings from "CloudAdmin/apps/users/components/management-settings.vue"
|
62
|
-
*/
|
63
|
-
|
64
|
-
/*
|
65
|
-
import cardInformation from "../users/components/information-card.vue"
|
66
|
-
import formInformation from "../users/components/information-form.vue"
|
67
|
-
import managementSession from "../users/components/management-sessions.vue"
|
68
|
-
import integrationsInformation from "../users/components/integrations-information.vue"
|
69
|
-
import subscriptionsComponent from "./components/subscriptions.vue"
|
70
|
-
import settings from "../users/components/settings.vue"
|
71
|
-
import changeEmail from "./components/change-email.vue"
|
72
|
-
*/
|
73
|
-
|
74
|
-
|
75
|
-
// · translations
|
76
|
-
const translations = {
|
77
|
-
core: {
|
78
|
-
roles: I18n.t("core.roles"),
|
79
|
-
users: I18n.t("core.users"),
|
80
|
-
shared: I18n.t("core.shared")
|
81
|
-
}
|
82
|
-
}
|
83
|
-
|
84
|
-
|
85
|
-
// ·
|
86
|
-
const tab = ref(0)
|
87
|
-
|
88
|
-
|
89
|
-
// ·
|
90
|
-
onMounted(() => {
|
91
|
-
storeUser.getUser()
|
92
|
-
//storeUser.getOptions()
|
93
|
-
})
|
94
|
-
|
95
|
-
</script>
|
96
|
-
<template>
|
97
|
-
<lesli-application-container>
|
98
|
-
<information-card></information-card>
|
99
|
-
<lesli-tabs v-model="tab">
|
100
|
-
<lesli-tab-item icon="info_outline" title="Information">
|
101
|
-
<information-form></information-form>
|
102
|
-
</lesli-tab-item>
|
103
|
-
</lesli-tabs>
|
104
|
-
</lesli-application-container>
|
105
|
-
<!--
|
106
|
-
<application-component>
|
107
|
-
|
108
|
-
<lesli-tabs v-model="tab" v-if="storeUser.user.id">
|
109
|
-
<lesli-tab-item icon="info_outline" :title="translations.core.users.view_tab_title_information">
|
110
|
-
<information-form></information-form>
|
111
|
-
</lesli-tab-item>
|
112
|
-
<lesli-tab-item icon="security" :title="translations.core.users.view_tab_title_roles_and_privileges">
|
113
|
-
< ! - -form-roles></form-roles - - >
|
114
|
-
</lesli-tab-item>
|
115
|
-
<lesli-tab-item icon="lock_outline" :title="translations.core.users.view_tab_title_security || 'Security'">
|
116
|
-
<management-security></management-security>
|
117
|
-
</lesli-tab-item>
|
118
|
-
<lesli-tab-item icon="devices" :title="translations.core.users.view_tab_title_session || 'Sessions'" paddingless>
|
119
|
-
<management-session></management-session>
|
120
|
-
</lesli-tab-item>
|
121
|
-
<lesli-tab-item icon="settings" :title="translations.core.users.view_tab_title_settings">
|
122
|
-
< ! - - settings></settings - - >
|
123
|
-
</lesli-tab-item>
|
124
|
-
</lesli-tabs>
|
125
|
-
</application-component>
|
126
|
-
|
127
|
-
<section class="application-component">
|
128
|
-
<information-card></information-card>
|
129
|
-
<lesli-tabs v-if="storeUser.user.id">
|
130
|
-
<lesli-tab-item :title="translations.core.users.view_tab_title_information">
|
131
|
-
<information-form></information-form>
|
132
|
-
</lesli-tab-item>
|
133
|
-
<lesli-tab-item :title="translations.core.users.view_tab_title_subscriptions">
|
134
|
-
<subscriptions-component>
|
135
|
-
</subscriptions-component>
|
136
|
-
</lesli-tab-item>
|
137
|
-
<lesli-tab-item :title="translations.core.users.view_tab_title_security">
|
138
|
-
<form-security></form-security>
|
139
|
-
</lesli-tab-item>
|
140
|
-
<lesli-tab-item :title="translations.core.users.view_tab_title_session_management">
|
141
|
-
<management-session></management-session>
|
142
|
-
</lesli-tab-item>
|
143
|
-
<lesli-tab-item :title="translations.core.users.view_tab_title_settings">
|
144
|
-
<settings></settings>
|
145
|
-
</lesli-tab-item>
|
146
|
-
<lesli-tab-item :title="translations.core.users.view_tab_title_integrations">
|
147
|
-
<integrations-information></integrations-information>
|
148
|
-
</lesli-tab-item>
|
149
|
-
</lesli-tabs>
|
150
|
-
</section>
|
151
|
-
-->
|
152
|
-
</template>
|
@@ -1,116 +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 lesli stores
|
35
|
-
import { useUser } from "Lesli/stores/user"
|
36
|
-
|
37
|
-
|
38
|
-
// · implement stores
|
39
|
-
const storeUser = useUser()
|
40
|
-
|
41
|
-
|
42
|
-
// · translations
|
43
|
-
const translations = {
|
44
|
-
core: {
|
45
|
-
users: I18n.t("core.users"),
|
46
|
-
shared: I18n.t("core.shared"),
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
</script>
|
51
|
-
<template>
|
52
|
-
<div class="user-information-card mb-5">
|
53
|
-
<div class="media is-align-items-center">
|
54
|
-
<div class="media-left">
|
55
|
-
<figure class="image is-128x128">
|
56
|
-
<span class="alternative-avatar">
|
57
|
-
{{ storeUser.initials }}
|
58
|
-
</span>
|
59
|
-
</figure>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<div class="media-content">
|
63
|
-
<div class="content mb-0">
|
64
|
-
<p>
|
65
|
-
<!--
|
66
|
-
<strong>
|
67
|
-
object_utils.translateEnum(translations.core.shared, 'column_enum_salutation', user.detail_attributes.salutation )
|
68
|
-
{{ storeUser.user.detail_attributes.salutation }}
|
69
|
-
</strong>
|
70
|
-
-->
|
71
|
-
<h5 class="title is-5 mb-0">
|
72
|
-
{{ storeUser.user.first_name }}
|
73
|
-
{{ storeUser.user.last_name }}
|
74
|
-
</h5>
|
75
|
-
<p>{{ storeUser.user.detail_attributes.title }}</p>
|
76
|
-
</p>
|
77
|
-
</div>
|
78
|
-
|
79
|
-
<div class="level is-mobile">
|
80
|
-
<div class="level-left">
|
81
|
-
<a class="level-item mr-4"
|
82
|
-
v-if="storeUser.user.email"
|
83
|
-
:href="'mailto:'+storeUser.user.email">
|
84
|
-
<span class="icon is-small mr-2">
|
85
|
-
<span class="material-icons">
|
86
|
-
email
|
87
|
-
</span>
|
88
|
-
</span>
|
89
|
-
{{ storeUser.user.email }}
|
90
|
-
</a>
|
91
|
-
<a class="level-item mr-4"
|
92
|
-
v-if="storeUser.user.telephone"
|
93
|
-
:href="'tel:'+storeUser.user.telephone">
|
94
|
-
<span class="icon is-small mr-2">
|
95
|
-
<span class="material-icons">
|
96
|
-
phone
|
97
|
-
</span>
|
98
|
-
</span>
|
99
|
-
{{ storeUser.user.telephone }}
|
100
|
-
</a>
|
101
|
-
|
102
|
-
<!-- Show the max role -->
|
103
|
-
<p class="level-item">
|
104
|
-
<span class="icon is-small mr-2">
|
105
|
-
<span class="material-icons">
|
106
|
-
security
|
107
|
-
</span>
|
108
|
-
</span>
|
109
|
-
{{ storeUser.role_names }}
|
110
|
-
</p>
|
111
|
-
</div>
|
112
|
-
</div>
|
113
|
-
</div>
|
114
|
-
</div>
|
115
|
-
</div>
|
116
|
-
</template>
|
@@ -1,177 +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 { onMounted, inject } from "vue"
|
36
|
-
|
37
|
-
|
38
|
-
// · import lesli stores
|
39
|
-
import { useUser } from "Lesli/stores/user"
|
40
|
-
|
41
|
-
|
42
|
-
// · import vue router composable
|
43
|
-
import { useRouter, useRoute } from "vue-router"
|
44
|
-
|
45
|
-
|
46
|
-
// · implement stores
|
47
|
-
const storeUser = useUser()
|
48
|
-
|
49
|
-
|
50
|
-
// · initialize/inject plugins
|
51
|
-
const router = useRouter()
|
52
|
-
const route = useRoute()
|
53
|
-
const url = inject("url")
|
54
|
-
|
55
|
-
|
56
|
-
// ·
|
57
|
-
const translations = {
|
58
|
-
users: I18n.t("core.users"),
|
59
|
-
shared: I18n.t("core.shared")
|
60
|
-
}
|
61
|
-
|
62
|
-
</script>
|
63
|
-
<template>
|
64
|
-
<form class="information" @submit.prevent="storeUser.putUser()">
|
65
|
-
<div class="field is-horizontal">
|
66
|
-
<div class="field-label">
|
67
|
-
<label class="label"> {{ translations.shared.view_text_salutation}} </label>
|
68
|
-
</div>
|
69
|
-
<div class="field-body">
|
70
|
-
<div class="field is-narrow">
|
71
|
-
<div class="control">
|
72
|
-
<label :for="salutation.value" class="radio" v-for="salutation in storeUser.options.salutations" :key="salutation">
|
73
|
-
<input name="user_salutation" type="radio" :id="salutation.value" :value="salutation.value" v-model="storeUser.user.detail_attributes.salutation" />
|
74
|
-
{{salutation.text}}
|
75
|
-
</label>
|
76
|
-
</div>
|
77
|
-
</div>
|
78
|
-
</div>
|
79
|
-
</div>
|
80
|
-
|
81
|
-
<div class="field is-horizontal">
|
82
|
-
<div class="field-label is-normal">
|
83
|
-
<label class="label">
|
84
|
-
{{translations.shared.view_text_email}}
|
85
|
-
<span class="is-danger">*</span>
|
86
|
-
</label>
|
87
|
-
</div>
|
88
|
-
<div class="field-body">
|
89
|
-
<div class="field">
|
90
|
-
<div class="control">
|
91
|
-
<input name="user_email" v-model="storeUser.user.email" required="required" type="email" class="input">
|
92
|
-
</div>
|
93
|
-
</div>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
|
97
|
-
<div class="field is-horizontal">
|
98
|
-
<div class="field-label is-normal">
|
99
|
-
<label class="label">
|
100
|
-
{{ translations.shared.view_text_first_name }}
|
101
|
-
</label>
|
102
|
-
</div>
|
103
|
-
<div class="field-body">
|
104
|
-
<div class="field">
|
105
|
-
<div class="control">
|
106
|
-
<input name="first_name" v-model="storeUser.user.first_name" type="text" class="input">
|
107
|
-
</div>
|
108
|
-
</div>
|
109
|
-
</div>
|
110
|
-
</div>
|
111
|
-
|
112
|
-
<div class="field is-horizontal">
|
113
|
-
<div class="field-label is-normal">
|
114
|
-
<label class="label"> {{ translations.shared.view_text_last_name }} </label>
|
115
|
-
</div>
|
116
|
-
<div class="field-body">
|
117
|
-
<div class="field">
|
118
|
-
<div class="control">
|
119
|
-
<input name="last_name" v-model="storeUser.user.last_name" class="input">
|
120
|
-
</div>
|
121
|
-
</div>
|
122
|
-
</div>
|
123
|
-
</div>
|
124
|
-
|
125
|
-
<div class="field is-horizontal">
|
126
|
-
<div class="field-label is-normal">
|
127
|
-
<label class="label"> {{ translations.shared.view_text_alias }} </label>
|
128
|
-
</div>
|
129
|
-
<div class="field-body">
|
130
|
-
<div class="field">
|
131
|
-
<div class="control">
|
132
|
-
<input name="user_alias" v-model="storeUser.user.alias" class="input">
|
133
|
-
</div>
|
134
|
-
</div>
|
135
|
-
</div>
|
136
|
-
</div>
|
137
|
-
|
138
|
-
<div class="field is-horizontal">
|
139
|
-
<div class="field-label is-normal">
|
140
|
-
<label class="label"> {{ translations.shared.view_text_telephone }} </label>
|
141
|
-
</div>
|
142
|
-
<div class="field-body">
|
143
|
-
<div class="field">
|
144
|
-
<div class="control">
|
145
|
-
<input name="user_number" v-model="storeUser.user.telephone" class="input">
|
146
|
-
</div>
|
147
|
-
</div>
|
148
|
-
</div>
|
149
|
-
</div>
|
150
|
-
|
151
|
-
<div class="field is-horizontal">
|
152
|
-
<div class="field-label is-normal">
|
153
|
-
<label class="label"> {{ translations.users.view_text_title }} </label>
|
154
|
-
</div>
|
155
|
-
<div class="field-body">
|
156
|
-
<div class="field">
|
157
|
-
<div class="control">
|
158
|
-
<input name="user_title" v-model="storeUser.user.detail_attributes.title" class="input">
|
159
|
-
</div>
|
160
|
-
</div>
|
161
|
-
</div>
|
162
|
-
</div>
|
163
|
-
<div class="field is-horizontal">
|
164
|
-
<div class="field-label is-normal">
|
165
|
-
</div>
|
166
|
-
<div class="field-body">
|
167
|
-
<div class="field">
|
168
|
-
<div class="control">
|
169
|
-
<lesli-button icon="save">
|
170
|
-
{{ translations.shared.view_btn_save }}
|
171
|
-
</lesli-button>
|
172
|
-
</div>
|
173
|
-
</div>
|
174
|
-
</div>
|
175
|
-
</div>
|
176
|
-
</form>
|
177
|
-
</template>
|
@@ -1,109 +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 · Your Smart Business Assistant.
|
22
|
-
|
23
|
-
Made with ♥ by https://www.lesli.tech
|
24
|
-
Building a better future, one line of code at a time.
|
25
|
-
|
26
|
-
@contact hello@lesli.tech
|
27
|
-
@website https://lesli.tech
|
28
|
-
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
-
|
30
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
-
// ·
|
32
|
-
|
33
|
-
*/
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
// · import vue tools
|
38
|
-
import { ref, reactive, onMounted, watch, computed } from "vue"
|
39
|
-
|
40
|
-
|
41
|
-
// · import lesli stores
|
42
|
-
import { useUser } from "LesliApp/administration/stores/user"
|
43
|
-
import { useRoles } from "LesliApp/administration/stores/roles"
|
44
|
-
|
45
|
-
|
46
|
-
// · implement stores
|
47
|
-
const storeUser = useUser()
|
48
|
-
const storeRoles = useRoles()
|
49
|
-
|
50
|
-
|
51
|
-
// ·
|
52
|
-
const translations = {
|
53
|
-
shared: I18n.t("core.shared"),
|
54
|
-
passwords: I18n.t("core.users/passwords"),
|
55
|
-
users: I18n.t("core.users")
|
56
|
-
}
|
57
|
-
|
58
|
-
|
59
|
-
// ·
|
60
|
-
function updateRole(role){
|
61
|
-
if (role.active) {
|
62
|
-
storeUser.postRole(role)
|
63
|
-
} else {
|
64
|
-
storeUser.deleteRole(role)
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
|
69
|
-
// ·
|
70
|
-
onMounted(() => {
|
71
|
-
storeUser.getRoles()
|
72
|
-
})
|
73
|
-
</script>
|
74
|
-
<template>
|
75
|
-
<div class="media px-6" v-for="role in storeUser.roles">
|
76
|
-
<div class="media-content pt-4">
|
77
|
-
<h4>{{ role.name }}</h4>
|
78
|
-
<p style="color:#aaa;">
|
79
|
-
{{ role.description }}
|
80
|
-
Profile view, Role view, Role create, Role update
|
81
|
-
</p>
|
82
|
-
</div>
|
83
|
-
<div class="media-right pt-4">
|
84
|
-
<lesli-toggle v-model="role.active" @change="updateRole(role)">
|
85
|
-
</lesli-toggle>
|
86
|
-
</div>
|
87
|
-
</div>
|
88
|
-
<lesli-empty v-if="storeUser.roles.length == 0"></lesli-empty>
|
89
|
-
<!--
|
90
|
-
<div class="roles-types">
|
91
|
-
<div
|
92
|
-
class="card roles-types-item p-4 is-flex is-flex-direction-column is-justify-content-space-between is-clickable"
|
93
|
-
v-for="role in storeUser.options.roles"
|
94
|
-
:key="role">
|
95
|
-
<div class="role-type-title">
|
96
|
-
<span class="has-text-weight-semibold is-size-5 ">
|
97
|
-
{{ role.name }}
|
98
|
-
</span>
|
99
|
-
</div>
|
100
|
-
<div>
|
101
|
-
<span>Permission level: {{ role.object_level_permission }} </span>
|
102
|
-
</div>
|
103
|
-
<div class="is-flex is-justify-content-space-between is-align-items-center">
|
104
|
-
<lesli-toggle v-model="storeUser.rolesToggle[role.id]" v-on:update:modelValue="updateRole(role,storeUser.rolesToggle[role.id])" ></lesli-toggle>
|
105
|
-
</div>
|
106
|
-
</div>
|
107
|
-
</div>
|
108
|
-
-->
|
109
|
-
</template>
|
@@ -1,113 +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 · Your Smart Business Assistant.
|
22
|
-
|
23
|
-
Made with ♥ by https://www.lesli.tech
|
24
|
-
Building a better future, one line of code at a time.
|
25
|
-
|
26
|
-
@contact hello@lesli.tech
|
27
|
-
@website https://lesli.tech
|
28
|
-
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
-
|
30
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
-
// ·
|
32
|
-
|
33
|
-
*/
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
// · import lesli stores
|
38
|
-
import { useUser } from "LesliApp/administration/stores/user"
|
39
|
-
|
40
|
-
|
41
|
-
// · implement stores
|
42
|
-
const storeUser = useUser()
|
43
|
-
|
44
|
-
|
45
|
-
// · translations
|
46
|
-
const translations = {
|
47
|
-
users: I18n.t("core.users"),
|
48
|
-
shared: I18n.t("core.shared")
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
</script>
|
53
|
-
<template>
|
54
|
-
<div>
|
55
|
-
<fieldset class="mb-4">
|
56
|
-
<legend>Force the user to change the password</legend>
|
57
|
-
<lesli-button
|
58
|
-
icon="lock_reset"
|
59
|
-
@click="storeUser.doRequestPassword">
|
60
|
-
{{ translations.users.view_btn_request_password || "Request password" }}
|
61
|
-
</lesli-button>
|
62
|
-
</fieldset>
|
63
|
-
|
64
|
-
<fieldset class="mb-4">
|
65
|
-
<legend>Generate a new password for the user</legend>
|
66
|
-
<lesli-button
|
67
|
-
icon="key"
|
68
|
-
@click="storeUser.doPasswordReset">
|
69
|
-
{{ translations.users.view_btn_password_reset || "Password reset" }}
|
70
|
-
</lesli-button>
|
71
|
-
</fieldset>
|
72
|
-
|
73
|
-
<fieldset class="mb-4">
|
74
|
-
<legend>Close all the active sessions of the user</legend>
|
75
|
-
<lesli-button
|
76
|
-
icon="logout"
|
77
|
-
@click="storeUser.doLogout">
|
78
|
-
{{ translations.users.view_btn_logout }}
|
79
|
-
</lesli-button>
|
80
|
-
</fieldset>
|
81
|
-
|
82
|
-
<fieldset class="mb-4">
|
83
|
-
<legend>Remove all user access</legend>
|
84
|
-
<lesli-button
|
85
|
-
danger
|
86
|
-
icon="lock_outline"
|
87
|
-
@click="storeUser.doRevokeAccess">
|
88
|
-
{{ translations.users.view_btn_revoke_access }}
|
89
|
-
</lesli-button>
|
90
|
-
</fieldset>
|
91
|
-
|
92
|
-
<br><br>
|
93
|
-
|
94
|
-
<fieldset class="mb-4">
|
95
|
-
<lesli-button
|
96
|
-
danger
|
97
|
-
icon="delete_forever"
|
98
|
-
@click="storeUser.deleteUser">
|
99
|
-
{{ translations.users.view_btn_delete_user }}
|
100
|
-
</lesli-button>
|
101
|
-
</fieldset>
|
102
|
-
</div>
|
103
|
-
</template>
|
104
|
-
<style scoped>
|
105
|
-
fieldset {
|
106
|
-
padding: 1.6rem;
|
107
|
-
border: 1px solid #ccc;
|
108
|
-
border-radius: 4px;
|
109
|
-
}
|
110
|
-
legend {
|
111
|
-
color: #555;
|
112
|
-
}
|
113
|
-
</style>
|