fix: bypass port validation when saving advanced checkboxes (#7435)
This commit is contained in:
commit
2d8b446ced
2 changed files with 19 additions and 4 deletions
|
|
@ -82,6 +82,21 @@ public function instantSave()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function instantSaveSettings()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->authorize('update', $this->application);
|
||||||
|
// Save checkbox states without port validation
|
||||||
|
$this->application->is_gzip_enabled = $this->isGzipEnabled;
|
||||||
|
$this->application->is_stripprefix_enabled = $this->isStripprefixEnabled;
|
||||||
|
$this->application->exclude_from_status = $this->excludeFromStatus;
|
||||||
|
$this->application->save();
|
||||||
|
$this->dispatch('success', 'Settings saved.');
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return handleError($e, $this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function instantSaveAdvanced()
|
public function instantSaveAdvanced()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -56,18 +56,18 @@
|
||||||
<h3 class="py-2 pt-4">Advanced</h3>
|
<h3 class="py-2 pt-4">Advanced</h3>
|
||||||
<div class="w-96 flex flex-col gap-1">
|
<div class="w-96 flex flex-col gap-1">
|
||||||
@if (str($application->image)->contains('pocketbase'))
|
@if (str($application->image)->contains('pocketbase'))
|
||||||
<x-forms.checkbox canGate="update" :canResource="$application" instantSave id="isGzipEnabled"
|
<x-forms.checkbox canGate="update" :canResource="$application" instantSave="instantSaveSettings" id="isGzipEnabled"
|
||||||
label="Enable Gzip Compression"
|
label="Enable Gzip Compression"
|
||||||
helper="Pocketbase does not need gzip compression, otherwise SSE will not work." disabled />
|
helper="Pocketbase does not need gzip compression, otherwise SSE will not work." disabled />
|
||||||
@else
|
@else
|
||||||
<x-forms.checkbox canGate="update" :canResource="$application" instantSave id="isGzipEnabled"
|
<x-forms.checkbox canGate="update" :canResource="$application" instantSave="instantSaveSettings" id="isGzipEnabled"
|
||||||
label="Enable Gzip Compression"
|
label="Enable Gzip Compression"
|
||||||
helper="You can disable gzip compression if you want. Some services are compressing data by default. In this case, you do not need this." />
|
helper="You can disable gzip compression if you want. Some services are compressing data by default. In this case, you do not need this." />
|
||||||
@endif
|
@endif
|
||||||
<x-forms.checkbox canGate="update" :canResource="$application" instantSave id="isStripprefixEnabled"
|
<x-forms.checkbox canGate="update" :canResource="$application" instantSave="instantSaveSettings" id="isStripprefixEnabled"
|
||||||
label="Strip Prefixes"
|
label="Strip Prefixes"
|
||||||
helper="Strip Prefix is used to remove prefixes from paths. Like /api/ to /api." />
|
helper="Strip Prefix is used to remove prefixes from paths. Like /api/ to /api." />
|
||||||
<x-forms.checkbox canGate="update" :canResource="$application" instantSave label="Exclude from service status"
|
<x-forms.checkbox canGate="update" :canResource="$application" instantSave="instantSaveSettings" label="Exclude from service status"
|
||||||
helper="If you do not need to monitor this resource, enable. Useful if this service is optional."
|
helper="If you do not need to monitor this resource, enable. Useful if this service is optional."
|
||||||
id="excludeFromStatus"></x-forms.checkbox>
|
id="excludeFromStatus"></x-forms.checkbox>
|
||||||
<x-forms.checkbox canGate="update" :canResource="$application"
|
<x-forms.checkbox canGate="update" :canResource="$application"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue