diff --git a/CHANGELOG.md b/CHANGELOG.md index 43c34cb07..4f9c838c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines. * New API endpoints for individual users to control their servers with at `/api/me/*`. * Typeahead support for owner email when adding a new server. * Scheduled command to clear out task log every month (configurable timespan). +* Support for allocating a FQDN as an allocation (panel will convert to IP and assign the FQDN as the alias automatically). ### Changed * Creating a user, server, or node now returns `HTTP/1.1 200` and a JSON element with the user/server/node's ID. @@ -23,6 +24,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines. ### Fixed * Server overview listing the location short-code as the name of the node. * Server task manager only sending commands every 5 minutes at the quickest. +* Fixes additional port allocation from removing the wrong row when clicking 'x'. ## v0.5.0-pre.2 (Bodacious Boreopterus) diff --git a/app/Repositories/NodeRepository.php b/app/Repositories/NodeRepository.php index 104ba51f6..a23cc7455 100644 --- a/app/Repositories/NodeRepository.php +++ b/app/Repositories/NodeRepository.php @@ -164,7 +164,17 @@ class NodeRepository { try { foreach($allocations as $rawIP => $ports) { - $parsedIP = Network::parse($rawIP); + try { + $setAlias = null; + $parsedIP = Network::parse($rawIP); + } catch (\Exception $ex) { + try { + $setAlias = $rawIP; + $parsedIP = Network::parse(gethostbyname($rawIP)); + } catch (\Exception $ex) { + throw $ex; + } + } foreach($parsedIP as $ip) { foreach($ports as $port) { if (!is_int($port) && !preg_match('/^(\d{1,5})-(\d{1,5})$/', $port)) { @@ -182,6 +192,7 @@ class NodeRepository { 'node' => $node->id, 'ip' => $ip, 'port' => $assignPort, + 'ip_alias' => $setAlias, 'assigned_to' => null ]); $alloc->save(); @@ -198,6 +209,7 @@ class NodeRepository { 'node' => $node->id, 'ip' => $ip, 'port' => $port, + 'ip_alias' => $setAlias, 'assigned_to' => null ]); $alloc->save(); @@ -208,7 +220,7 @@ class NodeRepository { } DB::commit(); - return true; + // return true; } catch (\Exception $ex) { DB::rollBack(); throw $ex; diff --git a/resources/views/admin/nodes/view.blade.php b/resources/views/admin/nodes/view.blade.php index d86175bf6..8399f5303 100644 --- a/resources/views/admin/nodes/view.blade.php +++ b/resources/views/admin/nodes/view.blade.php @@ -312,7 +312,7 @@