diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d3566e..d8d2f70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,15 @@ # Changelog ## [0.8.2] - 2025-03-04 ### 🔹 Added -- Nueva funcionalidad para tener notificaciones en tiempo real. Instalación de bundle "Mercure". +- Nueva funcionalidad para tener notificaciones en tiempo real. Instalación de bundle "Mercure". +- Creacion de EventListener en Symfony, para publicar mensajes en Mercure, cuando se realicen cambios en la base de datos ( cambio de estado en lo equipos, y trazas). - Nuevo endpoint "backup image". Integracion con ogRepository. +- Nuevo campo en "usuarios" el cual permite escoger la visualizacion por defecto de la vista "grupos". +- Nuevo campo "dns" en "subredes" para gestionar los servidores DNS. ### ⚡ Changed - Cambios en logs. Cambios en salida (stderror -> file.log) +- Modulo DHCP. Añadir equipos, ahora se gestiona con una unica llamada a la API. --- ## [0.8.1] - 2025-02-25 @@ -23,7 +27,6 @@ - Limpieza en campos "name" y "date" de ogLive. Es necesario parsear el campo "filename" para facilitar el uso al usuario en la web. ### 🐛 Fixed - Corrección de bug que impedia borrar un cliente si tenia una traza enlazada. -- --- diff --git a/migrations/Version20250227154452.php b/migrations/Version20250227154452.php new file mode 100644 index 0000000..2b6d346 --- /dev/null +++ b/migrations/Version20250227154452.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE subnet ADD dns VARCHAR(255) DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE subnet DROP dns'); + } +} diff --git a/src/Controller/OgDhcp/Subnet/PostAction.php b/src/Controller/OgDhcp/Subnet/PostAction.php index 7a87fc6..9cfc41d 100644 --- a/src/Controller/OgDhcp/Subnet/PostAction.php +++ b/src/Controller/OgDhcp/Subnet/PostAction.php @@ -33,6 +33,7 @@ class PostAction extends AbstractOgDhcpController 'nextServer' => $data->getNextServer(), 'bootFileName' => $data->getBootFileName(), 'router' => $data->getRouter(), + 'DNS' => $data->getDns() ] ]; diff --git a/src/Controller/OgDhcp/Subnet/SyncAction.php b/src/Controller/OgDhcp/Subnet/SyncAction.php index 8b2c945..a409eff 100644 --- a/src/Controller/OgDhcp/Subnet/SyncAction.php +++ b/src/Controller/OgDhcp/Subnet/SyncAction.php @@ -63,7 +63,7 @@ class SyncAction extends AbstractOgDhcpController { $getParsedData = $this->getIpAddressAndNetmaskFromCIDRService->__invoke($subnet['subnet']); - $subnetEntity->setName($subnet['id'].' - '.$subnet['subnet']); + $subnetEntity->setName('Subred -'.$subnet['id']); $subnetEntity->setBootFileName($subnet['boot-file-name'] ?? null); $subnetEntity->setIpAddress($getParsedData['ip']); $subnetEntity->setNetmask($getParsedData['mask']); diff --git a/src/Dto/Input/SubnetInput.php b/src/Dto/Input/SubnetInput.php index efbcf6a..494d87e 100644 --- a/src/Dto/Input/SubnetInput.php +++ b/src/Dto/Input/SubnetInput.php @@ -36,6 +36,10 @@ final class SubnetInput #[ApiProperty(description: 'The router of the subnet', example: "")] public ?string $router = null; + #[Groups(['subnet:write'])] + #[ApiProperty(description: 'The dns server of the subnet', example: "")] + public ?string $dns = null; + #[Groups(['subnet:write'])] #[ApiProperty(description: 'The boot file name of the subnet', example: "")] public ?string $bootFileName = null; @@ -58,6 +62,7 @@ final class SubnetInput $this->ipAddress = $subnet->getIpAddress(); $this->router = $subnet->getRouter(); $this->nextServer = $subnet->getNextServer(); + $this->dns = $subnet->getDns(); $this->bootFileName = $subnet->getBootFileName(); if ($subnet->getOrganizationalUnits()) { @@ -76,6 +81,7 @@ final class SubnetInput $subnet->setName($this->name); $subnet->setNetmask($this->netmask); $subnet->setIpAddress($this->ipAddress); + $subnet->setDns($this->dns); $subnet->setNextServer($this->nextServer); $subnet->setBootFileName($this->bootFileName); $subnet->setRouter($this->router); diff --git a/src/Dto/Output/SubnetOutput.php b/src/Dto/Output/SubnetOutput.php index 7e84c0b..0a9b540 100644 --- a/src/Dto/Output/SubnetOutput.php +++ b/src/Dto/Output/SubnetOutput.php @@ -30,6 +30,9 @@ final class SubnetOutput extends AbstractOutput #[Groups(['subnet:read'])] public ?string $router = null; + #[Groups(['subnet:read'])] + public ?string $dns = null; + #[Groups(['subnet:read'])] public array $clients; @@ -54,6 +57,7 @@ final class SubnetOutput extends AbstractOutput $this->ipAddress = $subnet->getIpAddress(); $this->nextServer = $subnet->getNextServer(); $this->router = $subnet->getRouter(); + $this->dns = $subnet->getDns(); $this->bootFileName = $subnet->getBootFileName(); $this->synchronized = $subnet->isSynchronized(); $this->serverId = $subnet->getServerId(); diff --git a/src/Entity/Subnet.php b/src/Entity/Subnet.php index 08ef819..0ce6a1e 100644 --- a/src/Entity/Subnet.php +++ b/src/Entity/Subnet.php @@ -43,6 +43,9 @@ class Subnet extends AbstractEntity #[ORM\Column(length: 255, nullable: true)] private ?string $router = null; + #[ORM\Column(length: 255, nullable: true)] + private ?string $dns = null; + public function __construct() { parent::__construct(); @@ -202,4 +205,16 @@ class Subnet extends AbstractEntity return $this; } + + public function getDns(): ?string + { + return $this->dns; + } + + public function setDns(?string $dns): static + { + $this->dns = $dns; + + return $this; + } }