feat(ServerManagement): add 'home' server type to server configurations and update related components to handle billing and filtering exclusions for home routers
This commit is contained in:
+1
-1
@@ -302,7 +302,7 @@ app.post('/api/ip-ranges', writeLimiter, ipRangesRoutes.post);
|
|||||||
// === JSON DATA ROUTES (используют фабрики) ===
|
// === JSON DATA ROUTES (используют фабрики) ===
|
||||||
|
|
||||||
// Servers
|
// 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_TUNNEL = ['jumphost', 'exit']; // Типы, которым нужен туннель
|
||||||
const TYPES_NEED_GATEWAYS = ['jumphost', 'exit']; // Типы, которым нужны gateways
|
const TYPES_NEED_GATEWAYS = ['jumphost', 'exit']; // Типы, которым нужны gateways
|
||||||
|
|
||||||
|
|||||||
@@ -126,9 +126,11 @@ function BillingManager() {
|
|||||||
prev.map(b => b.serverId).filter(Boolean)
|
prev.map(b => b.serverId).filter(Boolean)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Находим серверы без записей в биллинге
|
// Находим серверы без записей в биллинге (исключаем входные роутеры)
|
||||||
const serversToAdd = servers.filter(server =>
|
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;
|
if (serversToAdd.length === 0) return prev;
|
||||||
|
|||||||
@@ -989,7 +989,7 @@ function FilterManager() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Фильтруем только jumphost'ы (исключаем exit-ноды, bgp и dns серверы)
|
// Фильтруем только jumphost'ы (исключаем exit-ноды, bgp, dns и входные роутеры)
|
||||||
const jumphosts = allServers
|
const jumphosts = allServers
|
||||||
.filter(s => s.type === 'jumphost')
|
.filter(s => s.type === 'jumphost')
|
||||||
.map(s => {
|
.map(s => {
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export default function ServerCard({
|
|||||||
exit: { label: 'EXIT', color: 'red', icon: IconArrowsRightLeft },
|
exit: { label: 'EXIT', color: 'red', icon: IconArrowsRightLeft },
|
||||||
bgp: { label: 'BGP', color: 'purple', icon: IconRoute },
|
bgp: { label: 'BGP', color: 'purple', icon: IconRoute },
|
||||||
dns: { label: 'DNS', color: 'cyan', icon: IconWorldWww },
|
dns: { label: 'DNS', color: 'cyan', icon: IconWorldWww },
|
||||||
|
home: { label: 'HOME', color: 'green', icon: IconRouter },
|
||||||
};
|
};
|
||||||
const currentTypeConfig = typeConfig[serverType] || typeConfig.jumphost;
|
const currentTypeConfig = typeConfig[serverType] || typeConfig.jumphost;
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export const SERVER_TYPE_OPTIONS = [
|
|||||||
{ value: 'exit', label: 'Выходная нода' },
|
{ value: 'exit', label: 'Выходная нода' },
|
||||||
{ value: 'bgp', label: 'BGP роутер' },
|
{ value: 'bgp', label: 'BGP роутер' },
|
||||||
{ value: 'dns', label: 'DNS сервер' },
|
{ value: 'dns', label: 'DNS сервер' },
|
||||||
|
{ value: 'home', label: 'Входной роутер (домашний)' },
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user