mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 12:55:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
Executable
+12
@@ -0,0 +1,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-pingcontrol
|
||||
LUCI_DEPENDS:=+pingcontrol
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI network interface control
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
@@ -0,0 +1,84 @@
|
||||
'use strict';
|
||||
'require form';
|
||||
'require view';
|
||||
'require uci';
|
||||
'require rpc';
|
||||
'require tools.widgets as widgets';
|
||||
|
||||
return view.extend({
|
||||
handleEnableService: rpc.declare({
|
||||
object: 'luci',
|
||||
method: 'setInitAction',
|
||||
params: [ 'pingcontrol', 'enable' ],
|
||||
expect: { result: false }
|
||||
}),
|
||||
|
||||
render: function() {
|
||||
var m, s, o;
|
||||
|
||||
m = new form.Map('pingcontrol', _('PingControl'));
|
||||
m.description = _('Server availability check');
|
||||
|
||||
s = m.section(form.GridSection, 'pingcontrol', _('Settings'));
|
||||
s.tab('general', _('General Settings'));
|
||||
s.tab('commands', _('Commands'));
|
||||
s.addremove = true;
|
||||
s.nodescriptions = true;
|
||||
|
||||
o = s.taboption('general',form.Flag, 'enabled', _('Enabled'));
|
||||
o.rmempty = false;
|
||||
o.write = L.bind(function(section, value) {
|
||||
if (value == '1') {
|
||||
this.handleEnableService();
|
||||
}
|
||||
return uci.set('pingcontrol', section, 'enabled', value);
|
||||
}, this);
|
||||
|
||||
o = s.taboption('general',widgets.NetworkSelect, 'iface', _('Ping interface'));
|
||||
o.rmempty = false;
|
||||
o.textvalue = function(section_id) {
|
||||
return uci.get('pingcontrol', section_id, 'iface');
|
||||
}
|
||||
|
||||
o = s.taboption('general',form.DynamicList, 'testip', _('IP address or hostname of test servers'));
|
||||
o.datatype = 'or(hostname,ipaddr("nomask"))';
|
||||
|
||||
o = s.taboption('general',form.Flag, 'ping_silent', _('Silent mode'), _('Do not log success ping'));
|
||||
|
||||
|
||||
o = s.taboption('general',form.Value, 'check_period', _('Period of check, sec'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'and(uinteger,min(20))';
|
||||
o.default = '60';
|
||||
|
||||
o = s.taboption('general',form.Value, 'sw_before_modres', _('Failed attempts before iface up/down'), _('0 - not used'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'and(uinteger,min(0),max(100))';
|
||||
o.default = '3';
|
||||
|
||||
o = s.taboption('general',form.Value, 'sw_before_sysres', _('Failed attempts before reboot'), _('0 - not used'));
|
||||
o.rmempty = false;
|
||||
o.datatype = 'and(uinteger,min(0),max(100))';
|
||||
o.default = '0';
|
||||
|
||||
o = s.taboption('commands',form.Value, 'ping_ok', _('Successful ping'));
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.taboption('commands',form.Value, 'ping_lost', _('Ping lost'));
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.taboption('commands',form.Value, 'ping_restored', _('Ping restored'));
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.taboption('commands',form.Value, 'before_iface_down', _('Before interface down'));
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.taboption('commands',form.Value, 'after_iface_up', _('After interface up'));
|
||||
o.modalonly = true;
|
||||
|
||||
o = s.taboption('commands',form.Value, 'before_reboot', _('Before reboot'));
|
||||
o.modalonly = true;
|
||||
|
||||
return m.render();
|
||||
}
|
||||
});
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
msgid "Server availability check"
|
||||
msgstr "Server availability check"
|
||||
|
||||
msgid "Period of check, sec"
|
||||
msgstr "Period of check, sec"
|
||||
|
||||
msgid "Ping interface"
|
||||
msgstr "Ping interface"
|
||||
|
||||
msgid "IP address or hostname of test servers"
|
||||
msgstr "IP address or hostname of test servers"
|
||||
|
||||
msgid "Failed attempts before iface up/down"
|
||||
msgstr "Failed attempts before iface up/down"
|
||||
|
||||
msgid "Failed attempts before reboot"
|
||||
msgstr "Failed attempts before reboot"
|
||||
|
||||
msgid "Configuration name"
|
||||
msgstr "Configuration name"
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
msgid "Server availability check"
|
||||
msgstr "Проверка доступности сервера"
|
||||
|
||||
msgid "Period of check, sec"
|
||||
msgstr "Период проверки, сек"
|
||||
|
||||
msgid "Ping interface"
|
||||
msgstr "Интерфейс для ping-запросов"
|
||||
|
||||
msgid "IP address or hostname of test servers"
|
||||
msgstr "IP-адрес или имя хоста тестовых серверов"
|
||||
|
||||
msgid "Silent mode"
|
||||
msgstr "Тихий режим"
|
||||
|
||||
msgid "Do not log success ping"
|
||||
msgstr "Не журналировать успешные попытки"
|
||||
|
||||
msgid "Failed attempts before iface up/down"
|
||||
msgstr "Количество неудачных попыток до переподключения интерфейса"
|
||||
|
||||
msgid "Failed attempts before reboot"
|
||||
msgstr "Количество неудачных попыток до перезагрузки устройства"
|
||||
|
||||
msgid "Configuration name"
|
||||
msgstr "Имя конфигурации"
|
||||
|
||||
msgid "Commands"
|
||||
msgstr "Команды"
|
||||
|
||||
msgid "Successful ping"
|
||||
msgstr "Пинг успешен"
|
||||
|
||||
msgid "Ping lost"
|
||||
msgstr "Пинг потерян"
|
||||
|
||||
msgid "Ping restored"
|
||||
msgstr "Пинг восстановлен"
|
||||
|
||||
msgid "Before interface down"
|
||||
msgstr "Перед отключением интерфейса"
|
||||
|
||||
msgid "After interface up"
|
||||
msgstr "После включения интерфейса"
|
||||
|
||||
msgid "Before reboot"
|
||||
msgstr "Перед перезагрузкой"
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"admin/services/pingcontrol": {
|
||||
"title": "Pingcontrol",
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "pingcontrol/pingcontrol"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-pingcontrol" ],
|
||||
"uci": { "pingcontrol": true }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-pingcontrol": {
|
||||
"description": "Grant UCI access for luci-app-pingcontrol",
|
||||
"read": {
|
||||
"uci": [ "pingcontrol" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "pingcontrol" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user