2 Commits
6 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -302,7 +302,7 @@ app.post('/api/ip-ranges', writeLimiter, ipRangesRoutes.post);
// === JSON DATA ROUTES (используют фабрики) ===
// Servers
const SERVER_TYPES = ['jumphost', 'exit', 'bgp', 'dns'];
const SERVER_TYPES = ['jumphost', 'exit', 'bgp', 'dns', 'home'];
const TYPES_NEED_TUNNEL = ['jumphost', 'exit']; // Типы, которым нужен туннель
const TYPES_NEED_GATEWAYS = ['jumphost', 'exit']; // Типы, которым нужны gateways
+4 -2
View File
@@ -126,9 +126,11 @@ function BillingManager() {
prev.map(b => b.serverId).filter(Boolean)
);
// Находим серверы без записей в биллинге
// Находим серверы без записей в биллинге (исключаем входные роутеры)
const serversToAdd = servers.filter(server =>
server.id && !existingServerIds.has(server.id)
server.id &&
!existingServerIds.has(server.id) &&
server.type !== 'home' // Входные роутеры не попадают в биллинг
);
if (serversToAdd.length === 0) return prev;
+1 -1
View File
@@ -989,7 +989,7 @@ function FilterManager() {
}
});
// Фильтруем только jumphost'ы (исключаем exit-ноды, bgp и dns серверы)
// Фильтруем только jumphost'ы (исключаем exit-ноды, bgp, dns и входные роутеры)
const jumphosts = allServers
.filter(s => s.type === 'jumphost')
.map(s => {
+4 -4
View File
@@ -1433,8 +1433,8 @@ function NetworkConfigManager() {
// Для GRE туннелей - создаем туннель, опционально с IPSec через ipsec-secret
if (iface.type === 'GRE') {
const remoteServerIp = iface.server2Info?.ip || iface.server2Name;
const localServerIp = server.ip || serverName;
// Используем DNS домен для remote-address, если он есть, иначе IP
const remoteAddress = iface.server2Info?.dns || iface.server2Info?.ip || iface.server2Name;
// Проверяем наличие пароля: ipsecPasswordId должен быть не пустым и пароль должен быть загружен
const hasIpsecPassword = iface.ipsecPasswordId &&
@@ -1445,12 +1445,12 @@ function NetworkConfigManager() {
if (hasIpsecPassword) {
// GRE туннель с IPSec через ipsec-secret (автоматическая настройка)
code += `# Создание GRE туннеля с IPSec (автоматическая настройка через ipsec-secret)\n`;
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteServerIp} local-address=${localServerIp} keepalive=10s ipsec-secret="${iface.ipsecPassword}"\n`;
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteAddress} keepalive=10s ipsec-secret="${iface.ipsecPassword}"\n`;
code += '\n';
} else {
// GRE туннель без IPSec (голый GRE)
code += `# Создание GRE туннеля (без IPSec)\n`;
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteServerIp} local-address=${localServerIp} keepalive=10s\n`;
code += `/interface gre add name="${iface.interfaceName}" remote-address=${remoteAddress} keepalive=10s\n`;
code += '\n';
}
}
@@ -57,6 +57,7 @@ export default function ServerCard({
exit: { label: 'EXIT', color: 'red', icon: IconArrowsRightLeft },
bgp: { label: 'BGP', color: 'purple', icon: IconRoute },
dns: { label: 'DNS', color: 'cyan', icon: IconWorldWww },
home: { label: 'HOME', color: 'green', icon: IconRouter },
};
const currentTypeConfig = typeConfig[serverType] || typeConfig.jumphost;
+1
View File
@@ -93,6 +93,7 @@ export const SERVER_TYPE_OPTIONS = [
{ value: 'exit', label: 'Выходная нода' },
{ value: 'bgp', label: 'BGP роутер' },
{ value: 'dns', label: 'DNS сервер' },
{ value: 'home', label: 'Входной роутер (домашний)' },
];
/**