Merge pull request #64 from itdoginfo/chore/fakeip-method
fix: fix enable/disable functionality to podkop service
This commit is contained in:
@@ -614,6 +614,16 @@ const ButtonFactory = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
createInitActionButton: function (config) {
|
||||||
|
return this.createButton({
|
||||||
|
label: config.label,
|
||||||
|
additionalClass: `cbi-button-${config.type || ''}`,
|
||||||
|
onClick: () => safeExec('/etc/init.d/podkop', [config.action])
|
||||||
|
.then(() => config.reload && location.reload()),
|
||||||
|
style: config.style
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
createModalButton: function (config) {
|
createModalButton: function (config) {
|
||||||
return this.createButton({
|
return this.createButton({
|
||||||
label: config.label,
|
label: config.label,
|
||||||
@@ -656,26 +666,19 @@ let createStatusSection = function (podkopStatus, singboxStatus, podkop, luci, s
|
|||||||
E('div', { 'class': 'table', style: 'display: flex; gap: 20px;' }, [
|
E('div', { 'class': 'table', style: 'display: flex; gap: 20px;' }, [
|
||||||
// Podkop Status Panel
|
// Podkop Status Panel
|
||||||
createStatusPanel('Podkop Status', podkopStatus, [
|
createStatusPanel('Podkop Status', podkopStatus, [
|
||||||
podkopStatus.running ?
|
ButtonFactory.createActionButton({
|
||||||
ButtonFactory.createActionButton({
|
label: podkopStatus.running ? 'Stop Podkop' : 'Start Podkop',
|
||||||
label: 'Stop Podkop',
|
type: podkopStatus.running ? 'remove' : 'apply',
|
||||||
type: 'remove',
|
action: podkopStatus.running ? 'stop' : 'start',
|
||||||
action: 'stop',
|
reload: true
|
||||||
reload: true
|
}),
|
||||||
}) :
|
|
||||||
ButtonFactory.createActionButton({
|
|
||||||
label: 'Start Podkop',
|
|
||||||
type: 'apply',
|
|
||||||
action: 'start',
|
|
||||||
reload: true
|
|
||||||
}),
|
|
||||||
ButtonFactory.createActionButton({
|
ButtonFactory.createActionButton({
|
||||||
label: 'Restart Podkop',
|
label: 'Restart Podkop',
|
||||||
type: 'apply',
|
type: 'apply',
|
||||||
action: 'restart',
|
action: 'restart',
|
||||||
reload: true
|
reload: true
|
||||||
}),
|
}),
|
||||||
ButtonFactory.createActionButton({
|
ButtonFactory.createInitActionButton({
|
||||||
label: podkopStatus.enabled ? 'Disable Podkop' : 'Enable Podkop',
|
label: podkopStatus.enabled ? 'Disable Podkop' : 'Enable Podkop',
|
||||||
type: podkopStatus.enabled ? 'remove' : 'apply',
|
type: podkopStatus.enabled ? 'remove' : 'apply',
|
||||||
action: podkopStatus.enabled ? 'disable' : 'enable',
|
action: podkopStatus.enabled ? 'disable' : 'enable',
|
||||||
|
|||||||
@@ -746,4 +746,7 @@ msgid "not works in browser"
|
|||||||
msgstr "не работает в браузере"
|
msgstr "не работает в браузере"
|
||||||
|
|
||||||
msgid "not works on router"
|
msgid "not works on router"
|
||||||
msgstr "не работает на роутере"
|
msgstr "не работает на роутере"
|
||||||
|
|
||||||
|
msgid "Diagnostics"
|
||||||
|
msgstr "Диагностика"
|
||||||
@@ -1100,4 +1100,7 @@ msgid "not works in browser"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
msgid "not works on router"
|
msgid "not works on router"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "Diagnostics"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
Reference in New Issue
Block a user