mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-09 13:06:52 +03:00
fix: remove unused button creation code
This commit is contained in:
@@ -620,27 +620,6 @@ const ButtonFactory = {
|
|||||||
onClick: () => showConfigModal(config.command, config.title),
|
onClick: () => showConfigModal(config.command, config.title),
|
||||||
style: config.style
|
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', {}, _('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', {}, _('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')
|
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')
|
|
||||||
})
|
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user