mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-07 12:06:56 +03:00
feat: init diagnostic tab
This commit is contained in:
@@ -47,6 +47,7 @@ export function renderDashboard() {
|
|||||||
},
|
},
|
||||||
onTestLatency: () => {},
|
onTestLatency: () => {},
|
||||||
onChooseOutbound: () => {},
|
onChooseOutbound: () => {},
|
||||||
|
latencyFetching: false,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
2
fe-app-podkop/src/podkop/tabs/diagnostic/index.ts
Normal file
2
fe-app-podkop/src/podkop/tabs/diagnostic/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './renderDiagnostic';
|
||||||
|
export * from './initDiagnosticController';
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { onMount } from '../../../helpers';
|
||||||
|
|
||||||
|
export async function initDiagnosticController(): Promise<void> {
|
||||||
|
onMount('diagnostic-status').then(() => {
|
||||||
|
console.log('diagnostic controller initialized.');
|
||||||
|
});
|
||||||
|
}
|
||||||
10
fe-app-podkop/src/podkop/tabs/diagnostic/renderDiagnostic.ts
Normal file
10
fe-app-podkop/src/podkop/tabs/diagnostic/renderDiagnostic.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
export function renderDiagnostic() {
|
||||||
|
return E(
|
||||||
|
'div',
|
||||||
|
{
|
||||||
|
id: 'diagnostic-status',
|
||||||
|
class: 'pdk_diagnostic-page',
|
||||||
|
},
|
||||||
|
'Not implemented yet',
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1 +1,2 @@
|
|||||||
export * from './dashboard';
|
export * from './dashboard';
|
||||||
|
export * from './diagnostic';
|
||||||
|
|||||||
@@ -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);
|
||||||
@@ -1503,7 +1503,8 @@ function renderDashboard() {
|
|||||||
onTestLatency: () => {
|
onTestLatency: () => {
|
||||||
},
|
},
|
||||||
onChooseOutbound: () => {
|
onChooseOutbound: () => {
|
||||||
}
|
},
|
||||||
|
latencyFetching: false
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
@@ -1971,6 +1972,25 @@ async function initDashboardController() {
|
|||||||
connectToClashSockets();
|
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({
|
return baseclass.extend({
|
||||||
ALLOWED_WITH_RUSSIA_INSIDE,
|
ALLOWED_WITH_RUSSIA_INSIDE,
|
||||||
BOOTSTRAP_DNS_SERVER_OPTIONS,
|
BOOTSTRAP_DNS_SERVER_OPTIONS,
|
||||||
@@ -2010,6 +2030,7 @@ return baseclass.extend({
|
|||||||
getProxyUrlName,
|
getProxyUrlName,
|
||||||
getSingboxStatus,
|
getSingboxStatus,
|
||||||
initDashboardController,
|
initDashboardController,
|
||||||
|
initDiagnosticController,
|
||||||
injectGlobalStyles,
|
injectGlobalStyles,
|
||||||
maskIP,
|
maskIP,
|
||||||
onMount,
|
onMount,
|
||||||
@@ -2017,6 +2038,7 @@ return baseclass.extend({
|
|||||||
parseValueList,
|
parseValueList,
|
||||||
preserveScrollForPage,
|
preserveScrollForPage,
|
||||||
renderDashboard,
|
renderDashboard,
|
||||||
|
renderDiagnostic,
|
||||||
splitProxyString,
|
splitProxyString,
|
||||||
triggerLatencyGroupTest,
|
triggerLatencyGroupTest,
|
||||||
triggerLatencyProxyTest,
|
triggerLatencyProxyTest,
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
// Dashboard content
|
// Dashboard content
|
||||||
'require view.podkop.dashboard as dashboard';
|
'require view.podkop.dashboard as dashboard';
|
||||||
|
|
||||||
|
// Diagnostic content
|
||||||
|
'require view.podkop.diagnostic as diagnostic';
|
||||||
|
|
||||||
|
|
||||||
const EntryPoint = {
|
const EntryPoint = {
|
||||||
async render() {
|
async render() {
|
||||||
@@ -43,11 +46,19 @@ const EntryPoint = {
|
|||||||
settings.createSettingsContent(settingsSection);
|
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
|
// Dashboard tab
|
||||||
const dashboardSection = podkopMap.section(form.TypedSection, 'dashboard', _('Dashboard'));
|
const dashboardSection = podkopMap.section(form.TypedSection, 'dashboard', _('Dashboard'));
|
||||||
dashboardSection.anonymous = true;
|
dashboardSection.anonymous = true;
|
||||||
dashboardSection.addremove = false;
|
dashboardSection.addremove = false;
|
||||||
// dashboardSection.title = '';
|
|
||||||
dashboardSection.cfgsections = function () { return ['dashboard']; };
|
dashboardSection.cfgsections = function () { return ['dashboard']; };
|
||||||
|
|
||||||
// Render dashboard content
|
// Render dashboard content
|
||||||
|
|||||||
Reference in New Issue
Block a user