fix: adapt dashboard for new sections structure

This commit is contained in:
divocat
2025-10-10 20:49:44 +03:00
parent b90f520c68
commit 1bdd49e198
3 changed files with 14 additions and 12 deletions

View File

@@ -943,6 +943,7 @@ async function getConfigSections() {
// src/podkop/methods/getDashboardSections.ts
async function getDashboardSections() {
const configSections = await getConfigSections();
console.log("configSections", configSections);
const clashProxies = await getClashProxies();
if (!clashProxies.success) {
return {
@@ -956,8 +957,8 @@ async function getDashboardSections() {
value
})
);
const data = configSections.filter((section) => section.mode !== "block").map((section) => {
if (section.mode === "proxy") {
const data = configSections.filter((section) => section.connection_type !== "block" && section[".type"] !== "settings").map((section) => {
if (section.connection_type === "proxy") {
if (section.proxy_config_type === "url") {
const outbound = proxies.find(
(proxy) => proxy.code === `${section[".name"]}-out`
@@ -1032,7 +1033,7 @@ async function getDashboardSections() {
};
}
}
if (section.mode === "vpn") {
if (section.connection_type === "vpn") {
const outbound = proxies.find(
(proxy) => proxy.code === `${section[".name"]}-out`
);