@dracul/audit-frontend 1.16.0 → 1.16.9
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dracul/audit-frontend",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.9",
|
|
4
4
|
"description": "Audit frontend",
|
|
5
5
|
"author": "Cristian Incarnato <cristian.cdi@gmail.com>",
|
|
6
6
|
"scripts": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
},
|
|
12
12
|
"main": "./src/index.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@dracul/common-frontend": "^1.
|
|
15
|
-
"@dracul/dayjs-frontend": "^1.
|
|
14
|
+
"@dracul/common-frontend": "^1.16.3",
|
|
15
|
+
"@dracul/dayjs-frontend": "^1.16.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@babel/core": "^7.12.3",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"type": "git",
|
|
67
67
|
"url": "git+https://github.com/draculjs/modular-framework.git"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "8e0742ac01f310ccfbced2420587b74771750d62"
|
|
70
70
|
}
|
|
@@ -4,9 +4,8 @@ const i18nMessages = {
|
|
|
4
4
|
name: 'Audit',
|
|
5
5
|
title: 'Audit management',
|
|
6
6
|
subtitle: 'View, search, create, edit and delete Audit',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
deleting: 'Deleting Audit',
|
|
7
|
+
filters: "Audit filters",
|
|
8
|
+
filterByUser: 'Realized by user',
|
|
10
9
|
showing: 'Showing Audit',
|
|
11
10
|
menu: 'Audit',
|
|
12
11
|
labels: {
|
|
@@ -20,6 +19,8 @@ const i18nMessages = {
|
|
|
20
19
|
userAudit: 'User audit',
|
|
21
20
|
|
|
22
21
|
when: 'When',
|
|
22
|
+
from: 'from',
|
|
23
|
+
until: 'until',
|
|
23
24
|
actionBy: 'Action By',
|
|
24
25
|
actionFor: 'Action For',
|
|
25
26
|
action: 'Action',
|
|
@@ -46,11 +47,10 @@ const i18nMessages = {
|
|
|
46
47
|
es: {
|
|
47
48
|
audit: {
|
|
48
49
|
name: 'Auditorias',
|
|
49
|
-
title: '
|
|
50
|
-
subtitle: 'Ver
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
deleting: 'Eliminando Auditoria',
|
|
50
|
+
title: 'Visualizacion de Auditorias',
|
|
51
|
+
subtitle: 'Ver y buscar Auditorias',
|
|
52
|
+
filters: "Filtros de auditoria",
|
|
53
|
+
filterByUser: 'Realizada por usuario',
|
|
54
54
|
showing: 'Detalles de Auditoria',
|
|
55
55
|
menu: 'Auditoria',
|
|
56
56
|
labels: {
|
|
@@ -63,6 +63,8 @@ const i18nMessages = {
|
|
|
63
63
|
|
|
64
64
|
userAudit: 'Auditoria de usuario',
|
|
65
65
|
when: 'Cuando',
|
|
66
|
+
from: 'Desde',
|
|
67
|
+
until: 'Hasta',
|
|
66
68
|
actionBy: 'Acción Por',
|
|
67
69
|
actionFor: 'Acción Para',
|
|
68
70
|
action: 'Acción',
|
|
@@ -91,9 +93,8 @@ const i18nMessages = {
|
|
|
91
93
|
name: 'Audit',
|
|
92
94
|
title: 'Administração de Audit',
|
|
93
95
|
subtitle: 'Ver, buscar, criar, editar e usar Audit',
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
deleting: 'Apagando Audit',
|
|
96
|
+
filters: "filtros de audit",
|
|
97
|
+
filterByUser: 'Realizada por usuario',
|
|
97
98
|
showing: 'Detalhes do Audit',
|
|
98
99
|
menu: 'Audit',
|
|
99
100
|
labels: {
|
|
@@ -106,6 +107,8 @@ const i18nMessages = {
|
|
|
106
107
|
|
|
107
108
|
userAudit: 'Auditoria de Usuário',
|
|
108
109
|
when: 'Quando',
|
|
110
|
+
from: 'Desde',
|
|
111
|
+
until: 'Hasta',
|
|
109
112
|
actionBy: 'Ação por',
|
|
110
113
|
actionFor: 'Ação Para',
|
|
111
114
|
action: 'Ação',
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-card flat>
|
|
3
|
+
<v-card-title>{{$t('audit.filters')}}</v-card-title>
|
|
4
|
+
|
|
5
|
+
<v-card-text class="pt-0 mt-0">
|
|
6
|
+
<v-row>
|
|
7
|
+
<v-col cols="12" class="py-0">
|
|
8
|
+
<v-row>
|
|
9
|
+
|
|
10
|
+
<v-col cols="12" md="4" sm="4">
|
|
11
|
+
<v-text-field
|
|
12
|
+
v-model="filters[0].value"
|
|
13
|
+
:label="$t('audit.action')"
|
|
14
|
+
prepend-icon="bolt"
|
|
15
|
+
color="secondary"
|
|
16
|
+
hide-details
|
|
17
|
+
clearable
|
|
18
|
+
/>
|
|
19
|
+
</v-col>
|
|
20
|
+
|
|
21
|
+
<v-col cols="12" md="4" sm="4">
|
|
22
|
+
<v-text-field
|
|
23
|
+
v-model="filters[2].value"
|
|
24
|
+
:label="$t('audit.labels.targetResource')"
|
|
25
|
+
prepend-icon="article"
|
|
26
|
+
color="secondary"
|
|
27
|
+
hide-details
|
|
28
|
+
clearable
|
|
29
|
+
/>
|
|
30
|
+
</v-col>
|
|
31
|
+
|
|
32
|
+
<v-col cols="12" md="4" sm="4">
|
|
33
|
+
<user-autocomplete
|
|
34
|
+
v-model="filters[1].value"
|
|
35
|
+
:label="$t('audit.filterByUser')"
|
|
36
|
+
solo
|
|
37
|
+
clearable
|
|
38
|
+
chips
|
|
39
|
+
class="elevation-0"
|
|
40
|
+
/>
|
|
41
|
+
</v-col>
|
|
42
|
+
</v-row>
|
|
43
|
+
</v-col>
|
|
44
|
+
<v-col cols="12" class="text-right">
|
|
45
|
+
<v-btn small text color="secondary" @click="cleanFilters()">{{
|
|
46
|
+
"Limpiar filtros"
|
|
47
|
+
}}</v-btn>
|
|
48
|
+
|
|
49
|
+
<v-btn small color="secondary" @click="setFilters()">{{
|
|
50
|
+
"Aplicar filtros"
|
|
51
|
+
}}</v-btn>
|
|
52
|
+
</v-col>
|
|
53
|
+
</v-row>
|
|
54
|
+
</v-card-text>
|
|
55
|
+
</v-card>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
|
|
60
|
+
import { UserAutocomplete} from '@dracul/user-frontend'
|
|
61
|
+
import { mapGetters } from 'vuex'
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export default {
|
|
65
|
+
name: "AuditFilters",
|
|
66
|
+
components: { UserAutocomplete },
|
|
67
|
+
props: {
|
|
68
|
+
value: Array
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
...mapGetters([
|
|
72
|
+
'me'
|
|
73
|
+
]),
|
|
74
|
+
filters: {
|
|
75
|
+
get() {return this.value},
|
|
76
|
+
set(val) {
|
|
77
|
+
this.$emit('input', val)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
return {
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
methods: {
|
|
86
|
+
setFilters() {
|
|
87
|
+
this.$emit("updateFilters", this.filters);
|
|
88
|
+
},
|
|
89
|
+
cleanFilters() {
|
|
90
|
+
this.$emit("clearFilter", this.filters);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
</script>
|
|
95
|
+
|
|
@@ -1,90 +1,111 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
2
|
+
<v-card class="fill-height">
|
|
3
|
+
<v-card-title>
|
|
4
|
+
{{ this.$t('audit.title') }}
|
|
5
|
+
</v-card-title>
|
|
6
|
+
|
|
7
|
+
<v-card-subtitle>
|
|
8
|
+
{{ this.$t('audit.subtitle') }}
|
|
9
|
+
</v-card-subtitle>
|
|
10
|
+
|
|
11
|
+
<v-row align-content="space-between" justify="space-between" style="height: 90%;">
|
|
12
|
+
|
|
13
|
+
<v-col cols="12" >
|
|
14
|
+
<audit-filters
|
|
15
|
+
@updateFilters="setFilters"
|
|
16
|
+
@clearFilter="cleanFilters"
|
|
17
|
+
v-model="filters"
|
|
18
|
+
>
|
|
19
|
+
</audit-filters>
|
|
20
|
+
|
|
21
|
+
</v-col>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<v-col cols="12" fill-height>
|
|
25
|
+
|
|
26
|
+
<v-data-table
|
|
27
|
+
:headers="headers"
|
|
28
|
+
:items="items"
|
|
29
|
+
:search="search"
|
|
30
|
+
:single-expand="false"
|
|
31
|
+
:server-items-length="totalItems"
|
|
32
|
+
:loading="loading"
|
|
33
|
+
:page.sync="pageNumber"
|
|
34
|
+
:items-per-page.sync="itemsPerPage"
|
|
35
|
+
:sort-by.sync="orderBy"
|
|
36
|
+
:sort-desc.sync="orderDesc"
|
|
37
|
+
:footer-props="{ itemsPerPageOptions: [5, 10, 25, 50] }"
|
|
38
|
+
@update:page="fetch"
|
|
39
|
+
@update:sort-by="fetch"
|
|
40
|
+
@update:sort-desc="fetch"
|
|
41
|
+
@update:items-per-page="fetch"
|
|
42
|
+
>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
<template v-slot:item.user="{ item }">
|
|
46
|
+
{{ item.user ? item.user.username : '' }}
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<template v-slot:item.createdAt="{ item }">
|
|
50
|
+
{{ getDateTimeFormat(item.createdAt) }}
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<template slot="no-data" fill-height>
|
|
55
|
+
<div class="text-xs-center" v-t="'common.noData'"></div>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<template slot="loading" fill-height>
|
|
59
|
+
<div class="text-xs-center" v-t="'common.loading'"></div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
</v-data-table>
|
|
64
|
+
</v-col>
|
|
65
|
+
</v-row>
|
|
66
|
+
</v-card>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
import AuditProvider from "../../providers/AuditProvider";
|
|
71
|
+
import AuditFilters from "./AuditFilters.vue";
|
|
72
|
+
|
|
73
|
+
// import { SearchInput} from "@dracul/common-frontend"
|
|
74
|
+
import { DayjsMixin} from "@dracul/dayjs-frontend"
|
|
65
75
|
|
|
66
76
|
|
|
67
77
|
export default {
|
|
68
78
|
name: "AuditList",
|
|
69
|
-
|
|
79
|
+
// SearchInput,
|
|
80
|
+
components: {AuditFilters},
|
|
70
81
|
mixins: [DayjsMixin],
|
|
71
82
|
data() {
|
|
72
83
|
return {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
items: [],
|
|
85
|
+
totalItems: null,
|
|
86
|
+
loading: false,
|
|
87
|
+
orderBy: null,
|
|
88
|
+
orderDesc: false,
|
|
89
|
+
itemsPerPage: 5,
|
|
90
|
+
pageNumber: 1,
|
|
91
|
+
search: '',
|
|
92
|
+
filters: [
|
|
93
|
+
{
|
|
94
|
+
field: 'action',
|
|
95
|
+
operator: '$regex',
|
|
96
|
+
value: null
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
field: 'user',
|
|
100
|
+
operator: '$eq',
|
|
101
|
+
value: null
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
field: 'resource',
|
|
105
|
+
operator: '$regex',
|
|
106
|
+
value: null
|
|
107
|
+
}
|
|
108
|
+
]
|
|
88
109
|
}
|
|
89
110
|
},
|
|
90
111
|
computed: {
|
|
@@ -124,12 +145,24 @@
|
|
|
124
145
|
this.getOrderBy,
|
|
125
146
|
this.getOrderDesc
|
|
126
147
|
).then(r => {
|
|
148
|
+
console.log('paginate audit', r)
|
|
127
149
|
this.items = r.data.paginateAudit.items
|
|
128
150
|
this.totalItems = r.data.paginateAudit.totalItems
|
|
129
151
|
}).catch(err => {
|
|
130
152
|
console.error(err)
|
|
131
153
|
}).finally(() => this.loading = false)
|
|
132
|
-
}
|
|
154
|
+
},
|
|
155
|
+
setFilters(auditFilters) {
|
|
156
|
+
console.log('auditFilters', auditFilters)
|
|
157
|
+
this.filters = auditFilters
|
|
158
|
+
this.fetch()
|
|
159
|
+
},
|
|
160
|
+
cleanFilters() {
|
|
161
|
+
this.filters.forEach(filter => {
|
|
162
|
+
filter.value = null
|
|
163
|
+
})
|
|
164
|
+
this.fetch()
|
|
165
|
+
}
|
|
133
166
|
}
|
|
134
167
|
|
|
135
168
|
}
|