rename "oom_disabled" to "oom_killer" and invert logic

This commit is contained in:
Boy132
2024-05-08 09:51:08 +02:00
parent 1f5217a9d9
commit f02eb5bfba
18 changed files with 77 additions and 30 deletions

View File

@@ -35,7 +35,7 @@ use App\Exceptions\Http\Server\ServerStateConflictException;
* @property int $io
* @property int $cpu
* @property string|null $threads
* @property bool $oom_disabled
* @property bool $oom_killer
* @property int $allocation_id
* @property int $egg_id
* @property string $startup
@@ -90,7 +90,7 @@ use App\Exceptions\Http\Server\ServerStateConflictException;
* @method static \Illuminate\Database\Eloquent\Builder|Server whereMemory($value)
* @method static \Illuminate\Database\Eloquent\Builder|Server whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|Server whereNodeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Server whereOomDisabled($value)
* @method static \Illuminate\Database\Eloquent\Builder|Server whereOomKiller($value)
* @method static \Illuminate\Database\Eloquent\Builder|Server whereOwnerId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Server whereSkipScripts($value)
* @method static \Illuminate\Database\Eloquent\Builder|Server whereStartup($value)
@@ -124,7 +124,7 @@ class Server extends Model
*/
protected $attributes = [
'status' => ServerState::Installing,
'oom_disabled' => true,
'oom_killer' => false,
'installed_at' => null,
];
@@ -150,7 +150,7 @@ class Server extends Model
'io' => 'required|numeric|between:0,1000',
'cpu' => 'required|numeric|min:0',
'threads' => 'nullable|regex:/^[0-9-,]+$/',
'oom_disabled' => 'sometimes|boolean',
'oom_killer' => 'sometimes|boolean',
'disk' => 'required|numeric|min:0',
'allocation_id' => 'required|bail|unique:servers|exists:allocations,id',
'egg_id' => 'required|exists:eggs,id',
@@ -174,7 +174,7 @@ class Server extends Model
'disk' => 'integer',
'io' => 'integer',
'cpu' => 'integer',
'oom_disabled' => 'boolean',
'oom_killer' => 'boolean',
'allocation_id' => 'integer',
'egg_id' => 'integer',
'database_limit' => 'integer',