mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 11:36:50 +03:00
feat: add vpn section outbound displaying
This commit is contained in:
@@ -106,6 +106,26 @@ export async function getDashboardSections(): Promise<Podkop.OutboundGroup[]> {
|
||||
}
|
||||
}
|
||||
|
||||
if (section.mode === 'vpn') {
|
||||
const outbound = proxies.find(
|
||||
(proxy) => proxy.code === `${section['.name']}-out`,
|
||||
);
|
||||
|
||||
return {
|
||||
code: section['.name'],
|
||||
displayName: section['.name'],
|
||||
outbounds: [
|
||||
{
|
||||
code: outbound?.code || section['.name'],
|
||||
displayName: section.interface || outbound?.value?.name || '',
|
||||
latency: outbound?.value?.history?.[0]?.delay || 0,
|
||||
type: outbound?.value?.type || '',
|
||||
selected: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
code: section['.name'],
|
||||
displayName: section['.name'],
|
||||
|
||||
@@ -985,6 +985,24 @@ async function getDashboardSections() {
|
||||
};
|
||||
}
|
||||
}
|
||||
if (section.mode === "vpn") {
|
||||
const outbound = proxies.find(
|
||||
(proxy) => proxy.code === `${section[".name"]}-out`
|
||||
);
|
||||
return {
|
||||
code: section[".name"],
|
||||
displayName: section[".name"],
|
||||
outbounds: [
|
||||
{
|
||||
code: outbound?.code || section[".name"],
|
||||
displayName: section.interface || outbound?.value?.name || "",
|
||||
latency: outbound?.value?.history?.[0]?.delay || 0,
|
||||
type: outbound?.value?.type || "",
|
||||
selected: true
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
return {
|
||||
code: section[".name"],
|
||||
displayName: section[".name"],
|
||||
|
||||
Reference in New Issue
Block a user