fix: should be able to reset labels in read-only mode with manual click

This commit is contained in:
Andras Bacsai
2024-10-22 11:25:03 +02:00
parent bfd6923ba6
commit c338eef57b
2 changed files with 3 additions and 3 deletions

View File

@@ -274,10 +274,10 @@ class General extends Component
}
}
public function resetDefaultLabels()
public function resetDefaultLabels($manualReset = false)
{
try {
if ($this->application->settings->is_container_label_readonly_enabled) {
if ($this->application->settings->is_container_label_readonly_enabled && ! $manualReset) {
return;
}
$this->customLabels = str(implode('|coolify|', generateLabelsApplication($this->application)))->replace('|coolify|', "\n");

View File

@@ -312,7 +312,7 @@
id="application.settings.is_container_label_readonly_enabled" instantSave></x-forms.checkbox>
</div>
<x-modal-confirmation title="Confirm Labels Reset to Coolify Defaults?"
buttonTitle="Reset Labels to Coolify Defaults" buttonFullWidth submitAction="resetDefaultLabels"
buttonTitle="Reset Labels to Defaults" buttonFullWidth submitAction="resetDefaultLabels(true)"
:actions="[
'All your custom proxy labels will be lost.',
'Proxy labels (traefik, caddy, etc) will be reset to the coolify defaults.',