refs #1516. Changed form and global import
parent
12f7bad764
commit
8d6e4615c7
|
@ -115,7 +115,7 @@ export class CreateClientImageComponent {
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
this.toastService.success('Petición de creación de imagen enviada');
|
this.toastService.success('Petición de creación de imagen enviada');
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.router.navigate(['/images']);
|
this.router.navigate(['/commands-logs']);
|
||||||
},
|
},
|
||||||
error: (error) => {
|
error: (error) => {
|
||||||
this.toastService.error(error.error['hydra:description']);
|
this.toastService.error(error.error['hydra:description']);
|
||||||
|
|
|
@ -34,6 +34,22 @@ button {
|
||||||
margin-left: 8px; /* Espacio entre los botones */
|
margin-left: 8px; /* Espacio entre los botones */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.warning-card {
|
||||||
|
background-color: #ffebee; /* Rojo claro */
|
||||||
|
color: #d32f2f; /* Rojo oscuro */
|
||||||
|
padding: 16px;
|
||||||
|
border-left: 5px solid #d32f2f;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.warning-card mat-icon {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Responsividad para pantallas pequeñas */
|
/* Responsividad para pantallas pequeñas */
|
||||||
@media (max-width: 600px) {
|
@media (max-width: 600px) {
|
||||||
.form-field {
|
.form-field {
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
<mat-dialog-content class="dialog-content">
|
<mat-dialog-content class="dialog-content">
|
||||||
<form [formGroup]="imageForm" (ngSubmit)="saveImage()" class="image-form">
|
<form [formGroup]="imageForm" (ngSubmit)="saveImage()" class="image-form">
|
||||||
|
<mat-card *ngIf="showWarning" class="warning-card">
|
||||||
|
<mat-card-content>
|
||||||
|
<mat-icon color="warn">warning</mat-icon>
|
||||||
|
Ha marcado la casilla <strong>"Imagen Global"</strong>. Se transferirá la imagen al resto de repositorios en el caso de que no exista previamente.
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
<mat-form-field appearance="fill" class="form-field">
|
<mat-form-field appearance="fill" class="form-field">
|
||||||
<mat-label>{{ 'imageNameLabel' | translate }}</mat-label>
|
<mat-label>{{ 'imageNameLabel' | translate }}</mat-label>
|
||||||
<input matInput formControlName="name" required>
|
<input matInput formControlName="name" required>
|
||||||
|
@ -37,14 +43,13 @@
|
||||||
|
|
||||||
<mat-checkbox
|
<mat-checkbox
|
||||||
formControlName="remotePc"
|
formControlName="remotePc"
|
||||||
class="example-margin"
|
|
||||||
>
|
>
|
||||||
{{ 'remotePcLabel' | translate }}
|
{{ 'remotePcLabel' | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
|
|
||||||
<mat-checkbox
|
<mat-checkbox
|
||||||
formControlName="isGlobal"
|
formControlName="isGlobal"
|
||||||
class="example-margin"
|
(click)="changeIsGlobal()"
|
||||||
>
|
>
|
||||||
{{ 'globalImageLabel' | translate }}
|
{{ 'globalImageLabel' | translate }}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import {Component, Inject, OnInit} from '@angular/core';
|
import {Component, Inject, OnInit} from '@angular/core';
|
||||||
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
|
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import {HttpClient} from '@angular/common/http';
|
||||||
import { ToastrService } from 'ngx-toastr';
|
import {ToastrService} from 'ngx-toastr';
|
||||||
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
|
import {FormBuilder, FormGroup, Validators} from "@angular/forms";
|
||||||
import {DataService} from "../data.service";
|
import {DataService} from "../data.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-create-image',
|
selector: 'app-create-image',
|
||||||
templateUrl: './create-image.component.html',
|
templateUrl: './create-image.component.html',
|
||||||
|
@ -16,6 +17,7 @@ export class CreateImageComponent implements OnInit {
|
||||||
softwareProfiles: any[] = [];
|
softwareProfiles: any[] = [];
|
||||||
repositories: any[] = [];
|
repositories: any[] = [];
|
||||||
partitionInfo: { [key: string]: string } = {};
|
partitionInfo: { [key: string]: string } = {};
|
||||||
|
showWarning: boolean = false; // Nueva variable para mostrar la advertencia
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private fb: FormBuilder,
|
private fb: FormBuilder,
|
||||||
|
@ -42,6 +44,7 @@ export class CreateImageComponent implements OnInit {
|
||||||
}
|
}
|
||||||
this.fetchSoftwareProfiles();
|
this.fetchSoftwareProfiles();
|
||||||
this.fetchRepositories();
|
this.fetchRepositories();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
load(): void {
|
load(): void {
|
||||||
|
@ -65,6 +68,10 @@ export class CreateImageComponent implements OnInit {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changeIsGlobal() {
|
||||||
|
this.showWarning = this.imageForm.get('isGlobal')?.value;
|
||||||
|
}
|
||||||
|
|
||||||
fetchSoftwareProfiles() {
|
fetchSoftwareProfiles() {
|
||||||
const url = `${this.baseUrl}/software-profiles`;
|
const url = `${this.baseUrl}/software-profiles`;
|
||||||
this.http.get(url).subscribe({
|
this.http.get(url).subscribe({
|
||||||
|
|
|
@ -116,7 +116,7 @@ export class RepositoryImagesComponent implements OnInit {
|
||||||
|
|
||||||
search(): void {
|
search(): void {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.http.get<any>(`${this.apiUrl}?page=${this.page +1 }&itemsPerPage=${this.itemsPerPage}&repositoryId=${this.repositoryId}`, { params: this.filters }).subscribe(
|
this.http.get<any>(`${this.apiUrl}?page=${this.page +1 }&itemsPerPage=${this.itemsPerPage}&repository.id=${this.repositoryId}`, { params: this.filters }).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.dataSource.data = data['hydra:member'];
|
this.dataSource.data = data['hydra:member'];
|
||||||
this.length = data['hydra:totalItems'];
|
this.length = data['hydra:totalItems'];
|
||||||
|
|
Loading…
Reference in New Issue