utn-cli 2.0.61 → 2.0.63

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": "utn-cli",
3
- "version": "2.0.61",
3
+ "version": "2.0.63",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -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, 0, 0, 0.05);
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, 0, 0, 0.05);
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
- color: #0069B4;
115
- background-color: #e3f2fd;
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
- color: #673ab7;
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
- <mat-progress-bar mode="indeterminate"></mat-progress-bar>
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
- <p class="sin-datos">No hay actividad reciente.</p>
18
+ <p class="sin-datos">No hay actividad reciente.</p>
20
19
  }
21
20
 
22
21
  @for (item of actividad; track item.Consecutivo) {
23
- <div class="actividad-item">
24
- <div class="item-icono" [ngClass]="{
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
- <mat-icon [matTooltip]="item.Metodo">{{ getIcon(item.Metodo) }}</mat-icon>
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-detalles">
40
- <span class="detalle-dispositivo">
41
- <mat-icon>{{ item.Dispositivo === 'Móvil' ? 'smartphone' : (item.Dispositivo === 'Tablet' ? 'tablet' :
42
- 'laptop') }}</mat-icon>
43
- {{ item.Dispositivo }}
44
- </span>
45
- <span class="detalle-browser"><mat-icon>public</mat-icon> {{ item.Navegador }}</span>
46
- <span class="detalle-ip"><mat-icon>lan</mat-icon> {{ item.IP }}</span>
47
- <span class="detalle-pais"><mat-icon>location_on</mat-icon> {{ item.Pais }}</span>
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
- if (confirm('¿Está seguro de que desea cerrar esta sesión?')) {
47
- this.http.delete(`${this.datosGlobalesService.ObtenerURL()}misc/cerrarSesionPorToken/${token}`).subscribe({
48
- next: () => {
49
- if (token === this.tokenActual) {
50
- this.datosGlobalesService.RedirigirALogin();
51
- } else {
52
- this.obtenerActividad();
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
- error: (error) => {
56
- console.error('Error al cerrar sesión:', error);
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
 
@@ -71,7 +71,6 @@ export class GestionTablaXYZComponent {
71
71
  public subAccionesDinamicas = [];
72
72
  constructor(private http: HttpClient, private dialog: MatDialog, private datosGlobalesService: DatosGlobalesService) {
73
73
  this.obtenerDatosParaPoblarLaTabla();
74
- this.obtenerTiposLicencias();
75
74
  }
76
75
 
77
76
  // PuntosPorColegioEnCantonConMIDH(fila: any): void {
@@ -122,30 +121,6 @@ export class GestionTablaXYZComponent {
122
121
  });
123
122
  }
124
123
 
125
- confirmacionFirmaDelUsuario(fila: any): void {
126
- this.dialog.open(MensajeConfirmacionComponent, {
127
- data: {
128
- titulo: 'Confirmación',
129
- mensaje: `¿Realmente desea hacer la confirmación de este registro?`,
130
- textoCerrar: 'Cancelar',
131
- textoAceptar: 'Firmar',
132
- onClose: () => { },
133
- onAccept: () => { this.firmaFuncionario(fila.LicenciaId) },
134
- },
135
- });
136
- }
137
- firmaFuncionario(LicenciaId: any): void {
138
- this.http
139
- .post(`${this.datosGlobalesService.ObtenerURL()}XYZ/firmaFuncionario`, { LicenciaId })
140
- .subscribe({
141
- next: (datos: any) => {
142
- this.obtenerDatosParaPoblarLaTabla();
143
- },
144
- error: (error) => {
145
- this.obtenerDatosParaPoblarLaTabla();
146
- },
147
- });
148
- }
149
124
  confirmacionEliminar(fila: any): void {
150
125
  this.dialog.open(MensajeConfirmacionComponent, {
151
126
  data: {
@@ -158,9 +133,10 @@ export class GestionTablaXYZComponent {
158
133
  },
159
134
  });
160
135
  }
161
- eliminar(LicenciaId: any): void {
136
+
137
+ eliminar(fila: any): void {
162
138
  this.http
163
- .post(`${this.datosGlobalesService.ObtenerURL()}XYZ/borrar`, { LicenciaId })
139
+ .post(`${this.datosGlobalesService.ObtenerURL()}XYZ/borrar`, { LicenciaId: fila.LicenciaId })
164
140
  .subscribe({
165
141
  next: (datos: any) => {
166
142
  this.obtenerDatosParaPoblarLaTabla();
@@ -215,23 +191,9 @@ export class GestionTablaXYZComponent {
215
191
  },
216
192
  });
217
193
  }
218
- obtenerTiposLicencias() {
219
- this.http.get(`${this.datosGlobalesService.ObtenerURL()}XYZ/tipos`).subscribe({
220
- next: (datos: any) => {
221
- if (datos.error) {
222
- console.error('Problemas al intentar obtener los registros:', datos.error);
223
- return;
224
- }
225
- this.tiposDeLicencias = datos.body || [];
226
194
 
227
- },
228
- error: (error) => {
229
- console.error('Problemas al intentar obtener los registros: ', error);
230
- },
231
- });
232
- }
233
- Agregar(incapacidad: any) {
234
- this.http.post(`${this.datosGlobalesService.ObtenerURL()}XYZ/agregar`, incapacidad).subscribe({
195
+ Agregar(fila: any) {
196
+ this.http.post(`${this.datosGlobalesService.ObtenerURL()}XYZ/agregar`, fila).subscribe({
235
197
  next: (datos: any) => {
236
198
  if (datos.error) {
237
199
  console.log('Problemas al intentar obtener los registros:', datos.error);
@@ -244,8 +206,9 @@ export class GestionTablaXYZComponent {
244
206
  },
245
207
  });
246
208
  }
247
- Actualizar(incapacidad: any) {
248
- this.http.post(`${this.datosGlobalesService.ObtenerURL()}XYZ/actualizar`, incapacidad).subscribe({
209
+
210
+ Actualizar(fila: any) {
211
+ this.http.post(`${this.datosGlobalesService.ObtenerURL()}XYZ/actualizar`, fila).subscribe({
249
212
  next: (datos: any) => {
250
213
  if (datos.error) {
251
214
  console.log('Problemas al intentar obtener los registros:', datos.error);
@@ -258,6 +221,7 @@ export class GestionTablaXYZComponent {
258
221
  },
259
222
  });
260
223
  }
224
+
261
225
  DescargarReporte() {
262
226
  this.cargando = true;
263
227
  this.http.get(`${this.datosGlobalesService.ObtenerURL()}XYZ/reporte`, {
@@ -278,13 +242,14 @@ export class GestionTablaXYZComponent {
278
242
  }
279
243
  });
280
244
  }
281
- AbrirModal(incapacidad?: any): void {
245
+
246
+ AbrirModal(fila?: any): void {
282
247
  const dialogRef = this.dialog.open(GuardarIncapacidadComponent, {
283
- data: { Incapacidad: incapacidad, TiposDeLicencias: this.tiposDeLicencias },
248
+ data: { Incapacidad: fila, TiposDeLicencias: this.tiposDeLicencias },
284
249
  });
285
250
  dialogRef.afterClosed().subscribe(result => {
286
251
  if (result !== undefined) {
287
- if (incapacidad) {
252
+ if (fila) {
288
253
  this.Actualizar(result);
289
254
  }
290
255
  else {
@@ -293,11 +258,12 @@ export class GestionTablaXYZComponent {
293
258
  }
294
259
  });
295
260
  }
296
- async AbrirModalArchivo(incapacidad?: any): Promise<void> {
261
+
262
+ async AbrirModalArchivo(fila?: any): Promise<void> {
297
263
  const dialogRef = this.dialog.open(SubirArchivoComponent, {
298
264
  data: {
299
- Etiqueta: incapacidad.LicenciaId
300
- , EsEditable: incapacidad.Estado == 'Pendiente'
265
+ Etiqueta: fila.LicenciaId
266
+ , EsEditable: fila.Estado == 'Pendiente'
301
267
  , Permiso: 'Usuario'
302
268
  },
303
269
  });