diff --git a/app/Models/Server.php b/app/Models/Server.php index ebe6d2ee7..6ad7b9f05 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -23,6 +23,7 @@ use Znck\Eloquent\Traits\BelongsToThrough; * @property int $disk * @property int $io * @property int $cpu + * @property string $threads * @property bool $oom_disabled * @property int $allocation_id * @property int $nest_id @@ -109,6 +110,7 @@ class Server extends Validable 'swap' => 'required|numeric|min:-1', 'io' => 'required|numeric|between:10,1000', 'cpu' => 'required|numeric|min:0', + 'threads' => 'sometimes|regex:/^[0-9-,]+$/', 'oom_disabled' => 'sometimes|boolean', 'disk' => 'required|numeric|min:0', 'allocation_id' => 'required|bail|unique:servers|exists:allocations,id', diff --git a/database/migrations/2020_04_03_203624_add_threads_column_to_servers_table.php b/database/migrations/2020_04_03_203624_add_threads_column_to_servers_table.php new file mode 100644 index 000000000..5440d0c58 --- /dev/null +++ b/database/migrations/2020_04_03_203624_add_threads_column_to_servers_table.php @@ -0,0 +1,32 @@ +string('threads')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('servers', function (Blueprint $table) { + $table->dropColumn('threads'); + }); + } +} diff --git a/resources/views/admin/eggs/variables.blade.php b/resources/views/admin/eggs/variables.blade.php index f8463f4bd..2441c725f 100644 --- a/resources/views/admin/eggs/variables.blade.php +++ b/resources/views/admin/eggs/variables.blade.php @@ -48,7 +48,7 @@