mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 05:20:43 +00:00
fix: fix SPA toggle nginx regeneration and add confirmation modal
- Fix SPA toggle not triggering nginx configuration regeneration by capturing old value before syncData - Fix similar issue with is_http_basic_auth_enabled using value comparison instead of isDirty - Remove redundant application settings save() call - Add confirmation modal to nginx generation button to prevent accidental overwrites - Pass correct type parameter (spa/static) to generateNginxConfiguration method
This commit is contained in:
@@ -482,18 +482,18 @@ class General extends Component
|
||||
$oldPortsExposes = $this->application->ports_exposes;
|
||||
$oldIsContainerLabelEscapeEnabled = $this->application->settings->is_container_label_escape_enabled;
|
||||
$oldIsPreserveRepositoryEnabled = $this->application->settings->is_preserve_repository_enabled;
|
||||
$oldIsSpa = $this->application->settings->is_spa;
|
||||
$oldIsHttpBasicAuthEnabled = $this->application->is_http_basic_auth_enabled;
|
||||
|
||||
$this->syncData(toModel: true);
|
||||
|
||||
if ($this->application->settings->isDirty('is_spa')) {
|
||||
$this->generateNginxConfiguration($this->application->settings->is_spa ? 'spa' : 'static');
|
||||
if ($oldIsSpa !== $this->isSpa) {
|
||||
$this->generateNginxConfiguration($this->isSpa ? 'spa' : 'static');
|
||||
}
|
||||
if ($this->application->isDirty('is_http_basic_auth_enabled')) {
|
||||
if ($oldIsHttpBasicAuthEnabled !== $this->isHttpBasicAuthEnabled) {
|
||||
$this->application->save();
|
||||
}
|
||||
|
||||
$this->application->settings->save();
|
||||
|
||||
$this->dispatch('success', 'Settings saved.');
|
||||
$this->application->refresh();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user