@growy/strapi-plugin-encrypted-field 2.1.2 → 2.1.4
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/README.md +4 -2
- package/admin/src/pages/AuditLogs.jsx +37 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Plugin oficial de **Growy AI** para Strapi que proporciona un campo personalizad
|
|
|
20
20
|
- ✅ **Gestión de claves robusta** con validación y mensajes de error claros
|
|
21
21
|
- ✅ **Datos cifrados** en base de datos con IV único y Auth Tag
|
|
22
22
|
- ✅ **Reutilizable** en cualquier colección o componente
|
|
23
|
-
- ✅ **
|
|
23
|
+
- ✅ **Compatible con Strapi 5** - Utiliza componentes actualizados del Design System v2
|
|
24
24
|
|
|
25
25
|
## Instalación
|
|
26
26
|
|
|
@@ -99,10 +99,12 @@ npm run develop
|
|
|
99
99
|
|
|
100
100
|
## Requisitos
|
|
101
101
|
|
|
102
|
-
- **Strapi**: v5.0.0 o superior
|
|
102
|
+
- **Strapi**: v5.0.0 o superior (compatible con Design System v2)
|
|
103
103
|
- **Node.js**: 18.x - 22.x
|
|
104
104
|
- **npm**: 6.0.0 o superior
|
|
105
105
|
|
|
106
|
+
⚠️ **Nota sobre Strapi 5**: Esta versión utiliza los componentes actualizados del Design System v2. Si tienes problemas con componentes de layout, asegúrate de que tu proyecto esté actualizado a Strapi 5.
|
|
107
|
+
|
|
106
108
|
## Validación de datos
|
|
107
109
|
|
|
108
110
|
El plugin soporta validación antes del cifrado:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Box, Typography, Table, Pagination, Badge } from '@strapi/design-system';
|
|
3
3
|
import { useNotification } from '@strapi/strapi/admin';
|
|
4
4
|
|
|
5
5
|
const AuditLogs = () => {
|
|
@@ -76,44 +76,47 @@ const AuditLogs = () => {
|
|
|
76
76
|
];
|
|
77
77
|
|
|
78
78
|
return (
|
|
79
|
-
<
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
79
|
+
<Box padding={8}>
|
|
80
|
+
<Box paddingBottom={4}>
|
|
81
|
+
<Typography variant="alpha">Logs de Auditoría - Campos Cifrados</Typography>
|
|
82
|
+
<Typography variant="epsilon" textColor="neutral600">
|
|
83
|
+
Registro de acciones realizadas sobre campos cifrados
|
|
84
|
+
</Typography>
|
|
85
|
+
</Box>
|
|
86
|
+
|
|
87
|
+
{loading ? (
|
|
88
|
+
<Box>Cargando...</Box>
|
|
89
|
+
) : (
|
|
90
|
+
<>
|
|
91
|
+
<Table
|
|
92
|
+
headers={tableHeaders}
|
|
93
|
+
rows={logs.map(log => ({
|
|
94
|
+
timestamp: formatTimestamp(log.timestamp),
|
|
95
|
+
user: log.user,
|
|
96
|
+
action: (
|
|
97
|
+
<Badge color={getBadgeColor(log.action)}>
|
|
98
|
+
{log.action === 'view' && 'Vista'}
|
|
99
|
+
{log.action === 'copy' && 'Copiado'}
|
|
100
|
+
{log.action === 'decrypt' && 'Descifrado'}
|
|
101
|
+
</Badge>
|
|
102
|
+
),
|
|
103
|
+
field: log.field,
|
|
104
|
+
collection: log.collection,
|
|
105
|
+
entry_id: log.entry_id,
|
|
106
|
+
}))}
|
|
107
|
+
/>
|
|
108
|
+
{pagination.total > pagination.pageSize && (
|
|
109
|
+
<Box paddingTop={4}>
|
|
107
110
|
<Pagination
|
|
108
111
|
activePage={pagination.page}
|
|
109
112
|
pageCount={pagination.pageCount}
|
|
110
113
|
onPageChange={handlePageChange}
|
|
111
114
|
/>
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</
|
|
115
|
+
</Box>
|
|
116
|
+
)}
|
|
117
|
+
</>
|
|
118
|
+
)}
|
|
119
|
+
</Box>
|
|
117
120
|
);
|
|
118
121
|
};
|
|
119
122
|
|