diff --git a/ogWebconsole/src/app/components/images/create-image/create-image.component.html b/ogWebconsole/src/app/components/images/create-image/create-image.component.html index 6f48c33..409bd7f 100644 --- a/ogWebconsole/src/app/components/images/create-image/create-image.component.html +++ b/ogWebconsole/src/app/components/images/create-image/create-image.component.html @@ -42,6 +42,13 @@ {{ 'remotePcLabel' | translate }} + + {{ 'globalImageLabel' | translate }} + +
diff --git a/ogWebconsole/src/app/components/images/create-image/create-image.component.ts b/ogWebconsole/src/app/components/images/create-image/create-image.component.ts index 52fd24b..5043740 100644 --- a/ogWebconsole/src/app/components/images/create-image/create-image.component.ts +++ b/ogWebconsole/src/app/components/images/create-image/create-image.component.ts @@ -30,6 +30,7 @@ export class CreateImageComponent implements OnInit { description: [''], comments: [''], remotePc: [false], + isGlobal: [false], softwareProfile: [''], imageRepository: ['', Validators.required], }); @@ -51,6 +52,7 @@ export class CreateImageComponent implements OnInit { description: [response.description], comments: [response.comments], remotePc: [response.remotePc], + isGlobal: [response.isGlobal], softwareProfile: [response.softwareProfile ? response.softwareProfile['@id'] : null, Validators.required], imageRepository: [response.imageRepository ? response.imageRepository['@id'] : null, Validators.required], }); @@ -95,6 +97,7 @@ export class CreateImageComponent implements OnInit { description: this.imageForm.value.description, comments: this.imageForm.value.comments, remotePc: this.imageForm.value.remotePc, + isGlobal: this.imageForm.value.isGlobal, imageRepository: this.imageForm.value.imageRepository, ...(this.imageForm.value.softwareProfile ? { softwareProfile: this.imageForm.value.softwareProfile } : {}), }; diff --git a/ogWebconsole/src/app/components/images/export-image/export-image.component.ts b/ogWebconsole/src/app/components/images/export-image/export-image.component.ts index ea43de0..9e81e34 100644 --- a/ogWebconsole/src/app/components/images/export-image/export-image.component.ts +++ b/ogWebconsole/src/app/components/images/export-image/export-image.component.ts @@ -2,6 +2,7 @@ import {Component, Inject, OnInit} from '@angular/core'; import {HttpClient} from "@angular/common/http"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {ToastrService} from "ngx-toastr"; +import {Router} from "@angular/router"; @Component({ selector: 'app-export-image', @@ -18,6 +19,7 @@ export class ExportImageComponent implements OnInit { private http: HttpClient, public dialogRef: MatDialogRef, private toastService: ToastrService, + private router: Router, @Inject(MAT_DIALOG_DATA) public data: { image: any } ) { @@ -29,7 +31,7 @@ export class ExportImageComponent implements OnInit { } loadRepositories() { - this.http.get(`${this.baseUrl}/image-repositories?page=1&itemsPerPage=50`).subscribe( + this.http.get(`${this.baseUrl}/image-repositories?id[ne]=1&page=1&itemsPerPage=50`).subscribe( response => { this.repositories = response['hydra:member']; this.loading = false; @@ -45,6 +47,7 @@ export class ExportImageComponent implements OnInit { next: (response) => { this.toastService.success('Imagen exportada correctamente'); this.dialogRef.close(); + this.router.navigate(['/commands-logs']); }, error: error => { console.error('Error al exportar imagen:', error); diff --git a/ogWebconsole/src/app/components/images/images.component.html b/ogWebconsole/src/app/components/images/images.component.html index 9a4aa01..7162256 100644 --- a/ogWebconsole/src/app/components/images/images.component.html +++ b/ogWebconsole/src/app/components/images/images.component.html @@ -35,6 +35,11 @@ {{ image[column.columnDef] ? 'check_circle' : 'cancel' }} + + + {{ image[column.columnDef] ? 'check_circle' : 'cancel' }} + + + {{ column.cell(image) }} diff --git a/ogWebconsole/src/app/components/images/images.component.ts b/ogWebconsole/src/app/components/images/images.component.ts index f74d530..fbe94b9 100644 --- a/ogWebconsole/src/app/components/images/images.component.ts +++ b/ogWebconsole/src/app/components/images/images.component.ts @@ -47,6 +47,11 @@ export class ImagesComponent implements OnInit { header: 'Remote Pc', cell: (image: any) => `${image.remotePc}` }, + { + columnDef: 'isGlobal', + header: 'Imagen Global', + cell: (image: any) => `${image.isGlobal}` + }, { columnDef: 'status', header: 'Estado', diff --git a/ogWebconsole/src/app/components/repositories/import-image/import-image.component.ts b/ogWebconsole/src/app/components/repositories/import-image/import-image.component.ts index 1faa242..8db695a 100644 --- a/ogWebconsole/src/app/components/repositories/import-image/import-image.component.ts +++ b/ogWebconsole/src/app/components/repositories/import-image/import-image.component.ts @@ -2,6 +2,7 @@ import {Component, Inject, OnInit} from '@angular/core'; import {HttpClient} from "@angular/common/http"; import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; import {ToastrService} from "ngx-toastr"; +import {Router} from "@angular/router"; @Component({ selector: 'app-import-image', @@ -18,6 +19,7 @@ export class ImportImageComponent implements OnInit{ private http: HttpClient, public dialogRef: MatDialogRef, private toastService: ToastrService, + private router: Router, @Inject(MAT_DIALOG_DATA) public data: { repository: any } ) { @@ -54,6 +56,7 @@ export class ImportImageComponent implements OnInit{ next: (response) => { this.toastService.success('Peticion de importacion de imagen enviada correctamente'); this.dialogRef.close(); + this.router.navigate(['/commands-logs']); }, error: error => { this.toastService.error('Error al importar imagenes'); diff --git a/ogWebconsole/src/locale/en.json b/ogWebconsole/src/locale/en.json index ca93953..2ee9b67 100644 --- a/ogWebconsole/src/locale/en.json +++ b/ogWebconsole/src/locale/en.json @@ -284,6 +284,7 @@ "usageColumn": "Usage (%)", "formatColumn": "Format", "remotePcLabel": "Remote PC", + "globalImageLabel": "Global image", "ntfsOption": "NTFS", "linuxOption": "LINUX", "cacheOption": "CACHE", diff --git a/ogWebconsole/src/locale/es.json b/ogWebconsole/src/locale/es.json index cc565bc..16355f8 100644 --- a/ogWebconsole/src/locale/es.json +++ b/ogWebconsole/src/locale/es.json @@ -302,6 +302,7 @@ "imagesTitle": "Administrar imágenes", "repositoryTitle": "Administrar repositorios", "remotePcLabel": "Remote PC", + "globalImageLabel": "Imagen Global", "addImageButton": "Añadir imagen", "searchNameDescription": "Busca imágenes por nombre para encontrar rápidamente una imagen específica.", "searchDefaultDescription": "Filtra las imágenes para mostrar solo las imágenes por defecto o no por defecto.",