1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-10-26 21:02:28 +02:00

Fix server creation in UI and API

This commit is contained in:
Dane Everitt 2018-03-02 23:11:30 -06:00
parent 0135f7ee8e
commit dff7e8f734
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
4 changed files with 39 additions and 0 deletions

View File

@ -3,6 +3,10 @@ This file is a running track of new features and fixes to each version of the pa
This project follows [Semantic Versioning](http://semver.org) guidelines.
## v0.7.4-h1 (Derelict Dermodactylus)
### Fixed
* Being able to create servers is kind of a core aspect of the software, pushing releases late at night is not a great idea.
## v0.7.4 (Derelict Dermodactylus)
### Fixed
* Fixes a bug when reinstalling a server that would not mark the server as installing, resulting in some UI issues.

View File

@ -50,6 +50,11 @@ class StoreServerRequest extends ApplicationApiRequest
'limits.io' => $rules['io'],
'limits.cpu' => $rules['cpu'],
// Application Resource Limits
'feature_limits' => 'required|array',
'feature_limits.databases' => $rules['database_limit'],
'feature_limits.allocations' => $rules['allocation_limit'],
// Placeholders for rules added in withValidator() function.
'allocation.default' => '',
'allocation.additional.*' => '',
@ -94,6 +99,8 @@ class StoreServerRequest extends ApplicationApiRequest
'allocation_id' => array_get($data, 'allocation.default'),
'allocation_additional' => array_get($data, 'allocation.additional'),
'start_on_completion' => array_get($data, 'start_on_completion', false),
'database_limit' => array_get($data, 'feature_limits.databases'),
'allocation_limit' => array_get($data, 'feature_limits.allocations'),
];
}

View File

@ -233,6 +233,8 @@ class ServerCreationService
'startup' => array_get($data, 'startup'),
'daemonSecret' => str_random(Node::DAEMON_SECRET_LENGTH),
'image' => array_get($data, 'image'),
'database_limit' => array_get($data, 'database_limit'),
'allocation_limit' => array_get($data, 'allocation_limit'),
]);
}

View File

@ -94,6 +94,32 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="overlay" id="allocationLoader" style="display:none;"><i class="fa fa-refresh fa-spin"></i></div>
<div class="box-header with-border">
<h3 class="box-title">Application Feature Limits</h3>
</div>
<div class="box-body row">
<div class="form-group col-xs-6">
<label for="cpu" class="control-label">Database Limit</label>
<div>
<input type="text" name="database_limit" class="form-control" value="{{ old('database_limit', 0) }}"/>
</div>
<p class="text-muted small">The total number of databases a user is allowed to create for this server. Leave blank to allow unlimmited.</p>
</div>
<div class="form-group col-xs-6">
<label for="cpu" class="control-label">Allocation Limit</label>
<div>
<input type="text" name="allocation_limit" class="form-control" value="{{ old('allocation_limit', 0) }}"/>
</div>
<p class="text-muted small">The total number of allocations a user is allowed to create for this server. Leave blank to allow unlimited.</p>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">