diff --git a/fe-app-podkop/src/podkop/methods/getDashboardSections.ts b/fe-app-podkop/src/podkop/methods/getDashboardSections.ts index 28a5573..78d5c77 100644 --- a/fe-app-podkop/src/podkop/methods/getDashboardSections.ts +++ b/fe-app-podkop/src/podkop/methods/getDashboardSections.ts @@ -10,6 +10,7 @@ interface IGetDashboardSectionsResponse { export async function getDashboardSections(): Promise { const configSections = await getConfigSections(); + console.log('configSections', configSections) const clashProxies = await getClashProxies(); if (!clashProxies.success) { @@ -27,9 +28,9 @@ export async function getDashboardSections(): Promise section.mode !== 'block') + .filter((section) => section.connection_type !== 'block' && section[".type"] !== 'settings') .map((section) => { - if (section.mode === 'proxy') { + if (section.connection_type === 'proxy') { if (section.proxy_config_type === 'url') { const outbound = proxies.find( (proxy) => proxy.code === `${section['.name']}-out`, @@ -122,7 +123,7 @@ export async function getDashboardSections(): Promise proxy.code === `${section['.name']}-out`, ); diff --git a/fe-app-podkop/src/podkop/types.ts b/fe-app-podkop/src/podkop/types.ts index 531f648..e6203e6 100644 --- a/fe-app-podkop/src/podkop/types.ts +++ b/fe-app-podkop/src/podkop/types.ts @@ -16,30 +16,30 @@ export namespace Podkop { } export interface ConfigProxyUrlTestSection { - mode: 'proxy'; + connection_type: 'proxy'; proxy_config_type: 'urltest'; urltest_proxy_links: string[]; } export interface ConfigProxyUrlSection { - mode: 'proxy'; + connection_type: 'proxy'; proxy_config_type: 'url'; proxy_string: string; } export interface ConfigProxyOutboundSection { - mode: 'proxy'; + connection_type: 'proxy'; proxy_config_type: 'outbound'; outbound_json: string; } export interface ConfigVpnSection { - mode: 'vpn'; + connection_type: 'vpn'; interface: string; } export interface ConfigBlockSection { - mode: 'block'; + connection_type: 'block'; } export type ConfigBaseSection = @@ -51,6 +51,6 @@ export namespace Podkop { export type ConfigSection = ConfigBaseSection & { '.name': string; - '.type': 'main' | 'extra'; + '.type': 'settings' | 'section'; }; } diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js index 8f7e7b7..532b06d 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/main.js @@ -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` );