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 e2a8a26..030d4fb 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 @@ -620,27 +620,6 @@ const ButtonFactory = { onClick: () => showConfigModal(config.command, config.title), style: config.style }); - }, - - createSystemButton: function (config) { - return this.createButton({ - label: config.label, - additionalClass: `cbi-button-${config.type || ''}`, - onClick: () => { - try { - const result = config.systemFunction(); - if (config.successMessage) { - ui.addNotification(null, E('p', {}, _(config.successMessage))); - } - return result; - } catch (e) { - if (config.errorMessage) { - ui.addNotification(null, E('p', {}, _(config.errorMessage) + ': ' + e.message)); - } - } - }, - style: config.style - }); } }; @@ -774,13 +753,7 @@ let createStatusSection = function (podkopStatus, singboxStatus, podkop, luci, s E('strong', {}, _('Sing-box: ')), singbox.stdout ? singbox.stdout.trim() : _('Unknown'), '\n', E('strong', {}, _('OpenWrt Version: ')), system.stdout ? system.stdout.split('\n')[1].trim() : _('Unknown'), '\n', E('strong', {}, _('Device Model: ')), system.stdout ? system.stdout.split('\n')[4].trim() : _('Unknown') - ]), - ButtonFactory.createSystemButton({ - label: _('Flush Cache'), - systemFunction: () => ui.menu.flushCache(), - successMessage: _('Cache has been flushed successfully!'), - errorMessage: _('Failed to flush cache') - }) + ]) ]) ]) ]);