From 96bcc36cf16fc507c21ccc72dad9ade8f1f0aad5 Mon Sep 17 00:00:00 2001 From: divocat Date: Fri, 3 Oct 2025 04:15:41 +0300 Subject: [PATCH] refactor: remove unused variables --- .../resources/view/podkop/configSection.js | 2 +- .../resources/view/podkop/diagnosticTab.js | 27 ------------------- .../resources/view/podkop/podkop.js | 22 ++++++++------- 3 files changed, 13 insertions(+), 38 deletions(-) diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js index e3af1b9..0d5862b 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/configSection.js @@ -7,7 +7,7 @@ 'require tools.widgets as widgets'; -function createConfigSection(section, map, network) { +function createConfigSection(section) { const s = section; let o = s.tab('basic', _('Basic Settings')); diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js index a316a15..1768b43 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/diagnosticTab.js @@ -251,33 +251,6 @@ async function checkBypass() { } } -// Modal Functions -function createModalContent(title, content) { - return [ - E('div', { - 'class': 'panel-body', - style: 'max-height: 70vh; overflow-y: auto; margin: 1em 0; padding: 1.5em; ' + - 'font-family: monospace; white-space: pre-wrap; word-wrap: break-word; ' + - 'line-height: 1.5; font-size: 14px;' - }, [ - E('pre', { style: 'margin: 0;' }, content) - ]), - E('div', { - 'class': 'right', - style: 'margin-top: 1em;' - }, [ - E('button', { - 'class': 'btn', - 'click': ev => copyToClipboard('```txt\n' + content + '\n```', ev.target) - }, _('Copy to Clipboard')), - E('button', { - 'class': 'btn', - 'click': ui.hideModal - }, _('Close')) - ]) - ]; -} - function showConfigModal(command, title) { // Create and show modal immediately with loading state const modalContent = E('div', { 'class': 'panel-body' }, [ 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 64ba228..0b1e6c6 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 @@ -8,23 +8,23 @@ 'require view.podkop.utils as utils'; 'require view.podkop.main as main'; -return view.extend({ +const EntryNode = { async render() { main.injectGlobalStyles(); - const m = new form.Map('podkop', '', null, ['main', 'extra']); + const podkopFormMap = new form.Map('podkop', '', null, ['main', 'extra']); // Main Section - const mainSection = m.section(form.TypedSection, 'main'); + const mainSection = podkopFormMap.section(form.TypedSection, 'main'); mainSection.anonymous = true; - configSection.createConfigSection(mainSection, m, network); + configSection.createConfigSection(mainSection); // Additional Settings Tab (main section) - additionalTab.createAdditionalSection(mainSection, network); + additionalTab.createAdditionalSection(mainSection); // Diagnostics Tab (main section) diagnosticTab.createDiagnosticsSection(mainSection); - const map_promise = m.render().then(node => { + const podkopFormMapPromise = podkopFormMap.render().then(node => { // Set up diagnostics event handlers diagnosticTab.setupDiagnosticsEventHandlers(node); @@ -56,13 +56,15 @@ return view.extend({ }); // Extra Section - const extraSection = m.section(form.TypedSection, 'extra', _('Extra configurations')); + const extraSection = podkopFormMap.section(form.TypedSection, 'extra', _('Extra configurations')); extraSection.anonymous = false; extraSection.addremove = true; extraSection.addbtntitle = _('Add Section'); extraSection.multiple = true; - configSection.createConfigSection(extraSection, m, network); + configSection.createConfigSection(extraSection); - return map_promise; + return podkopFormMapPromise; } -}); +} + +return view.extend(EntryNode);