refs #1090. CreateImage. Add back button

pull/10/head
Manuel Aranda Rosales 2024-12-11 17:03:26 +01:00
parent 5bc5a9d23a
commit a9afb951e2
2 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,5 @@
<div class="header-container">
<button mat-flat-button color="primary" (click)="back()">Volver</button>
<h2 class="title" i18n="@@subnetsTitle">Crear Imagen desde {{ clientName }}</h2>
<div class="subnets-button-row">
<button mat-flat-button color="primary" (click)="save()">Guardar y ejecutar</button>

View File

@ -68,6 +68,7 @@ export class CreateImageComponent {
selectedImage: string | null = null;
selectedPartition: any = null;
name: string = '';
client: any = null;
dataSource = new MatTableDataSource<any>();
columns = [
{
@ -120,6 +121,7 @@ export class CreateImageComponent {
this.http.get(url).subscribe(
(response: any) => {
if (response.partitions) {
this.client = response;
this.clientName = response.name;
this.dataSource.data = response.partitions.filter((partition: any) => {
@ -145,6 +147,10 @@ export class CreateImageComponent {
);
}
back() {
this.router.navigate(['clients', this.clientId], { state: { clientData: this.client} });
}
save(): void {
const payload = {
client: `/clients/${this.clientId}`,