From 833a586c96d45ec9609eab693df1d0f2729b2deb Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Tue, 22 Oct 2024 07:28:58 +0200 Subject: [PATCH] refs #691. Important improvements ogDhcp. Demo --- .../og-dhcp-subnets.component.css | 45 ------------------- .../og-dhcp-subnets.component.html | 4 +- .../og-dhcp-subnets.component.ts | 34 +++++++------- 3 files changed, 20 insertions(+), 63 deletions(-) diff --git a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css index e71097c..27f82b3 100644 --- a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css +++ b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css @@ -10,17 +10,6 @@ font-size: 24px; } -.images-button-row { - display: flex; - justify-content: flex-start; - margin-top: 16px; -} - -button { - margin-left: 10px; - margin-bottom: 20px; -} - .divider { margin: 20px 0; } @@ -29,22 +18,6 @@ button { padding: 16px; } -.imagesLists-container { - flex: 1; -} - -.card.unidad-card { - height: 100%; - box-sizing: border-box; -} - -.image-container { - display: flex; - align-items: center; - margin-bottom: 16px; - border-bottom: 1px solid rgba(122, 122, 122, 0.555); -} - .search-container { display: flex; justify-content: space-between; @@ -59,24 +32,6 @@ button { padding: 5px; } -.image-container h4 { - margin: 0; - flex: 1; -} - -.mat-icon-button { - margin-left: 16px; - align-self: center; -} - -.mat-menu { - min-width: 160px; -} - - .image-name{ - cursor: pointer; - } - table { width: 100%; margin-top: 50px; diff --git a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html index 5b85999..6d658c3 100644 --- a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html +++ b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html @@ -83,8 +83,8 @@ menu - - + + diff --git a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts index e6a2bcf..b98cd7a 100644 --- a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts +++ b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts @@ -8,6 +8,7 @@ import { DeleteModalComponent } from '../../../shared/delete_modal/delete-modal/ import { ToastrService } from 'ngx-toastr'; import { AddClientsToSubnetComponent } from './add-clients-to-subnet/add-clients-to-subnet.component'; import {ServerInfoDialogComponent} from "./server-info-dialog/server-info-dialog.component"; +import {Observable} from "rxjs"; export interface Subnet { '@id': string; @@ -52,7 +53,7 @@ export class OgDhcpSubnetsComponent { { columnDef: 'nextServer', header: 'Next Server', cell: (subnet: Subnet) => subnet.nextServer }, { columnDef: 'bootFileName', header: 'Boot File Name', cell: (subnet: Subnet) => subnet.bootFileName }, { columnDef: 'synchronized', header: 'Sincronizado', cell: (subnet: Subnet) => `${subnet.synchronized}`}, - { columnDef: 'serverId', header: 'IP Servidor DHCP', cell: (subnet: Subnet) => subnet.serverId }, + { columnDef: 'serverId', header: 'Id Servidor DHCP', cell: (subnet: Subnet) => subnet.serverId }, { columnDef: 'clients', header: 'Lista de clientes', cell: (subnet: Subnet) => `${subnet.clients}`}, ]; @@ -177,25 +178,26 @@ export class OgDhcpSubnetsComponent { }); } - loadAlert() { - this.http.get(`${this.baseUrl}/og-dhcp/server/get-collection`) - .subscribe(response => { - // @ts-ignore - this.alertMessage = response.message - }, error => { - console.error('Error al cargar la información del alert', error); - }); + loadAlert(): Observable { + return this.http.get(`${this.baseUrl}/og-dhcp/server/get-collection`); } openSubnetInfoDialog() { - this.loadAlert() - this.dialog.open(ServerInfoDialogComponent, { - width: '600px', - data: { - alertMessage: this.alertMessage, - length: this.length + this.loadAlert().subscribe( + response => { + this.alertMessage = response.message; + + this.dialog.open(ServerInfoDialogComponent, { + width: '600px', + data: { + message: this.alertMessage + } + }); + }, + error => { + console.error('Error al cargar la información del alert', error); } - }); + ); } addClientsToSubnet(subnet: Subnet) {