diff --git a/frontend/src/components/server/ServerModal.jsx b/frontend/src/components/server/ServerModal.jsx
index d5dab57..5a13808 100644
--- a/frontend/src/components/server/ServerModal.jsx
+++ b/frontend/src/components/server/ServerModal.jsx
@@ -4,6 +4,7 @@ import {
makeGateway,
normalizeGateways,
needsGateways as NEEDS_GATEWAYS,
+ needsTunnel as NEEDS_TUNNEL,
SERVER_TYPE_OPTIONS,
TUNNEL_TYPES
} from '../../utils/serverUtils.js';
@@ -417,7 +418,7 @@ function ServerModal({ show, mode = 'add', server, onSave, onClose, error: exter
)}
{/* Тип сервера */}
-
+
- {/* Тип туннеля */}
-
-
-
-
+ {/* Тип туннеля - только для типов, которым он нужен */}
+ {NEEDS_TUNNEL(localServer.type) && (
+
+
+
+
+ )}
{/* Основной шлюз (текстовое поле для совместимости) */}
diff --git a/frontend/src/utils/serverUtils.js b/frontend/src/utils/serverUtils.js
index e9e7224..5064726 100644
--- a/frontend/src/utils/serverUtils.js
+++ b/frontend/src/utils/serverUtils.js
@@ -92,8 +92,20 @@ export const SERVER_TYPE_OPTIONS = [
{ value: 'jumphost', label: 'Jumphost' },
{ value: 'exit', label: 'Выходная нода' },
{ value: 'bgp', label: 'BGP роутер' },
+ { value: 'dns', label: 'DNS сервер' },
];
+/**
+ * Проверяет, нужен ли туннель для данного типа сервера
+ * @param {string} type - Тип сервера
+ * @returns {boolean}
+ */
+export const needsTunnel = (type) => {
+ // BGP и DNS серверам туннель не нужен
+ const noTunnelTypes = ['bgp', 'dns'];
+ return !noTunnelTypes.includes(String(type || '').toLowerCase());
+};
+
/**
* Типы туннелей
*/