lesli_vault 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +38 -0
- data/app/assets/config/lesli_vault_manifest.js +38 -0
- data/app/assets/images/lesli_vault/vault-logo.svg +160 -0
- data/app/assets/javascripts/lesli_vault/application.js +2848 -0
- data/app/assets/stylesheets/lesli_vault/application.scss +15 -0
- data/app/assets/stylesheets/lesli_vault/dashboards.scss +32 -0
- data/app/assets/stylesheets/lesli_vault/descriptors.scss +32 -0
- data/app/assets/stylesheets/lesli_vault/roles.scss +32 -0
- data/app/assets/stylesheets/lesli_vault/system_controller.scss +32 -0
- data/app/controllers/lesli_vault/application_controller.rb +37 -0
- data/app/controllers/lesli_vault/dashboards_controller.rb +6 -0
- data/app/controllers/lesli_vault/descriptor/activities_controller.rb +122 -0
- data/app/controllers/lesli_vault/descriptor/privileges_controller.rb +104 -0
- data/app/controllers/lesli_vault/descriptors_controller.rb +130 -0
- data/app/controllers/lesli_vault/role/activities_controller.rb +76 -0
- data/app/controllers/lesli_vault/role/descriptors_controller.rb +95 -0
- data/app/controllers/lesli_vault/role/privileges_controller.rb +48 -0
- data/app/controllers/lesli_vault/roles_controller.rb +226 -0
- data/app/controllers/lesli_vault/system_controller/actions_controller.rb +112 -0
- data/app/controllers/lesli_vault/system_controllers_controller.rb +64 -0
- data/app/helpers/lesli_vault/application_helper.rb +4 -0
- data/app/helpers/lesli_vault/dashboards_helper.rb +4 -0
- data/app/helpers/lesli_vault/descriptor/activities_helper.rb +4 -0
- data/app/helpers/lesli_vault/descriptor/privileges_helper.rb +4 -0
- data/app/helpers/lesli_vault/descriptors_helper.rb +4 -0
- data/app/helpers/lesli_vault/role/activities_helper.rb +4 -0
- data/app/helpers/lesli_vault/role/descriptors_helper.rb +4 -0
- data/app/helpers/lesli_vault/role/privileges_helper.rb +4 -0
- data/app/helpers/lesli_vault/roles_helper.rb +4 -0
- data/app/helpers/lesli_vault/system_controller/actions_helper.rb +4 -0
- data/app/helpers/lesli_vault/system_controllers_helper.rb +4 -0
- data/app/jobs/lesli_vault/application_job.rb +37 -0
- data/app/mailers/lesli_vault/application_mailer.rb +39 -0
- data/app/models/lesli_vault/application_record.rb +39 -0
- data/app/models/lesli_vault/descriptor/activity.rb +40 -0
- data/app/models/lesli_vault/descriptor/privilege.rb +40 -0
- data/app/models/lesli_vault/descriptor.rb +41 -0
- data/app/models/lesli_vault/role/activity.rb +40 -0
- data/app/models/lesli_vault/role/descriptor.rb +40 -0
- data/app/models/lesli_vault/role/privilege.rb +40 -0
- data/app/models/lesli_vault/role.rb +39 -0
- data/app/models/lesli_vault/system_controller/action.rb +39 -0
- data/app/models/lesli_vault/system_controller.rb +40 -0
- data/app/services/application_lesli_services.rb +168 -0
- data/app/services/descriptor_services.rb +197 -0
- data/app/services/role_services.rb +218 -0
- data/app/services/system_controller_services.rb +99 -0
- data/app/views/layouts/lesli_vault/application.html.erb +15 -0
- data/app/views/lesli_vault/dashboards/show.html.erb +1 -0
- data/app/views/lesli_vault/descriptor/activities/_form.html.erb +32 -0
- data/app/views/lesli_vault/descriptor/activities/edit.html.erb +34 -0
- data/app/views/lesli_vault/descriptor/activities/index.html.erb +34 -0
- data/app/views/lesli_vault/descriptor/activities/new.html.erb +34 -0
- data/app/views/lesli_vault/descriptor/activities/show.html.erb +34 -0
- data/app/views/lesli_vault/descriptor/privileges/_form.html.erb +32 -0
- data/app/views/lesli_vault/descriptor/privileges/edit.html.erb +34 -0
- data/app/views/lesli_vault/descriptor/privileges/index.html.erb +34 -0
- data/app/views/lesli_vault/descriptor/privileges/new.html.erb +34 -0
- data/app/views/lesli_vault/descriptor/privileges/show.html.erb +34 -0
- data/app/views/lesli_vault/descriptors/_form.html.erb +32 -0
- data/app/views/lesli_vault/descriptors/edit.html.erb +34 -0
- data/app/views/lesli_vault/descriptors/index.html.erb +34 -0
- data/app/views/lesli_vault/descriptors/new.html.erb +34 -0
- data/app/views/lesli_vault/descriptors/show.html.erb +34 -0
- data/app/views/lesli_vault/role/activities/_form.html.erb +32 -0
- data/app/views/lesli_vault/role/activities/edit.html.erb +34 -0
- data/app/views/lesli_vault/role/activities/index.html.erb +34 -0
- data/app/views/lesli_vault/role/activities/new.html.erb +34 -0
- data/app/views/lesli_vault/role/activities/show.html.erb +34 -0
- data/app/views/lesli_vault/role/descriptors/_form.html.erb +32 -0
- data/app/views/lesli_vault/role/descriptors/edit.html.erb +34 -0
- data/app/views/lesli_vault/role/descriptors/index.html.erb +34 -0
- data/app/views/lesli_vault/role/descriptors/new.html.erb +34 -0
- data/app/views/lesli_vault/role/descriptors/show.html.erb +34 -0
- data/app/views/lesli_vault/role/privileges/_form.html.erb +32 -0
- data/app/views/lesli_vault/role/privileges/edit.html.erb +34 -0
- data/app/views/lesli_vault/role/privileges/index.html.erb +34 -0
- data/app/views/lesli_vault/role/privileges/new.html.erb +34 -0
- data/app/views/lesli_vault/role/privileges/show.html.erb +34 -0
- data/app/views/lesli_vault/roles/edit.html.erb +34 -0
- data/app/views/lesli_vault/roles/index.html.erb +34 -0
- data/app/views/lesli_vault/roles/new.html.erb +34 -0
- data/app/views/lesli_vault/roles/show.html.erb +34 -0
- data/app/views/lesli_vault/system_controller/actions/_form.html.erb +32 -0
- data/app/views/lesli_vault/system_controller/actions/edit.html.erb +34 -0
- data/app/views/lesli_vault/system_controller/actions/index.html.erb +34 -0
- data/app/views/lesli_vault/system_controller/actions/new.html.erb +34 -0
- data/app/views/lesli_vault/system_controller/actions/show.html.erb +34 -0
- data/app/views/lesli_vault/system_controllers/_form.html.erb +32 -0
- data/app/views/lesli_vault/system_controllers/edit.html.erb +34 -0
- data/app/views/lesli_vault/system_controllers/index.html.erb +34 -0
- data/app/views/lesli_vault/system_controllers/new.html.erb +34 -0
- data/app/views/lesli_vault/system_controllers/show.html.erb +34 -0
- data/app/vue/lesli_vault/application.js +38 -0
- data/app/vue/lesli_vault/apps/descriptors/components/form.vue +147 -0
- data/app/vue/lesli_vault/apps/descriptors/edit.vue +83 -0
- data/app/vue/lesli_vault/apps/descriptors/index.vue +116 -0
- data/app/vue/lesli_vault/apps/descriptors/new.vue +76 -0
- data/app/vue/lesli_vault/apps/descriptors/privileges.vue +179 -0
- data/app/vue/lesli_vault/apps/descriptors/show.vue +240 -0
- data/app/vue/lesli_vault/apps/roles/componentForm.vue +231 -0
- data/app/vue/lesli_vault/apps/roles/componentPrivilegeCustom.vue +86 -0
- data/app/vue/lesli_vault/apps/roles/componentPrivilegeStandard.vue +173 -0
- data/app/vue/lesli_vault/apps/roles/edit.vue +93 -0
- data/app/vue/lesli_vault/apps/roles/index.vue +169 -0
- data/app/vue/lesli_vault/apps/roles/logs.vue +110 -0
- data/app/vue/lesli_vault/apps/roles/new.vue +89 -0
- data/app/vue/lesli_vault/apps/roles/show.vue +111 -0
- data/app/vue/lesli_vault/apps/security/index.vue +208 -0
- data/app/vue/lesli_vault/stores/descriptor.js +116 -0
- data/app/vue/lesli_vault/stores/descriptors.js +167 -0
- data/app/vue/lesli_vault/stores/role.js +243 -0
- data/app/vue/lesli_vault/stores/roles.js +89 -0
- data/app/vue/lesli_vault/stores/systemController.js +67 -0
- data/config/routes.rb +52 -0
- data/lib/lesli_vault/engine.rb +18 -0
- data/lib/lesli_vault/version.rb +3 -0
- data/lib/lesli_vault.rb +6 -0
- data/lib/tasks/lesli_vault_tasks.rake +4 -0
- data/lib/tasks/system/controllers.rake +112 -0
- data/lib/vue/application.js +7 -0
- data/readme.md +19 -0
- metadata +181 -0
@@ -0,0 +1,34 @@
|
|
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 platform.
|
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
|
+
<router-view></router-view>
|
@@ -0,0 +1,34 @@
|
|
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 platform.
|
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
|
+
<router-view></router-view>
|
@@ -0,0 +1,38 @@
|
|
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 platform.
|
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 base for maunting the application
|
35
|
+
import application from "Lesli/application"
|
36
|
+
|
37
|
+
// ·
|
38
|
+
application("LesliVault", [])
|
@@ -0,0 +1,147 @@
|
|
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 { inject, onMounted } from "vue"
|
39
|
+
|
40
|
+
|
41
|
+
// · import lesli stores
|
42
|
+
import { useDescriptor } from "../../../stores/descriptor"
|
43
|
+
|
44
|
+
|
45
|
+
// · import vue router composable
|
46
|
+
import { useRouter, useRoute } from "vue-router"
|
47
|
+
|
48
|
+
|
49
|
+
// · implement stores
|
50
|
+
const storeDescriptor = useDescriptor()
|
51
|
+
|
52
|
+
|
53
|
+
// · initialize/inject plugins
|
54
|
+
const router = useRouter()
|
55
|
+
const url = inject("url")
|
56
|
+
const route = useRoute()
|
57
|
+
|
58
|
+
|
59
|
+
// · defining props
|
60
|
+
const props = defineProps({
|
61
|
+
isEditable: {
|
62
|
+
type: Boolean,
|
63
|
+
required: false,
|
64
|
+
default: false,
|
65
|
+
},
|
66
|
+
})
|
67
|
+
|
68
|
+
|
69
|
+
// · translations
|
70
|
+
const translations = {
|
71
|
+
core: {
|
72
|
+
roles: I18n.t("core.roles"),
|
73
|
+
shared: I18n.t("core.shared"),
|
74
|
+
role_descriptors: I18n.t('core.role_descriptors')
|
75
|
+
}
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* @description This function is used to update the descriptor information
|
81
|
+
*/
|
82
|
+
const onUpdate = () => {
|
83
|
+
storeDescriptor.updateDescriptor()
|
84
|
+
}
|
85
|
+
|
86
|
+
/**
|
87
|
+
* @description This function is used to create a new descriptor
|
88
|
+
*/
|
89
|
+
const onCreate = () => {
|
90
|
+
storeDescriptor.createDescriptor()
|
91
|
+
}
|
92
|
+
|
93
|
+
onMounted(() => {
|
94
|
+
if (!props.isEditable){
|
95
|
+
storeDescriptor.resetDescriptor()
|
96
|
+
} else {
|
97
|
+
storeDescriptor.fetchDescriptor(route.params?.id)
|
98
|
+
}
|
99
|
+
})
|
100
|
+
|
101
|
+
</script>
|
102
|
+
<template>
|
103
|
+
<lesli-form
|
104
|
+
class="information"
|
105
|
+
v-if="!storeDescriptor.loading"
|
106
|
+
@submit="isEditable ? onUpdate() : onCreate()">
|
107
|
+
|
108
|
+
<div class="field">
|
109
|
+
<label class="label">
|
110
|
+
{{ translations.core.view_text_name }}
|
111
|
+
<sup class="has-text-danger">*</sup>
|
112
|
+
</label>
|
113
|
+
<div class="control">
|
114
|
+
<input name="name" v-model="storeDescriptor.descriptor.name" required="required" type="text" class="input">
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<div class="field">
|
119
|
+
<label class="label">
|
120
|
+
{{ translations.core.role_descriptors.view_text_assign_parent_descriptor }}
|
121
|
+
</label>
|
122
|
+
<div class="control">
|
123
|
+
<lesli-select
|
124
|
+
v-model="storeDescriptor.descriptor.descriptors_id"
|
125
|
+
:options="storeDescriptor.descriptors_options">
|
126
|
+
</lesli-select>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
|
130
|
+
<div class="field">
|
131
|
+
<label class="label">
|
132
|
+
{{ translations.core.role_descriptors.column_description }}
|
133
|
+
</label>
|
134
|
+
<div class="control">
|
135
|
+
<textarea class="textarea" v-model="storeDescriptor.descriptor.description"></textarea>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<div class="field">
|
140
|
+
<div class="control">
|
141
|
+
<lesli-button icon="save">
|
142
|
+
{{ translations.core.shared.view_btn_save }}
|
143
|
+
</lesli-button>
|
144
|
+
</div>
|
145
|
+
</div>
|
146
|
+
</lesli-form>
|
147
|
+
</template>
|
@@ -0,0 +1,83 @@
|
|
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 platform.
|
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
|
+
import { useRouter, useRoute } from 'vue-router'
|
37
|
+
|
38
|
+
|
39
|
+
// · import lesli stores
|
40
|
+
import { useDescriptor } from "LesliApp/administration/stores/descriptor"
|
41
|
+
|
42
|
+
|
43
|
+
// · import components
|
44
|
+
import descriptorForm from "./components/form.vue"
|
45
|
+
|
46
|
+
|
47
|
+
// · initialize/inject plugins
|
48
|
+
const route = useRoute()
|
49
|
+
const url = inject("url")
|
50
|
+
|
51
|
+
|
52
|
+
// ·
|
53
|
+
const storeDescriptor = useDescriptor()
|
54
|
+
|
55
|
+
|
56
|
+
// ·
|
57
|
+
const translations = {
|
58
|
+
core: {
|
59
|
+
roles: I18n.t("core.roles"),
|
60
|
+
role_descriptors: I18n.t('core.role_descriptors'),
|
61
|
+
shared: I18n.t("core.shared")
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
// ·
|
67
|
+
onMounted(() => {
|
68
|
+
storeDescriptor.fetchDescriptor(route.params.id)
|
69
|
+
})
|
70
|
+
</script>
|
71
|
+
<template>
|
72
|
+
<section class="application-component">
|
73
|
+
<lesli-header :title="'Descriptor: '+storeDescriptor.descriptor.name">
|
74
|
+
<lesli-button icon="list" :to="url.admin('descriptors')">
|
75
|
+
{{ translations.core.view_btn_list }}
|
76
|
+
</lesli-button>
|
77
|
+
<lesli-button icon="settings" :to="url.admin('descriptors/:id/privileges', storeDescriptor.descriptor.id)">
|
78
|
+
{{ translations.core.roles.view_btn_edit_privilege_actions }}
|
79
|
+
</lesli-button>
|
80
|
+
</lesli-header>
|
81
|
+
<descriptor-form is-editable></descriptor-form>
|
82
|
+
</section>
|
83
|
+
</template>
|
@@ -0,0 +1,116 @@
|
|
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 platform.
|
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
|
+
// · import vue tools
|
36
|
+
import {onMounted, inject } from "vue"
|
37
|
+
import { useRouter } from 'vue-router'
|
38
|
+
|
39
|
+
|
40
|
+
// · import lesli stores
|
41
|
+
import { useDescriptors } from "LesliApp/administration/stores/descriptors"
|
42
|
+
|
43
|
+
|
44
|
+
// · initialize/inject plugins
|
45
|
+
const url = inject("url")
|
46
|
+
|
47
|
+
|
48
|
+
// ·
|
49
|
+
const storeDescriptors = useDescriptors()
|
50
|
+
|
51
|
+
|
52
|
+
// ·
|
53
|
+
const translations = {
|
54
|
+
core: {
|
55
|
+
roles: I18n.t("core.roles"),
|
56
|
+
users: I18n.t("core.users"),
|
57
|
+
role_descriptors: I18n.t('core.role_descriptors'),
|
58
|
+
shared: I18n.t("core.shared")
|
59
|
+
}
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
// ·
|
64
|
+
const columns = [{
|
65
|
+
field: "id",
|
66
|
+
label: "ID",
|
67
|
+
sort: true
|
68
|
+
}, {
|
69
|
+
field: "name",
|
70
|
+
label: "Name",
|
71
|
+
sort: true
|
72
|
+
}, {
|
73
|
+
field: "privileges_count",
|
74
|
+
label: "Privileges",
|
75
|
+
align: "center",
|
76
|
+
sort: true
|
77
|
+
}, {
|
78
|
+
field: "created_at_date",
|
79
|
+
label: "Created at"
|
80
|
+
}]
|
81
|
+
|
82
|
+
|
83
|
+
// ·
|
84
|
+
onMounted(() => {
|
85
|
+
storeDescriptors.fetchDescriptors()
|
86
|
+
})
|
87
|
+
|
88
|
+
</script>
|
89
|
+
<template>
|
90
|
+
<application-component>
|
91
|
+
<lesli-header title="Role Descriptors">
|
92
|
+
<lesli-button icon="refresh"
|
93
|
+
:loading="storeDescriptors.index.loading"
|
94
|
+
@click="storeDescriptors.getDescriptors()">
|
95
|
+
{{ translations.core.shared.view_text_btn_reload }}
|
96
|
+
</lesli-button>
|
97
|
+
<lesli-button icon="add" :to="url.admin(`descriptors/new`)">
|
98
|
+
{{ translations.core.role_descriptors.view_btn_new_role_descriptor }}
|
99
|
+
</lesli-button>
|
100
|
+
</lesli-header>
|
101
|
+
|
102
|
+
<lesli-card>
|
103
|
+
<lesli-toolbar @search="storeDescriptors.search"></lesli-toolbar>
|
104
|
+
|
105
|
+
<lesli-table
|
106
|
+
:link="(descriptor) => url.admin('descriptors/:id', descriptor.id)"
|
107
|
+
:columns="columns"
|
108
|
+
:loading="storeDescriptors.index.loading"
|
109
|
+
:records="storeDescriptors.index.records"
|
110
|
+
:pagination="storeDescriptors.index.pagination"
|
111
|
+
@paginate="storeDescriptors.paginateIndex"
|
112
|
+
@sort="storeDescriptors.sortIndex">
|
113
|
+
</lesli-table>
|
114
|
+
</lesli-card>
|
115
|
+
</application-component>
|
116
|
+
</template>
|
@@ -0,0 +1,76 @@
|
|
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 { onMounted } from "vue"
|
39
|
+
import { useRouter, useRoute } from 'vue-router'
|
40
|
+
|
41
|
+
|
42
|
+
// · import lesli stores
|
43
|
+
import { useDescriptor } from "LesliApp/administration/stores/descriptor"
|
44
|
+
|
45
|
+
// · import components
|
46
|
+
import descriptorForm from "./components/form.vue"
|
47
|
+
|
48
|
+
// · implement stores
|
49
|
+
const storeDescriptor = useDescriptor()
|
50
|
+
|
51
|
+
// · translations
|
52
|
+
const translations = {
|
53
|
+
core: {
|
54
|
+
roles: I18n.t("core.roles"),
|
55
|
+
shared: I18n.t("core.shared"),
|
56
|
+
role_descriptors: I18n.t('core.role_descriptors')
|
57
|
+
}
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
onMounted(() => {
|
62
|
+
//storeDescriptor.getDescriptorsOptions()
|
63
|
+
})
|
64
|
+
|
65
|
+
</script>
|
66
|
+
|
67
|
+
<template>
|
68
|
+
<section class="application-component">
|
69
|
+
<lesli-header :title="translations.core.role_descriptors.view_btn_new_role_descriptors">
|
70
|
+
<lesli-button icon="list" :to="url.admin('descriptors')">
|
71
|
+
{{ translations.core.view_btn_list }}
|
72
|
+
</lesli-button>
|
73
|
+
</lesli-header>
|
74
|
+
<descriptor-form></descriptor-form>
|
75
|
+
</section>
|
76
|
+
</template>
|