diff --git a/fe-app-podkop/src/podkop/tabs/dashboard/renderDashboard.ts b/fe-app-podkop/src/podkop/tabs/dashboard/renderDashboard.ts index b4151e2..c647cc6 100644 --- a/fe-app-podkop/src/podkop/tabs/dashboard/renderDashboard.ts +++ b/fe-app-podkop/src/podkop/tabs/dashboard/renderDashboard.ts @@ -47,6 +47,7 @@ export function renderDashboard() { }, onTestLatency: () => {}, onChooseOutbound: () => {}, + latencyFetching: false, }), ), ], diff --git a/fe-app-podkop/src/podkop/tabs/diagnostic/index.ts b/fe-app-podkop/src/podkop/tabs/diagnostic/index.ts new file mode 100644 index 0000000..01db02e --- /dev/null +++ b/fe-app-podkop/src/podkop/tabs/diagnostic/index.ts @@ -0,0 +1,2 @@ +export * from './renderDiagnostic'; +export * from './initDiagnosticController'; diff --git a/fe-app-podkop/src/podkop/tabs/diagnostic/initDiagnosticController.ts b/fe-app-podkop/src/podkop/tabs/diagnostic/initDiagnosticController.ts new file mode 100644 index 0000000..e1e82e2 --- /dev/null +++ b/fe-app-podkop/src/podkop/tabs/diagnostic/initDiagnosticController.ts @@ -0,0 +1,7 @@ +import { onMount } from '../../../helpers'; + +export async function initDiagnosticController(): Promise { + onMount('diagnostic-status').then(() => { + console.log('diagnostic controller initialized.'); + }); +} diff --git a/fe-app-podkop/src/podkop/tabs/diagnostic/renderDiagnostic.ts b/fe-app-podkop/src/podkop/tabs/diagnostic/renderDiagnostic.ts new file mode 100644 index 0000000..5e8f7fc --- /dev/null +++ b/fe-app-podkop/src/podkop/tabs/diagnostic/renderDiagnostic.ts @@ -0,0 +1,10 @@ +export function renderDiagnostic() { + return E( + 'div', + { + id: 'diagnostic-status', + class: 'pdk_diagnostic-page', + }, + 'Not implemented yet', + ); +} diff --git a/fe-app-podkop/src/podkop/tabs/index.ts b/fe-app-podkop/src/podkop/tabs/index.ts index b58b6c9..b49ac00 100644 --- a/fe-app-podkop/src/podkop/tabs/index.ts +++ b/fe-app-podkop/src/podkop/tabs/index.ts @@ -1 +1,2 @@ export * from './dashboard'; +export * from './diagnostic'; diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnostic.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnostic.js new file mode 100644 index 0000000..e94cae0 --- /dev/null +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnostic.js @@ -0,0 +1,22 @@ +'use strict'; +'require baseclass'; +'require form'; +'require ui'; +'require uci'; +'require fs'; +'require view.podkop.main as main'; + +function createDiagnosticContent(section) { + const o = section.option(form.DummyValue, '_mount_node'); + o.rawhtml = true; + o.cfgvalue = () => { + main.initDiagnosticController(); + return main.renderDiagnostic(); + }; +} + +const EntryPoint = { + createDiagnosticContent, +}; + +return baseclass.extend(EntryPoint); 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 b173c39..8f7e7b7 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 @@ -1503,7 +1503,8 @@ function renderDashboard() { onTestLatency: () => { }, onChooseOutbound: () => { - } + }, + latencyFetching: false }) ) ] @@ -1971,6 +1972,25 @@ async function initDashboardController() { connectToClashSockets(); }); } + +// src/podkop/tabs/diagnostic/renderDiagnostic.ts +function renderDiagnostic() { + return E( + "div", + { + id: "diagnostic-status", + class: "pdk_diagnostic-page" + }, + "Not implemented yet" + ); +} + +// src/podkop/tabs/diagnostic/initDiagnosticController.ts +async function initDiagnosticController() { + onMount("diagnostic-status").then(() => { + console.log("diagnostic controller initialized."); + }); +} return baseclass.extend({ ALLOWED_WITH_RUSSIA_INSIDE, BOOTSTRAP_DNS_SERVER_OPTIONS, @@ -2010,6 +2030,7 @@ return baseclass.extend({ getProxyUrlName, getSingboxStatus, initDashboardController, + initDiagnosticController, injectGlobalStyles, maskIP, onMount, @@ -2017,6 +2038,7 @@ return baseclass.extend({ parseValueList, preserveScrollForPage, renderDashboard, + renderDiagnostic, splitProxyString, triggerLatencyGroupTest, triggerLatencyProxyTest, diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js index 5cc6b4c..c1656bb 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js @@ -14,6 +14,9 @@ // Dashboard content 'require view.podkop.dashboard as dashboard'; +// Diagnostic content +'require view.podkop.diagnostic as diagnostic'; + const EntryPoint = { async render() { @@ -43,11 +46,19 @@ const EntryPoint = { settings.createSettingsContent(settingsSection); + // Diagnostic tab + const diagnosticSection = podkopMap.section(form.TypedSection, 'diagnostic', _('Diagnostics')); + diagnosticSection.anonymous = true; + diagnosticSection.addremove = false; + diagnosticSection.cfgsections = function () { return ['diagnostic']; }; + + // Render diagnostic content + diagnostic.createDiagnosticContent(diagnosticSection); + // Dashboard tab const dashboardSection = podkopMap.section(form.TypedSection, 'dashboard', _('Dashboard')); dashboardSection.anonymous = true; dashboardSection.addremove = false; - // dashboardSection.title = ''; dashboardSection.cfgsections = function () { return ['dashboard']; }; // Render dashboard content