Fix styling
This commit is contained in:
committed by
github-actions[bot]
parent
41fb6a1fc9
commit
d86274cc37
@@ -7,6 +7,7 @@ use Livewire\Component;
|
||||
class ResourceLimits extends Component
|
||||
{
|
||||
public $resource;
|
||||
|
||||
protected $rules = [
|
||||
'resource.limits_memory' => 'required|string',
|
||||
'resource.limits_memory_swap' => 'required|string',
|
||||
@@ -16,6 +17,7 @@ class ResourceLimits extends Component
|
||||
'resource.limits_cpuset' => 'nullable',
|
||||
'resource.limits_cpu_shares' => 'nullable',
|
||||
];
|
||||
|
||||
protected $validationAttributes = [
|
||||
'resource.limits_memory' => 'memory',
|
||||
'resource.limits_memory_swap' => 'swap',
|
||||
@@ -29,22 +31,22 @@ class ResourceLimits extends Component
|
||||
public function submit()
|
||||
{
|
||||
try {
|
||||
if (!$this->resource->limits_memory) {
|
||||
$this->resource->limits_memory = "0";
|
||||
if (! $this->resource->limits_memory) {
|
||||
$this->resource->limits_memory = '0';
|
||||
}
|
||||
if (!$this->resource->limits_memory_swap) {
|
||||
$this->resource->limits_memory_swap = "0";
|
||||
if (! $this->resource->limits_memory_swap) {
|
||||
$this->resource->limits_memory_swap = '0';
|
||||
}
|
||||
if (is_null($this->resource->limits_memory_swappiness)) {
|
||||
$this->resource->limits_memory_swappiness = "60";
|
||||
$this->resource->limits_memory_swappiness = '60';
|
||||
}
|
||||
if (!$this->resource->limits_memory_reservation) {
|
||||
$this->resource->limits_memory_reservation = "0";
|
||||
if (! $this->resource->limits_memory_reservation) {
|
||||
$this->resource->limits_memory_reservation = '0';
|
||||
}
|
||||
if (!$this->resource->limits_cpus) {
|
||||
$this->resource->limits_cpus = "0";
|
||||
if (! $this->resource->limits_cpus) {
|
||||
$this->resource->limits_cpus = '0';
|
||||
}
|
||||
if ($this->resource->limits_cpuset === "") {
|
||||
if ($this->resource->limits_cpuset === '') {
|
||||
$this->resource->limits_cpuset = null;
|
||||
}
|
||||
if (is_null($this->resource->limits_cpu_shares)) {
|
||||
|
||||
Reference in New Issue
Block a user