diff --git a/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.css b/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.css index 1b1578d..615bfdf 100644 --- a/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.css +++ b/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.css @@ -1,58 +1,101 @@ .create-command-group-container { - padding: 20px; - } - - .command-group-form { - display: flex; - flex-direction: column; - } + padding: 20px; + max-width: 800px; /* Ancho máximo del contenedor */ + margin: auto; /* Centra el contenedor en la pantalla */ + background-color: #fff; /* Fondo blanco para el contenedor */ + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra suave */ +} + +.command-group-form { + display: flex; + flex-direction: column; +} + +.command-selection { + display: flex; + justify-content: space-between; + margin: 20px 0; +} + +.available-commands, .selected-commands { + width: 48%; + display: flex; + flex-direction: column; + max-height: 200px; /* Limita la altura máxima para evitar desbordamiento */ +} + +.table-wrapper { + flex: 1; + overflow-y: auto; /* Scroll para la tabla si hay demasiados comandos */ + border: 1px solid #ccc; /* Borde para la tabla */ + border-radius: 4px; /* Bordes redondeados */ +} + +.selected-commands-list { + border: 1px solid #ccc; + border-radius: 4px; + padding: 10px; + background-color: #f9f9f9; + flex: 1; + overflow-y: auto; /* Scroll para los comandos seleccionados */ +} + +.commands-container { + display: flex; + flex-direction: column; +} + +.command-item { + display: flex; + align-items: center; + justify-content: space-between; + padding: 8px; + background-color: #fff; + border-radius: 4px; + margin-bottom: 8px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +.remove-icon { + cursor: pointer; + color: #f44336; /* Rojo para eliminar */ +} + +.chevron-icon { + margin: 0 10px; + color: #666; +} + +.command-group-actions { + margin-top: 20px; + display: flex; + justify-content: space-between; +} + + +.available-commands, .selected-commands { + width: 48%; + display: flex; + flex-direction: column; + max-height: 400px; /* Limita la altura máxima para evitar desbordamiento */ +} + +.table-wrapper { + flex: 1; + overflow-y: auto; /* Scroll para la tabla si hay demasiados comandos */ + border: 1px solid #ccc; /* Borde para la tabla */ + border-radius: 4px; /* Bordes redondeados */ + max-height: 400px; /* Establece la altura máxima */ +} + +/* Para asegurar que el componente sea responsivo en pantallas pequeñas */ +@media (max-width: 600px) { .command-selection { - display: flex; - justify-content: space-between; - margin: 20px 0; + flex-direction: column; /* Cambia a columna en pantallas pequeñas */ } - .available-commands, .selected-commands { - width: 48%; + width: 100%; /* Ocupa el ancho completo */ + margin-bottom: 20px; /* Espacio entre elementos */ } - - .selected-commands-list { - border: 1px solid #ccc; - border-radius: 4px; - padding: 10px; - background-color: #f9f9f9; - } - - .commands-container { - display: flex; - flex-direction: column; - } - - .command-item { - display: flex; - align-items: center; - justify-content: space-between; - padding: 8px; - background-color: #fff; - border-radius: 4px; - margin-bottom: 8px; - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); - } - - .remove-icon { - cursor: pointer; - color: #f44336; /* Rojo para eliminar */ - } - - .chevron-icon { - margin: 0 10px; - color: #666; - } - - .command-group-actions { - margin-top: 20px; - display: flex; - justify-content: space-between; - } - \ No newline at end of file +} diff --git a/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html b/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html index bdd7c17..b671896 100644 --- a/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html +++ b/ogWebconsole/src/app/components/commands/commands-groups/create-command-group/create-command-group.component.html @@ -12,24 +12,26 @@

Comandos Disponibles

- - - - - - - - - - - - - -
Nombre {{ command.name }} Acciones - -
+
+ + + + + + + + + + + + + +
Nombre {{ command.name }} Acciones + +
+
@@ -51,8 +53,8 @@
- +
diff --git a/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.html b/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.html index 7c0cdcc..92c2ff2 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.html +++ b/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.html @@ -15,6 +15,11 @@ + + + + + diff --git a/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.ts b/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.ts index 5908fc5..42c890e 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.ts +++ b/ogWebconsole/src/app/components/commands/commands-task/commands-task.component.ts @@ -19,7 +19,7 @@ export class CommandsTaskComponent implements OnInit { itemsPerPage: number = 10; page: number = 1; pageSizeOptions: number[] = [5, 10, 20, 40, 100]; - displayedColumns: string[] = ['notes','name', 'scheduledDate', 'enabled', 'actions']; + displayedColumns: string[] = ['taskid','notes','name', 'scheduledDate', 'enabled', 'actions']; private apiUrl = `${this.baseUrl}/command-tasks`; constructor(private http: HttpClient, private dialog: MatDialog, private toastService: ToastrService) {} @@ -38,7 +38,6 @@ export class CommandsTaskComponent implements OnInit { (data) => { this.tasks = data['hydra:member']; this.length = data['hydra:totalItems']; - console.log('Tasks:', this.tasks); }, (error) => { console.error('Error fetching tasks', error); @@ -49,7 +48,7 @@ export class CommandsTaskComponent implements OnInit { viewTaskDetails(task: any): void { this.dialog.open(DetailTaskComponent, { width: '800px', - data: task, + data: {task}, }).afterClosed().subscribe(() => this.loadTasks()); } diff --git a/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.css b/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.css index 2d6006f..d5dad12 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.css +++ b/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.css @@ -1,86 +1,21 @@ +.dialog-title { + font-weight: bold; +} + +.task-form { + padding: 20px; +} + .full-width { - width: 100%; - } - - .commands-list { - margin-top: 10px; - margin-bottom: 10px; - padding: 10px; - border: 1px solid #ccc; - background-color: #f9f9f9; - border-radius: 4px; - } - - .command-item { - padding: 10px; - background-color: #f4f4f4; - margin-bottom: 10px; - border: 1px solid #ddd; - border-radius: 4px; - } - - .command-item:hover { - background-color: #e9e9e9; - } - - /* Estilos generales para el dialogo */ -.mat-dialog-content { - padding: 20px; - max-width: 600px; /* Ancho máximo del dialogo */ + width: 100%; } -/* Estilos para el stepper */ -.mat-horizontal-stepper { - margin: 20px 0; +.button-container { + display: flex; + justify-content: space-between; + margin-top: 20px; } -/* Estilos para cada paso */ -.mat-step { - padding: 20px; - border-radius: 8px; - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); - background-color: #ffffff; /* Fondo blanco para los pasos */ -} - -/* Estilos para el encabezado de los pasos */ -.mat-step-header { - background-color: #f5f5f5; /* Fondo gris claro para el encabezado */ - padding: 10px; - border-radius: 4px; - font-weight: 600; /* Negrita para el texto del encabezado */ -} - -/* Estilos para los botones */ -button.mat-button { - margin-right: 10px; -} - -/* Estilos para los campos de formulario */ -.mat-form-field { - margin-bottom: 20px; /* Espaciado entre campos */ -} - -/* Estilos para errores */ -.mat-error { - font-size: 0.875em; /* Tamaño de fuente más pequeño para mensajes de error */ - color: #d32f2f; /* Color rojo para errores */ -} - -/* Estilos para listas de comandos */ -.commands-list { - margin: 20px 0; - border: 1px solid #e0e0e0; /* Borde gris claro */ - border-radius: 4px; - padding: 10px; - background-color: #fafafa; /* Fondo gris muy claro */ -} - -/* Estilos para elementos de comando */ -.command-item { - padding: 5px 0; - border-bottom: 1px solid #e0e0e0; /* Separación entre comandos */ -} - -.command-item:last-child { - border-bottom: none; /* Quitar borde del último elemento */ +mat-form-field { + margin-bottom: 16px; /* Espaciado entre campos */ } diff --git a/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.html b/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.html index 2111b27..fc2838a 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.html +++ b/ogWebconsole/src/app/components/commands/commands-task/create-task/create-task.component.html @@ -1,17 +1,16 @@ -

{{ editing ? 'Editar Tarea' : 'Crear Tarea' }}

+

{{ editing ? 'Editar Tarea' : 'Crear Tarea' }}

- + - + Información - + - Selecciona Comandos @@ -21,8 +20,8 @@ Este campo es obligatorio -
- +
+
@@ -37,9 +36,9 @@ -
+
- +
@@ -59,9 +58,9 @@ Este campo es obligatorio -
+
- +
@@ -95,9 +94,9 @@ -
+
- +
diff --git a/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.css b/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.css index e69de29..dce95aa 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.css +++ b/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.css @@ -0,0 +1,82 @@ +.detail-task-container { + padding: 20px; + } + + .mat-card { + margin: 20px 0; + border-radius: 4px; + border: 1px solid #ccc; + } + + .mat-card-header { + background-color: #f5f5f5; + border-bottom: 1px solid #ddd; + } + + .mat-card-title { + font-size: 20px; + font-weight: bold; + } + + .mat-card-subtitle { + font-size: 14px; + color: #666; + } + + .mat-card-content { + padding: 20px; + } + + h3 { + margin-top: 20px; + font-size: 18px; + } + + table { + width: 100%; + margin-top: 10px; + } + + th.mat-header-cell { + background-color: #f5f5f5; + font-weight: bold; + border-bottom: 2px solid #ccc; + } + + td.mat-cell { + padding: 10px; + border-bottom: 1px solid #ddd; + } + + tr:hover { + background-color: rgba(219, 219, 219, 0.5); + } + + .task-actions { + display: flex; + justify-content: flex-end; + padding: 10px 20px; + } + + button { + background-color: #3f51b5; + color: white; + padding: 10px 15px; + border: none; + border-radius: 4px; + cursor: pointer; + } + + button:hover { + background-color: #2c387e; + } + + .cancel-button { + background-color: #dc3545; + color: white; + } + + .cancel-button:hover { + opacity: 0.9; + } + \ No newline at end of file diff --git a/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.html b/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.html index 015f118..4c87195 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.html +++ b/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.html @@ -1 +1,56 @@ -

detail-task works!

+
+

Detalles de la Tarea

+ + + + Creado por: {{ task.createdBy }} + + + +

ID de la Tarea: {{ task.uuid }}

+

Estado: {{ task.status }}

+

Fecha de Creación: {{ task.createdAt | date: 'short' }}

+

Notas: {{ task.notes }}

+ +

Grupos de Comandos Incluidos:

+
Id {{ task.id }} Info {{ task.notes }}
+ + + + + + + + + + + + +
Grupo de Comandos {{ group.name }} UUID {{ group.uuid }}
+ +

Comandos a ejecutar:

+
+

Grupo: {{ group.name }}

+ + + + + + + + + + + + + +
Comando {{ command.name }} UUID {{ command.uuid }}
+
+ + + +
+ +
+ + \ No newline at end of file diff --git a/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.ts b/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.ts index ca6401d..33e5f95 100644 --- a/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.ts +++ b/ogWebconsole/src/app/components/commands/commands-task/detail-task/detail-task.component.ts @@ -1,10 +1,24 @@ -import { Component } from '@angular/core'; +import { Component, Inject } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @Component({ selector: 'app-detail-task', templateUrl: './detail-task.component.html', - styleUrl: './detail-task.component.css' + styleUrls: ['./detail-task.component.css'] }) export class DetailTaskComponent { + task: any; + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + this.task = data.task; // Asignamos la tarea que viene en el modal + console.log('tasaas',this.task); + } + + // Método opcional para cerrar el modal + closeDialog(): void { + this.dialogRef.close(); + } }