feat(routes): add TLS configuration controls for route create and edit flows

This commit is contained in:
2026-04-04 21:23:16 +00:00
parent 648ba9e61d
commit 96d215fc66
7 changed files with 146 additions and 19 deletions

View File

@@ -132,7 +132,18 @@ export class RouteConfigManager {
if (!stored) return false;
if (patch.route) {
stored.route = { ...stored.route, ...patch.route } as IDcRouterRouteConfig;
const mergedAction = patch.route.action
? { ...stored.route.action, ...patch.route.action }
: stored.route.action;
// Handle explicit null to remove nested action properties (e.g., tls: null)
if (patch.route.action) {
for (const [key, val] of Object.entries(patch.route.action)) {
if (val === null) {
delete (mergedAction as any)[key];
}
}
}
stored.route = { ...stored.route, ...patch.route, action: mergedAction } as IDcRouterRouteConfig;
}
if (patch.enabled !== undefined) {
stored.enabled = patch.enabled;