diff --git a/data/config.db b/data/config.db
index a39ebf7..0a8cfbc 100644
--- a/data/config.db
+++ b/data/config.db
Binary files differ
diff --git a/internal/pkg/snapshot/resource_crud.go b/internal/pkg/snapshot/resource_crud.go
index 288857b..b1911dc 100644
--- a/internal/pkg/snapshot/resource_crud.go
+++ b/internal/pkg/snapshot/resource_crud.go
@@ -37,8 +37,16 @@
}
replaced := false
+ newFilterChainDomainNames := "(default)"
+ if newFilterChain.FilterChainMatch != nil {
+ newFilterChainDomainNames = strings.Join(newFilterChain.FilterChainMatch.ServerNames, ",")
+ }
for i, fc := range listener.FilterChains {
- if fc.Name == newFilterChain.Name {
+ currentFilterChainDomainNames := "(default)"
+ if fc.FilterChainMatch != nil {
+ currentFilterChainDomainNames = strings.Join(fc.FilterChainMatch.ServerNames, ",")
+ }
+ if newFilterChainDomainNames == currentFilterChainDomainNames {
if !upsert {
return fmt.Errorf("filter chain with name '%s' already exists in listener '%s' and upsert is false", newFilterChain.Name, listenerName)
}
diff --git a/static/global.js b/static/global.js
index a46e4c5..b1c955a 100644
--- a/static/global.js
+++ b/static/global.js
@@ -59,6 +59,8 @@
window.hideAddFilterChainModal?.();
window.hideAddListenerModal?.();
window.hideAddClusterModal?.();
+ window.hideAddSecretModal?.();
+ window.hideCertificateDetailsModal?.()
}
});
diff --git a/static/index.html b/static/index.html
index 168c8ad..cc789a2 100644
--- a/static/index.html
+++ b/static/index.html
@@ -189,7 +189,7 @@
@@ -335,7 +335,7 @@
TLS Certificate Details
×
+ onclick="hideCertificateDetailsModal()">×
diff --git a/static/listeners.js b/static/listeners.js
index 84feccf..3e733f1 100644
--- a/static/listeners.js
+++ b/static/listeners.js
@@ -2,9 +2,9 @@
import {
API_BASE_URL,
configStore,
- cleanupConfigStore, // Re-import from global
+ cleanupConfigStore, // Re-import from global
} from './global.js';
-import { showListenerConfigModal } from './modals.js';
+
// We assume 'showModal' is defined elsewhere or is not needed as all modals are now handled directly
// Or, if showModal is used, it should be a general modal function from global.js or a separate modals.js file.
// For this consolidation, we'll assume showModal is a simple function defined here or in a helper file.
diff --git a/static/modals.js b/static/modals.js
index 620ebb0..05c7751 100644
--- a/static/modals.js
+++ b/static/modals.js
@@ -148,6 +148,14 @@
export function showConfigModal(title, jsonData, yamlData, defaultTab = 'yaml') {
document.getElementById('modal-title').textContent = title;
+ // 1. Check if the 'yaml' key exists in the jsonData object.
+ // The "yaml" attribute is only used for storing yaml context, when we display it in the frontent,
+ // we should exclude it from the display to confuse the user.
+ if (jsonData && jsonData.yaml !== undefined) {
+ // 2. Use the delete operator to remove the key
+ delete jsonData.yaml;
+ }
+
// Populate JSON content
document.getElementById('modal-json-content').textContent =
JSON.stringify(jsonData, null, 2);
diff --git a/static/secrets.js b/static/secrets.js
index 22e9d6c..c52c53d 100644
--- a/static/secrets.js
+++ b/static/secrets.js
@@ -158,8 +158,18 @@
}
}
+export function hideCertificateDetailsModal() {
+ const modal = document.getElementById('certificateDetailsModal');
+ if (modal) {
+ modal.style.display = 'none';
+ // Clear the input when closing
+ document.getElementById('certificate-details-content').value = '';
+ }
+}
+
// Expose the new function globally for inline HTML onclick handlers
window.showCertificateDetailsModal = showCertificateDetailsModal;
+window.hideCertificateDetailsModal = hideCertificateDetailsModal;
/**