feat: Enhance gateway initialization in EditServerModal by ensuring a default primary gateway is created when no gateways are specified, improving server configuration reliability.
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m56s

This commit is contained in:
2025-12-07 00:27:03 +07:00
parent 83b3fd96aa
commit 7b6e7580fb
+4 -1
View File
@@ -1446,7 +1446,10 @@ function EditServerModal({ show, server, onChange, onSave, onClose }) {
const ensureGateways = (srv) => {
if (!srv) return {};
const needs = NEEDS_GATEWAYS(srv.type);
const gateways = needs ? normalizeGateways(srv.gateways, srv.gateway || srv.dns || srv.ip) : [];
let gateways = needs ? normalizeGateways(srv.gateways, srv.gateway || srv.dns || srv.ip) : [];
if (needs && gateways.length === 0) {
gateways = [makeGateway({ primary: true })];
}
return { ...srv, gateways };
};