@dracul/audit-frontend 1.35.10 → 1.35.12
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 +2 -2
- package/src/i18n/messages/audit-messages.js +12 -12
- package/src/pages/AuditPage/index.vue +15 -2
- package/src/pages/TestingPage/index.vue +32 -32
- package/src/providers/AuditProvider.js +2 -2
- package/src/providers/gql/Audit/createAudit.graphql +4 -2
- package/src/providers/gql/Audit/fetchAudit.graphql +1 -0
- package/src/providers/gql/Audit/findAudit.graphql +1 -0
- package/src/providers/gql/Audit/paginateAudit.graphql +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dracul/audit-frontend",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.12",
|
|
4
4
|
"description": "Audit frontend",
|
|
5
5
|
"author": "Cristian Incarnato <cristian.cdi@gmail.com>",
|
|
6
6
|
"publishConfig": {
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"type": "git",
|
|
39
39
|
"url": "git+https://github.com/draculjs/modular-framework.git"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "342e52a3f499a40b77891cd8ca2267131a2223cd"
|
|
42
42
|
}
|
|
@@ -105,7 +105,7 @@ const i18nMessages = {
|
|
|
105
105
|
read: 'Se ha visualizado el recurso "{resourceID}"',
|
|
106
106
|
update: 'Se ha modificado el recurso "{resourceID}"',
|
|
107
107
|
delete: 'Se ha eliminado el recurso "{resourceID}"',
|
|
108
|
-
restart: 'Se ha reiniciado el recurso "{resourceID}',
|
|
108
|
+
restart: 'Se ha reiniciado el recurso "{resourceID}"',
|
|
109
109
|
},
|
|
110
110
|
|
|
111
111
|
changes: {
|
|
@@ -161,24 +161,24 @@ const i18nMessages = {
|
|
|
161
161
|
actionFor: 'Ação Para',
|
|
162
162
|
action: 'Ação',
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
create: '
|
|
166
|
-
read: '
|
|
164
|
+
ações: {
|
|
165
|
+
create: 'Criar',
|
|
166
|
+
read: 'Display',
|
|
167
167
|
update: 'Modificar',
|
|
168
|
-
delete: '
|
|
168
|
+
delete: 'Excluir',
|
|
169
169
|
restart: 'Reiniciar',
|
|
170
170
|
detailMessages: {
|
|
171
|
-
create: '
|
|
172
|
-
read: '
|
|
173
|
-
update: '
|
|
174
|
-
delete: '
|
|
175
|
-
restart: '
|
|
171
|
+
create: 'O recurso “{resourceID}” foi criado',
|
|
172
|
+
read: 'O recurso “{resourceID}” foi exibido',
|
|
173
|
+
update: 'O recurso “{resourceID}” foi modificado',
|
|
174
|
+
delete: 'O recurso “{resourceID}” foi excluído',
|
|
175
|
+
restart: 'O recurso “{resourceID}” foi reiniciado',
|
|
176
176
|
},
|
|
177
177
|
|
|
178
178
|
changes: {
|
|
179
179
|
field: 'Campo',
|
|
180
|
-
oldValue: 'Valor
|
|
181
|
-
newValue: '
|
|
180
|
+
oldValue: 'Valor antigo',
|
|
181
|
+
newValue: 'Novo valor',
|
|
182
182
|
},
|
|
183
183
|
},
|
|
184
184
|
|
|
@@ -279,8 +279,21 @@ export default {
|
|
|
279
279
|
|
|
280
280
|
return actionColors[action]
|
|
281
281
|
},
|
|
282
|
-
getDetailsText(
|
|
283
|
-
|
|
282
|
+
getDetailsText(audit){
|
|
283
|
+
|
|
284
|
+
console.log(`audit: ${JSON.stringify(audit, null, 2)}`)
|
|
285
|
+
console.log(`typeof resource data: ${typeof audit.resourceData}`)
|
|
286
|
+
|
|
287
|
+
if (audit && audit.resourceData && audit.resourceData !== '' && typeof audit.resourceData === 'string' && audit.resourceData !== null && audit.resourceData !== undefined) {
|
|
288
|
+
try {
|
|
289
|
+
audit.resourceData = JSON.parse(audit.resourceData)
|
|
290
|
+
} catch {
|
|
291
|
+
console.error('Invalid JSON format in resourceData')
|
|
292
|
+
return []
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return audit.resourceName || audit.resourceData?.Spec?.Name || audit.details
|
|
284
297
|
},
|
|
285
298
|
performSearch() {
|
|
286
299
|
this.pageNumber = 1
|
|
@@ -22,43 +22,43 @@ export default {
|
|
|
22
22
|
methods: {
|
|
23
23
|
createNewAudit() {
|
|
24
24
|
AuditProvider.createAudit('CREATE', 'Servicio', 'kdsf8rg9c48v', [], {
|
|
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
|
-
})
|
|
25
|
+
"id": "7a6irev0so3iuiobiw1fpf08z",
|
|
26
|
+
"name": "nuevoservicioTesting",
|
|
27
|
+
"stack": "testing",
|
|
28
|
+
"image": {
|
|
29
|
+
"id": "",
|
|
30
|
+
"fullname": "sndregistry.sondeosglobal.com/docs/snd-docs:latest",
|
|
31
|
+
"domain": "sndregistry.sondeosglobal.com",
|
|
32
|
+
"namespace": "docs",
|
|
33
|
+
"name": "snd-docs",
|
|
34
|
+
"tag": "latest",
|
|
35
|
+
"nameWithTag": "snd-docs:latest"
|
|
36
|
+
},
|
|
37
|
+
"createdAt": "2024-12-09T14:38:53.389502821Z",
|
|
38
|
+
"updatedAt": "2024-12-17T11:31:41.591560506Z",
|
|
39
|
+
"labels": [
|
|
40
|
+
{
|
|
41
|
+
"name": "com.docker.stack.namespace",
|
|
42
|
+
"value": "testing"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"envs": [
|
|
46
|
+
{
|
|
47
|
+
"name": "CONTROL_VERSION",
|
|
48
|
+
"value": "41873"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"limits": {},
|
|
52
|
+
"mode": "replic",
|
|
53
|
+
"extraHosts": [],
|
|
54
|
+
"dns": []
|
|
55
|
+
}, 'FORTES')
|
|
56
56
|
},
|
|
57
57
|
updateAudit() {
|
|
58
58
|
AuditProvider.createAudit('UPDATE', 'Servicio', 'kdsf8rg9c48v', [
|
|
59
59
|
{ field: 'name', oldValue: 'debops', newValue: 'devops' },
|
|
60
60
|
{ field: 'image', oldValue: 'sndregistry.sondeosglobal.com/docs/snd-docs', newValue: 'sndregistry.sondeosglobal.com/dockerway/docker-devops:2.13.0' },
|
|
61
|
-
{ field: 'stack', oldValue: 'docker', newValue: 'dockerway'}
|
|
61
|
+
{ field: 'stack', oldValue: 'docker', newValue: 'dockerway' }
|
|
62
62
|
])
|
|
63
63
|
},
|
|
64
64
|
deleteAudit() {
|
|
@@ -41,10 +41,10 @@ class AuditProvider {
|
|
|
41
41
|
})
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
createAudit(action, entity, details, changes, resourceData){
|
|
44
|
+
createAudit(action, entity, details, changes, resourceData, resourceName){
|
|
45
45
|
return this.getGraphqlClient().mutate({
|
|
46
46
|
mutation: require('./gql/Audit/createAudit.graphql'),
|
|
47
|
-
variables: {action, entity, details, changes, resourceData},
|
|
47
|
+
variables: {action, entity, details, changes, resourceData, resourceName},
|
|
48
48
|
fetchPolicy: "no-cache"
|
|
49
49
|
})
|
|
50
50
|
}
|
|
@@ -3,9 +3,10 @@ mutation createAudit(
|
|
|
3
3
|
$entity: String!,
|
|
4
4
|
$details: String,
|
|
5
5
|
$changes: [ChangesInput],
|
|
6
|
-
$resourceData: JSON
|
|
6
|
+
$resourceData: JSON,
|
|
7
|
+
$resourceName: String,
|
|
7
8
|
) {
|
|
8
|
-
createAudit(action: $action, entity: $entity, details: $details, changes: $changes, resourceData: $resourceData) {
|
|
9
|
+
createAudit(action: $action, entity: $entity, details: $details, changes: $changes, resourceData: $resourceData, resourceName: $resourceName) {
|
|
9
10
|
id
|
|
10
11
|
user {
|
|
11
12
|
username
|
|
@@ -19,5 +20,6 @@ mutation createAudit(
|
|
|
19
20
|
newValue
|
|
20
21
|
}
|
|
21
22
|
resourceData
|
|
23
|
+
resourceName
|
|
22
24
|
}
|
|
23
25
|
}
|