feat(serverConfigs): enhance jumphost server filtering logic for backward compatibility
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m24s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m24s
This commit is contained in:
1 parent
fda6e936aa
commit
c6599efb21
2 files changed
+15
-1
No files matched your search
@@ -62,8 +62,18 @@ async function getServerConfigsList(req, res) {
|
||||
}
|
||||
|
||||
// Фильтруем только jumphost серверы и добавляем id/name для совместимости с фронтендом
|
||||
// Fallback: если type не указан, но есть gateways - считаем jumphost (обратная совместимость)
|
||||
const jumphostServers = allServers
|
||||
.filter(s => String(s.type || '').toLowerCase() === 'jumphost')
|
||||
.filter(s => {
|
||||
const serverType = String(s.type || '').toLowerCase();
|
||||
// Явно jumphost
|
||||
if (serverType === 'jumphost') return true;
|
||||
// Явно exit - пропускаем
|
||||
if (serverType === 'exit') return false;
|
||||
// Тип не указан, но есть gateways - считаем jumphost (обратная совместимость)
|
||||
if (!serverType && Array.isArray(s.gateways) && s.gateways.length > 0) return true;
|
||||
return false;
|
||||
})
|
||||
.map(s => ({
|
||||
...s,
|
||||
// Для совместимости с EasySwitchManager добавляем id и name из dns
|
||||
|
||||
Reference in new issue
Block a user