fix: add enable/disable button for Podkop service

This commit is contained in:
Ivan K
2025-02-21 17:38:57 +03:00
parent 1a6ee45612
commit febb69d0be

View File

@@ -587,6 +587,10 @@ return view.extend({
'class': 'btn cbi-button-apply', 'class': 'btn cbi-button-apply',
'click': () => fs.exec('/etc/init.d/podkop', ['restart']).then(() => location.reload()) 'click': () => fs.exec('/etc/init.d/podkop', ['restart']).then(() => location.reload())
}, _('Restart Podkop')), }, _('Restart Podkop')),
E('button', {
'class': 'btn cbi-button-' + (podkopStatus.enabled ? 'remove' : 'apply'),
'click': () => fs.exec('/etc/init.d/podkop', [podkopStatus.enabled ? 'disable' : 'enable']).then(() => location.reload())
}, podkopStatus.enabled ? _('Disable Podkop') : _('Enable Podkop')),
E('button', { E('button', {
'class': 'btn', 'class': 'btn',
'click': () => fs.exec('/etc/init.d/podkop', ['show_config']).then(res => { 'click': () => fs.exec('/etc/init.d/podkop', ['show_config']).then(res => {