Change order that allocations are loaded in on the allocation listing

This commit is contained in:
Dane Everitt 2018-01-08 22:21:35 -06:00
parent 22511c8e24
commit 0acc260b81
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 3 additions and 2 deletions

View file

@ -18,6 +18,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
### Changed
* Changed behavior of allocation IP Address/Ports box to automatically store the value entered if a user unfocuses the field without hitting space.
* c order in which allocations are displayed to prioritize those with servers attached (in ascending IP & port order) followed by ascending IP & port order where no server is attached.
## v0.7.0-beta.3 (Derelict Dermodactylus)
### Fixed

View file

@ -106,7 +106,7 @@ class NodeRepository extends EloquentRepository implements NodeRepositoryInterfa
public function loadNodeAllocations(Node $node, bool $refresh = false): Node
{
$node->setRelation('allocations',
$node->allocations()->orderBy('ip', 'asc')->orderBy('port', 'asc')->with('server')->paginate(50)
$node->allocations()->orderByRaw('server_id IS NOT NULL DESC, server_id IS NULL')->orderByRaw('INET_ATON(ip) ASC')->orderBy('port', 'asc')->with('server')->paginate(50)
);
return $node;

View file

@ -18,6 +18,6 @@ return [
'location_required' => 'You must have at least one location configured before you can add a node to this panel.',
'node_created' => 'Successfully created new node. You can automatically configure the daemon on this machine by visiting the \'Configuration\' tab. <strong>Before you can add any servers you must first allocate at least one IP address and port.</strong>',
'node_updated' => 'Node information has been updated. If any daemon settings were changed you will need to reboot it for those changes to take effect.',
'unallocated_deleted' => 'Deleted all unallocatred ports for <code>:ip</code>.',
'unallocated_deleted' => 'Deleted all un-allocated ports for <code>:ip</code>.',
],
];