Fix server creation in UI and API
This commit is contained in:
		
							parent
							
								
									0135f7ee8e
								
							
						
					
					
						commit
						dff7e8f734
					
				| @ -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. | ||||
|  | ||||
| @ -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'), | ||||
|         ]; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -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'), | ||||
|         ]); | ||||
|     } | ||||
| 
 | ||||
|  | ||||
| @ -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"> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dane Everitt
						Dane Everitt