utn-cli 2.0.61 → 2.0.62
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 +1 -1
- package/templates/frontend/src/app/Componentes/Nucleo/gestion-actividad/gestion-actividad.component.css +15 -46
- package/templates/frontend/src/app/Componentes/Nucleo/gestion-actividad/gestion-actividad.component.html +32 -34
- package/templates/frontend/src/app/Componentes/Nucleo/gestion-actividad/gestion-actividad.component.ts +26 -15
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
border-radius: 12px;
|
|
11
11
|
margin-bottom: 20px;
|
|
12
12
|
border: 1px solid #e0e6ed;
|
|
13
|
-
box-shadow: 0 2px 4px rgba(0,
|
|
13
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
|
14
14
|
text-align: left;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
border: 1px solid #e0e6ed;
|
|
81
81
|
border-radius: 12px;
|
|
82
82
|
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
83
|
-
box-shadow: 0 2px 4px rgba(0,
|
|
83
|
+
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
|
|
84
84
|
text-align: left;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -110,37 +110,17 @@
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
/* Colores por método */
|
|
113
|
-
.metodo-get {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.metodo-post {
|
|
119
|
-
color: #518a5f;
|
|
120
|
-
background-color: #e8f5e9;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.metodo-put {
|
|
124
|
-
color: #FFA757;
|
|
125
|
-
background-color: #fff3e0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.metodo-delete {
|
|
129
|
-
color: #F82617;
|
|
130
|
-
background-color: #ffebee;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.metodo-default {
|
|
134
|
-
color: #7d7d7d;
|
|
135
|
-
background-color: #f5f5f5;
|
|
136
|
-
}
|
|
113
|
+
.metodo-get { color: #0069B4; background-color: #e3f2fd; }
|
|
114
|
+
.metodo-post { color: #518a5f; background-color: #e8f5e9; }
|
|
115
|
+
.metodo-put { color: #FFA757; background-color: #fff3e0; }
|
|
116
|
+
.metodo-delete { color: #F82617; background-color: #ffebee; }
|
|
117
|
+
.metodo-default { color: #7d7d7d; background-color: #f5f5f5; }
|
|
137
118
|
|
|
138
119
|
.item-contenido {
|
|
139
120
|
flex: 1;
|
|
140
121
|
display: flex;
|
|
141
122
|
flex-direction: column;
|
|
142
|
-
min-width: 0;
|
|
143
|
-
/* Evita que el flex desborde */
|
|
123
|
+
min-width: 0; /* Evita que el flex desborde */
|
|
144
124
|
}
|
|
145
125
|
|
|
146
126
|
.item-titulo {
|
|
@@ -188,21 +168,10 @@
|
|
|
188
168
|
height: 14px;
|
|
189
169
|
}
|
|
190
170
|
|
|
191
|
-
.detalle-dispositivo mat-icon {
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.detalle-browser mat-icon {
|
|
196
|
-
color: #5f6368;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
.detalle-ip mat-icon {
|
|
200
|
-
color: #0069B4;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.detalle-pais mat-icon {
|
|
204
|
-
color: #F87600;
|
|
205
|
-
}
|
|
171
|
+
.detalle-dispositivo mat-icon { color: #673ab7; }
|
|
172
|
+
.detalle-browser mat-icon { color: #5f6368; }
|
|
173
|
+
.detalle-ip mat-icon { color: #0069B4; }
|
|
174
|
+
.detalle-pais mat-icon { color: #F87600; }
|
|
206
175
|
|
|
207
176
|
.item-fecha {
|
|
208
177
|
font-size: 11px;
|
|
@@ -227,14 +196,14 @@ mat-progress-bar {
|
|
|
227
196
|
flex-direction: column;
|
|
228
197
|
align-items: flex-start;
|
|
229
198
|
}
|
|
230
|
-
|
|
199
|
+
|
|
231
200
|
.item-icono {
|
|
232
201
|
margin-bottom: 12px;
|
|
233
202
|
}
|
|
234
|
-
|
|
203
|
+
|
|
235
204
|
.item-fecha {
|
|
236
205
|
margin-left: 0;
|
|
237
206
|
margin-top: 12px;
|
|
238
207
|
align-items: flex-start;
|
|
239
208
|
}
|
|
240
|
-
}
|
|
209
|
+
}
|
|
@@ -2,59 +2,57 @@
|
|
|
2
2
|
<div class="header-actividad">
|
|
3
3
|
<h2><mat-icon>history</mat-icon> Actividad reciente de la cuenta</h2>
|
|
4
4
|
<p>Historial de acciones realizadas en el sistema</p>
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
<div class="mensaje-informativo">
|
|
7
7
|
<mat-icon>info</mat-icon>
|
|
8
|
-
<p>Si tiene dudas sobre la información que ve en pantalla, por favor comparta una captura de pantalla al correo
|
|
9
|
-
<strong>soporte@utn.ac.cr</strong>.</p>
|
|
8
|
+
<p>Si tiene dudas sobre la información que ve en pantalla, por favor comparta una captura de pantalla al correo <strong>soporte@utn.ac.cr</strong>.</p>
|
|
10
9
|
</div>
|
|
11
10
|
</div>
|
|
12
11
|
|
|
13
12
|
@if(cargando){
|
|
14
|
-
|
|
13
|
+
<mat-progress-bar mode="indeterminate"></mat-progress-bar>
|
|
15
14
|
}
|
|
16
|
-
|
|
15
|
+
|
|
17
16
|
<div class="lista-actividad">
|
|
18
17
|
@if(actividad.length === 0 && !cargando) {
|
|
19
|
-
|
|
18
|
+
<p class="sin-datos">No hay actividad reciente.</p>
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
@for (item of actividad; track item.Consecutivo) {
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
<div class="actividad-item">
|
|
23
|
+
<div class="item-icono" [ngClass]="{
|
|
25
24
|
'metodo-get': item.Metodo === 'GET',
|
|
26
25
|
'metodo-post': item.Metodo === 'POST',
|
|
27
26
|
'metodo-put': item.Metodo === 'PUT',
|
|
28
27
|
'metodo-delete': item.Metodo === 'DELETE'
|
|
29
28
|
}">
|
|
30
|
-
|
|
31
|
-
</div>
|
|
32
|
-
<div class="item-contenido">
|
|
33
|
-
<div class="item-titulo">
|
|
34
|
-
{{ item.URL }}
|
|
35
|
-
@if(esSesionActual(item.Token)){
|
|
36
|
-
<span class="badge-sesion-actual">Sesión actual</span>
|
|
37
|
-
}
|
|
29
|
+
<mat-icon [matTooltip]="item.Metodo">{{ getIcon(item.Metodo) }}</mat-icon>
|
|
38
30
|
</div>
|
|
39
|
-
<div class="item-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
|
|
31
|
+
<div class="item-contenido">
|
|
32
|
+
<div class="item-titulo">
|
|
33
|
+
{{ item.URL }}
|
|
34
|
+
@if(esSesionActual(item.Token)){
|
|
35
|
+
<span class="badge-sesion-actual">Sesión actual</span>
|
|
36
|
+
}
|
|
37
|
+
</div>
|
|
38
|
+
<div class="item-detalles">
|
|
39
|
+
<span class="detalle-dispositivo">
|
|
40
|
+
<mat-icon>{{ item.Dispositivo === 'Móvil' ? 'smartphone' : (item.Dispositivo === 'Tablet' ? 'tablet' : 'laptop') }}</mat-icon>
|
|
41
|
+
{{ item.Dispositivo }}
|
|
42
|
+
</span>
|
|
43
|
+
<span class="detalle-browser"><mat-icon>public</mat-icon> {{ item.Navegador }}</span>
|
|
44
|
+
<span class="detalle-ip"><mat-icon>lan</mat-icon> {{ item.IP }}</span>
|
|
45
|
+
<span class="detalle-pais"><mat-icon>location_on</mat-icon> {{ item.Pais }}</span>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="item-fecha">
|
|
49
|
+
<span>{{ item.Fecha | date: 'dd/MM/yyyy' }}</span>
|
|
50
|
+
<strong>{{ item.Fecha | date: 'HH:mm:ss' }}</strong>
|
|
51
|
+
<button mat-icon-button color="warn" matTooltip="Cerrar esta sesión" (click)="cerrarSesion(item.Token)">
|
|
52
|
+
<mat-icon>logout</mat-icon>
|
|
53
|
+
</button>
|
|
48
54
|
</div>
|
|
49
55
|
</div>
|
|
50
|
-
<div class="item-fecha">
|
|
51
|
-
<span>{{ item.Fecha | date: 'dd/MM/yyyy' }}</span>
|
|
52
|
-
<strong>{{ item.Fecha | date: 'HH:mm:ss' }}</strong>
|
|
53
|
-
<button mat-icon-button color="warn" matTooltip="Cerrar esta sesión" (click)="cerrarSesion(item.Token)">
|
|
54
|
-
<mat-icon>logout</mat-icon>
|
|
55
|
-
</button>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
56
|
}
|
|
59
57
|
</div>
|
|
60
|
-
</div>
|
|
58
|
+
</div>
|
|
@@ -5,6 +5,8 @@ import { MatIconModule } from '@angular/material/icon';
|
|
|
5
5
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
6
6
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
7
7
|
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
+
import { MatDialog } from '@angular/material/dialog';
|
|
9
|
+
import { MensajeConfirmacionComponent } from '../mensaje-confirmacion/mensaje-confirmacion';
|
|
8
10
|
import { DatosGlobalesService } from '../../../datos-globales.service';
|
|
9
11
|
|
|
10
12
|
@Component({
|
|
@@ -19,7 +21,7 @@ export class GestionActividadComponent implements OnInit {
|
|
|
19
21
|
public cargando = false;
|
|
20
22
|
private tokenActual = '';
|
|
21
23
|
|
|
22
|
-
constructor(private http: HttpClient, private datosGlobalesService: DatosGlobalesService) { }
|
|
24
|
+
constructor(private http: HttpClient, private datosGlobalesService: DatosGlobalesService, private dialog: MatDialog) { }
|
|
23
25
|
|
|
24
26
|
ngOnInit(): void {
|
|
25
27
|
this.tokenActual = this.datosGlobalesService.ObtenerToken().split(' ')[1] || '';
|
|
@@ -43,23 +45,32 @@ export class GestionActividadComponent implements OnInit {
|
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
cerrarSesion(token: string): void {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
this.dialog.open(MensajeConfirmacionComponent, {
|
|
49
|
+
data: {
|
|
50
|
+
titulo: 'Confirmación',
|
|
51
|
+
mensaje: '¿Está seguro de que desea cerrar esta sesión?',
|
|
52
|
+
textoCerrar: 'Cancelar',
|
|
53
|
+
textoAceptar: 'Cerrar sesión',
|
|
54
|
+
onClose: () => { },
|
|
55
|
+
onAccept: () => {
|
|
56
|
+
this.http.delete(`${this.datosGlobalesService.ObtenerURL()}misc/cerrarSesionPorToken/${token}`).subscribe({
|
|
57
|
+
next: () => {
|
|
58
|
+
if (token === this.tokenActual) {
|
|
59
|
+
this.datosGlobalesService.RedirigirALogin();
|
|
60
|
+
} else {
|
|
61
|
+
this.obtenerActividad();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
error: (error) => {
|
|
65
|
+
console.error('Error al cerrar sesión:', error);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
54
68
|
},
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
69
|
+
},
|
|
70
|
+
});
|
|
60
71
|
}
|
|
61
|
-
|
|
62
72
|
esSesionActual(token: string): boolean {
|
|
73
|
+
|
|
63
74
|
return token === this.tokenActual;
|
|
64
75
|
}
|
|
65
76
|
|