🎄 Sync 2026-04-23 03:14:31

This commit is contained in:
github-actions[bot] 2026-04-23 03:14:31 +08:00
parent a011aeb96f
commit 263d407c11
97 changed files with 4710 additions and 1 deletions

13
luci-app-hotplug/Makefile Normal file
View File

@ -0,0 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-hotplug
LUCI_TITLE:=LuCI interface for hotplug configuration
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
PKG_VERSION:=1.0
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,47 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('hotplug', _('Interface Rules'));
m.description = _('Running commands when the hotplug trigger occurs. <br/><br/>ACTION - ifdown, ifup, ifup-failed, ifupdate, free, reload, iflink, create <br/>INTERFACE - Name of the logical interface which went up or down (e.g. wan or lan) <br/>DEVICE - Name of the physical device which went up or down (e.g. eth0 or br-lan or pppoe-wan), when applicable <br/><br/>More information about iface events and variables here: <a href=\"https://openwrt.org/docs/guide-user/base-system/hotplug#iface\">hotplug#iface</a>');
s = m.section(form.GridSection, 'iface');
s.addremove = true;
s.nodescriptions = true;
o = s.option(form.TextValue, 'description', _('Description'));
o = s.option(form.Flag, 'enabled', _('Activate'));
o.rmempty = false;
o.editable = true;
o = s.option(form.ListValue, 'action', _('Variable $ACTION'), _('The type of event that will trigger the command'));
o.default = "ifup";
o.value("ifup", _("iface up (ifup)"));
o.value("ifdown", _("iface down (ifdown)"));
o.value("ifup-failed", _("iface up failed (ifup-failed)"));
o.value("ifupdate", _("iface changed (ifupdate)"));
o.value("free", _("iface removed (free)"));
o.value("reload", _("iface reload (reload)"));
o.value("iflink", _("Iface received link (iflink)"));
o.value("create", _("iface created (create)"));
o = s.option(widgets.NetworkSelect, 'interface', _('Variable $INTERFACE'), _('The name of the logical interface to which the command will be applied'));
o.default = "internet";
o.rmempty = false;
o.textvalue = function(section_id) {
return uci.get('hotplug', section_id, 'interface');
}
o = s.option(form.DynamicList, 'command', _('Command to execute'));
return m.render();
}
});

View File

@ -0,0 +1,59 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('hotplug', _('Network Rules'));
m.description = _('Running commands when the hotplug trigger occurs. <br/>\
<br/>\
ACTION - "add" or "remove" noted <br/>\
DEVICENAME - configured interface names (br-lan, wlan0, phy1-ap0) <br/>\
PATH - full path<br/>\
DEVPATH - full device path (for example /devices/pci0000:00/0000:00:0b.0/usb1/1-1/1-1:1.0/host7/target7:0:0/7:0:0:0/block/sdc/sdc1)<br/>\
DEVTYPE - what the DEVICENAME are names of, ie. br-lan, phy1-ap0 <br/ >\
INTERFACE - configured interfaces as in DEVTYPE <br/>\
SEQNUM - seqnum (a number) <br/>\
SUBSYSTEM - always = net <br/>\
IFINDEX - appears to be related to the configured interfaces. See ifconfig <br/>\
More information about net event here: <a href="https://openwrt.org/docs/guide-user/base-system/hotplug#net">hotplug#net</a>');
s = m.section(form.GridSection, 'hotplug');
s.addremove = true;
s.nodescriptions = true;
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.rmempty = false;
o = s.option(widgets.NetworkSelect, 'iface', _('Ping interface'));
o.rmempty = false;
o.textvalue = function(section_id) {
return uci.get('hotplug', section_id, 'iface');
}
o = s.option(form.DynamicList, 'testip', _('IP address or hostname of test servers'));
o.datatype = 'or(hostname,ipaddr("nomask"))';
o = s.option(form.Value, 'check_period', _('Period of check, sec'));
o.rmempty = false;
o.datatype = 'and(uinteger,min(20))';
o.default = '60';
o = s.option(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.option(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';
return m.render();
}
});

View File

@ -0,0 +1,29 @@
msgid "Hotplug Rules"
msgstr "Hotplug Rules"
msgid "Interface Rules"
msgstr "Interface Rules"
msgid "Description"
msgstr "Description"
msgid "Activate"
msgstr "Activate"
msgid "Variable $ACTION"
msgstr "Variable $ACTION"
msgid "The type of event that will trigger the command"
msgstr "The type of event that will trigger the command"
msgid "Variable $INTERFACE"
msgstr "Variable $INTERFACE"
msgid "The name of the logical interface to which the command will be applied"
msgstr "The name of the logical interface to which the command will be applied"
msgid "Command to execute"
msgstr "Command to execute"
msgid "Running commands when the hotplug trigger occurs. <br/><br/>ACTION - ifdown, ifup, ifup-failed, ifupdate, free, reload, iflink, create <br/>INTERFACE - Name of the logical interface which went up or down (e.g. wan or lan) <br/>DEVICE - Name of the physical device which went up or down (e.g. eth0 or br-lan or pppoe-wan), when applicable <br/><br/>More information about iface events and variables here: <a href=\"https://openwrt.org/docs/guide-user/base-system/hotplug#iface\">hotplug#iface</a>"
msgstr "Running commands when the hotplug trigger occurs. <br/><br/>ACTION - ifdown, ifup, ifup-failed, ifupdate, free, reload, iflink, create <br/>INTERFACE - Name of the logical interface which went up or down (e.g. wan or lan) <br/>DEVICE - Name of the physical device which went up or down (e.g. eth0 or br-lan or pppoe-wan), when applicable <br/><br/>More information about iface events and variables here: <a href=\"https://openwrt.org/docs/guide-user/base-system/hotplug#iface\">hotplug#iface</a>"

View File

@ -0,0 +1,29 @@
msgid "Hotplug Rules"
msgstr "Автоматизация (Hotplug)"
msgid "Interface Rules"
msgstr "Правила для интерфейсов"
msgid "Description"
msgstr "Описание"
msgid "Activate"
msgstr "Активировать"
msgid "Variable $ACTION"
msgstr "Переменная $ACTION"
msgid "The type of event that will trigger the command"
msgstr "Тип события, при котором будет выполнена команда"
msgid "Variable $INTERFACE"
msgstr "Переменная $INTERFACE"
msgid "The name of the logical interface to which the command will be applied"
msgstr "Имя логического интерфейса, к которому будет применимо правило"
msgid "Command to execute"
msgstr "Команда для выполнения"
msgid "Running commands when the hotplug trigger occurs. <br/><br/>ACTION - ifdown, ifup, ifup-failed, ifupdate, free, reload, iflink, create <br/>INTERFACE - Name of the logical interface which went up or down (e.g. wan or lan) <br/>DEVICE - Name of the physical device which went up or down (e.g. eth0 or br-lan or pppoe-wan), when applicable <br/><br/>More information about iface events and variables here: <a href=\"https://openwrt.org/docs/guide-user/base-system/hotplug#iface\">hotplug#iface</a>"
msgstr "Выполнение команд при срабатывании триггера hotplug. <br/><br/>ACTION - ifdown, ifup, ifup-failed, ifupdate, free, reload, iflink, create <br/>INTERFACE - имя логического интерфейса, который был активирован или деактивирован (например, wan или lan) <br/>DEVICE - имя физического устройства, которое было активировано или деактивировано (например, eth0, br-lan или pppoe-wan), если применимо <br/><br/>Подробнее о событиях интерфейсов и переменных: <a href=\"https://openwrt.org/docs/guide-user/base-system/hotplug#iface\">hotplug#iface</a>"

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-hotplug.json" ] && {
cat > /usr/share/ucitrack/luci-app-hotplug.json << EEOF
{
"config": "hotplug",
"init": "hotplug"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@hotplug[-1]
add ucitrack hotplug
set ucitrack.@hotplug[-1].init=hotplug
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,23 @@
{
"admin/services/hotplug": {
"title": "Hotplug Rules",
"order": 25,
"action": {
"type": "alias",
"path": "admin/services/hotplug/iface"
},
"depends": {
"acl": [ "luci-app-hotplug" ],
"uci": { "hotplug": true }
}
},
"admin/services/hotplug/iface": {
"title": "iface",
"order": 20,
"action": {
"type": "view",
"path": "hotplug/iface"
}
}
}

View File

@ -0,0 +1,11 @@
{
"luci-app-hotplug": {
"description": "Grant UCI access for luci-app-hotplug",
"read": {
"uci": [ "hotplug" ]
},
"write": {
"uci": [ "hotplug" ]
}
}
}

13
luci-app-iolines/Makefile Normal file
View File

@ -0,0 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-iolines
LUCI_TITLE:=LuCI I/O switcher
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
PKG_VERSION:=0.2.3
PKG_RELEASE:=1
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,68 @@
'use strict';
'require rpc';
'require uci';
'require ui';
'require view';
'require form';
'require poll';
var adcRequestAll = rpc.declare({
object: 'iolines',
method: 'voltage',
params: [ 'adc' ],
expect: { '': {} }
});
var DummyValueExt = form.DummyValue.extend({
renderWidget: function(section_id, option_index, cfgvalue) {
return E([], [
E('div', {
'class': 'cbi-value-field',
'id': this.cbid(uci.get('iolines', section_id, 'dev')),
'style': 'color:#c73d3d;margin-left:0'
})
]);
}
});
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('iolines', _('Universal I/O lines'));
m.description = _('ADC input: voltage measurement.<br />Dry contact input: when turned on, the analog input of the router is connected to +5V voltage via a pull-up resistor. The pull-up is required to ensure the correct operation of the dry contact input.<br />Open collector: open collector output is set into the active state.');
s = m.section(form.TableSection, 'io');
s.anonymous = true;
o = s.option(form.DummyValue, 'name', _('I/O port'));
o = s.option(form.ListValue, 'mode', _('Mode'));
o.default = "mode1";
o.value("mode1", _("ADC"));
o.value("mode2", _("Dry contact"));
o.value("mode3", _("Open collector (OC)"));
o = s.option(form.Flag, 'enabled', _('Save configuration before reboot'));
o = s.option(DummyValueExt, 'voltage', _('Measured voltage, mV'));
return m.render().then(function(mapEl) {
poll.add(function() {
return adcRequestAll("all").then(function(t) {
var sections = uci.sections('iolines','io');
for (var i = 0; i < sections.length; i++) {
var volt_num = 'voltage'+i;
document.getElementById('cbid.iolines.adc%s.voltage'.format(i)).textContent = t[volt_num] || 'n/a';
}
// document.getElementById('cbid.iolines.adc1.voltage').textContent = t.voltage1 || 'n/a';
// document.getElementById('cbid.iolines.adc2.voltage').textContent = t.voltage2 || 'n/a';
// document.getElementById('cbid.iolines.adc3.voltage').textContent = t.voltage3 || 'n/a';
// document.getElementById('cbid.iolines.adc4.voltage').textContent = t.voltage4 || 'n/a';
});
},1);
return mapEl;
});
}
});

View File

@ -0,0 +1,26 @@
msgid "ADC input: voltage measurement.<br />Dry contact input: when turned on, the analog input of the router is connected to +5V voltage via a pull-up resistor. The pull-up is required to ensure the correct operation of the dry contact input.<br />Open collector: open collector output is set into the active state."
msgstr "ADC input: voltage measurement.<br />Dry contact input: when turned on, the analog input of the router is connected to +5V voltage via a pull-up resistor. The pull-up is required to ensure the correct operation of the dry contact input.<br />Open collector: open collector output is set into the active state."
msgid "I/O port"
msgstr "I/O port"
msgid "Save configuration before reboot"
msgstr "Save configuration before reboot"
msgid "Measured voltage, mV"
msgstr "Measured voltage, mV"
msgid "Update measurements"
msgstr "Update measurements"
msgid "ADC"
msgstr "ADC"
msgid "Dry contact"
msgstr "Dry contact"
msgid "Open collector (OC)"
msgstr "Open collector (OC)"
msgid "Universal I/O lines"
msgstr "Universal I/O lines"

View File

@ -0,0 +1,26 @@
msgid "ADC input: voltage measurement.<br />Dry contact input: when turned on, the analog input of the router is connected to +5V voltage via a pull-up resistor. The pull-up is required to ensure the correct operation of the dry contact input.<br />Open collector: open collector output is set into the active state."
msgstr "АЦП: измерение напряжения.<br />Сухой контакт: При включении аналоговый вход роутера с помощью резистора подтягивается к напряжению 5В. Подтяжка необходима для правильного функционирования аналогового входа в режиме сухой контакт.<br />Открытый коллектор: устанавливается активный уровень на выходе открытый коллектор."
msgid "I/O port"
msgstr "I/O порт"
msgid "Save configuration before reboot"
msgstr "Сохранять настройки при загрузке"
msgid "Measured voltage, mV"
msgstr "Измеренное напряжение, mV"
msgid "Update measurements"
msgstr "Обновить замеры"
msgid "ADC"
msgstr "АЦП"
msgid "Dry contact"
msgstr "Сухой контакт"
msgid "Open collector (OC)"
msgstr "Открытый коллектор"
msgid "Universal I/O lines"
msgstr "Универсальные линии ввода-вывода"

View File

@ -0,0 +1,14 @@
{
"admin/services/iolines": {
"title": "I/O Lines",
"order": 20,
"action": {
"type": "view",
"path": "iolines/iolines"
},
"depends": {
"acl": [ "luci-app-iolines" ],
"uci": { "iolines": true }
}
}
}

View File

@ -0,0 +1,17 @@
{
"luci-app-iolines": {
"description": "Grant UCI access for luci-app-iolines",
"read": {
"uci": [ "iolines" ],
"ubus": {
"iolines": [ "voltage", "adc"]
}
},
"write": {
"uci": [ "iolines" ],
"ubus": {
"iolines": [ "voltage" ]
}
}
}
}

14
luci-app-pollmydevice/Makefile Executable file
View File

@ -0,0 +1,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-pollmydevice
LUCI_DEPENDS:= +pollmydevice
PKG_VERSION:=1.0
PKG_RELEASE:=1
LUCI_TITLE:=LuCI TCP to RS232 and RS485 Configuration Frontend
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,303 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require ui';
var consoleStatus = rpc.declare({
object: 'pollmydevice',
method: 'status',
expect: { '': {} }
});
var consoleDisable = rpc.declare({
object: 'pollmydevice',
method: 'con_off',
expect: { '': {} }
});
var consoleEnable = rpc.declare({
object: 'pollmydevice',
method: 'con_on',
expect: { '': {} }
});
var getID = rpc.declare({
object: 'pollmydevice',
method: 'get_id',
expect: { '': {} }
});
return view.extend({
load: function() {
return Promise.all([
consoleStatus(),
getID()
]);
},
render: function(rpc_replies) {
var status = rpc_replies[0];
var ids = rpc_replies[1];
var m, s, o;
m = new form.Map('pollmydevice', _('PollMyDevice'));
m.description = _('TCP to RS232/RS485 converter');
s = m.section(form.GridSection, 'interface');
s.tab('general', _('Mode Settings'));
s.tab('serial', _('Port Settings'));
s.addremove = true;
s.nodescriptions = true;
s.addbtntitle = _('Add new configuration...');
s.handleAdd = function(ev,name) {
for (var i = 0; i < 8; i++) {
var section = uci.get('pollmydevice', String(i));
if (section == null) {
var section_id = String(i);
uci.add('pollmydevice', 'interface', section_id);
uci.set('pollmydevice', section_id, 'desc',name);
uci.set('pollmydevice', section_id, 'devicename','/dev/com1');
uci.set('pollmydevice', section_id, 'baudrate','9600');
uci.set('pollmydevice', section_id, 'bytesize','8');
uci.set('pollmydevice', section_id, 'mode','disabled');
uci.set('pollmydevice', section_id, 'open_in_firewall','1')
uci.set('pollmydevice', section_id, 'server_port',String(30000+i))
this.addedSection = section_id;
return this.renderMoreOptionsModal(section_id);
};
};
ui.addNotification(null, E('p', 'Exceeded the maximum number of configurations.'), 'error');
};
o = s.taboption('general', form.Value, 'desc', _('Description'));
o.rmempty = false;
o.optional = false;
o.datatype = 'uciname';
o = s.taboption('serial', form.Value, 'devicename', _('Port'));
o.rmempty = false;
o.value('/dev/com0');
o.value('/dev/com1');
o.textvalue = function(section_id) {
return uci.get('pollmydevice', section_id, 'devicename');
}
o = s.taboption('general', form.ListValue, 'mode', _('Mode'));
o.default = 'disabled';
o.value('disabled',_('disabled'));
o.value('server',_('server'));
o.value('client',_('client'));
o = s.taboption('general', form.Flag, 'quiet',_('Disable log messages'));
o.default = 0;
o.modalonly = true;
o.depends({mode: 'server'});
o.depends({mode: 'client'});
o = s.taboption('general', form.Value, 'server_port', _('Listening port'), _('Network port used for data exchange with a configurable serial port'));
o.modalonly = true;
o.rmempty = false;
o.optional = false;
o.datatype = 'or(502,range(1025,65535))';
o.depends({mode: 'server'});
o = s.taboption('general', form.Flag, 'open_in_firewall', _("Open a port for incoming connections from the 'wan' zone"),_("A new rule for traffic in the firewall will be created, allowing connections to the specified network port from external networks. Access from the 'lan' zone is open by default for all network ports"))
o.modalonly = true;
o.depends({mode: 'server'});
o = s.taboption('general', form.ListValue, 'connection_mode', _('Connection Mode'));
o.modalonly = true;
o.default = 0;
o.value(0,_('Alternating'));
o.value(1,_('Simultaneous'));
o.depends({mode: 'server'});
o = s.taboption('general', form.Value, 'holdconntime', _('Connection Hold Time (sec)'));
o.default = 60;
o.datatype = 'and(uinteger, min(0), max(100000))'
o.depends({connection_mode: '0'});
o.modalonly = true;
o = s.taboption('general', form.Value, 'pack_size', _('Minimum packet size [0-255] (byte)'));
o.modalonly = true;
o.default = 0;
o.datatype = 'and(uinteger, min(0), max(255))';
o.depends({mode: 'server'});
o.depends({mode: 'client'});
o = s.taboption('general', form.Value, 'pack_timeout', _('Packet timeout [0-255] (x100ms)'));
o.modalonly = true;
o.default = 0;
o.datatype = 'and(uinteger, min(0), max(255))';
for(i=1;i<256;i++){
o.depends({pack_size: i.toString()});
}
o = s.taboption('general', form.Value, 'client_host', _('Server Host or IP Address'));
o.default = 'hub.m2m24.ru';
o.datatype = 'string';
o.depends({mode: 'client'});
o.textvalue = function(section_id) {
if(uci.get('pollmydevice', section_id, 'mode') === 'client') {
return uci.get('pollmydevice', section_id, 'client_host');
} else {
return '-'
}
};
o = s.taboption('general', form.DummyValue, 'port', _('Port'));
o.modalonly = false;
o.textvalue = function(section_id) {
if(uci.get('pollmydevice', section_id, 'client_port')) return uci.get('pollmydevice', section_id, 'client_port');
if(uci.get('pollmydevice', section_id, 'server_port')) return uci.get('pollmydevice', section_id, 'server_port');
}
o = s.taboption('general', form.Value, 'client_port', _('Server Port'));
o.modalonly = true;
o.rmempty = false;
o.optional = false;
o.default = 6008;
o.datatype = 'or(502,range(1025,65535))';
o.depends({mode: 'client'});
o = s.taboption('general', form.Value, 'client_timeout', _('Client Reconnection Timeout (sec)'));
o.modalonly = true;
o.default = 60;
o.datatype = 'and(uinteger, min(0), max(100000))';
o.depends({mode: 'client'});
o = s.taboption('general', form.ListValue, 'client_auth', _('Client Authentification'));
o.widget='radio';
o.default = 0;
o.value(0,_('Disable'));
o.value(1,_('Enable'));
o.depends({mode: 'client'});
o.textvalue = function(section_id) {
return this.cfgvalue(section_id)==1 ? 'enabled' : 'disabled';
};
o = s.taboption('general', form.DummyValue, 'client_id', _('Client ID'));
o.modalonly = true;
o.depends({mode: 'client'});
o.cfgvalue = function(section_id) {
return ids['id' + section_id];
};
o = s.taboption('general', form.ListValue, 'modbus_gateway', _('Modbus TCP/IP'));
o.default = 0
o.value(0,_('Disabled'));
o.value(1,_('RTU'));
o.value(2,_('ASCII'));
o.depends({mode: 'server'});
o.depends({client_auth: '0'});
o.textvalue = function(section_id) {
if(this.cfgvalue(section_id)==0) return 'disabled';
if(this.cfgvalue(section_id)==1) return 'RTU';
if(this.cfgvalue(section_id)==2) return 'ASCII';
};
o = s.taboption('general', form.DummyValue, 'console_status',_('Console status'));
o.modalonly = true;
o.depends({desc: 'console'});
o.cfgvalue = function(section_id) {
return _(status.status);
};
o = s.taboption('general', form.Button, 'switch',_('Console'),_('Save the changes. The router will reboot'));
o.modalonly = true;
o.inputstyle = 'action important';
o.inputtitle = _('On/Off');
o.depends({desc: 'console'});
o.onclick = L.bind(function(section_id) {
if (status.status == 'activated') {
consoleDisable().then(function(){
L.ui.showModal(_('Rebooting…'), [
E('p', { 'class': 'spinning' }, _('Waiting for device...'))
]);
window.setTimeout(function() {
L.ui.showModal(_('Rebooting…'), [
E('p', { 'class': 'spinning alert-message warning' },
_('Device unreachable! Still waiting for device...'))
]);
}, 150000);
L.ui.awaitReconnect();
})
} else {
consoleEnable().then(function(){
L.ui.showModal(_('Rebooting…'), [
E('p', { 'class': 'spinning' }, _('Waiting for device...'))
]);
window.setTimeout(function() {
L.ui.showModal(_('Rebooting…'), [
E('p', { 'class': 'spinning alert-message warning' },
_('Device unreachable! Still waiting for device...'))
]);
}, 150000);
L.ui.awaitReconnect();
})
}
},this)
o = s.taboption('serial', form.ListValue, 'baudrate', _('BaudRate'));
o.default = 9600;
o.value(300);
o.value(600);
o.value(1200);
o.value(2400);
o.value(4800);
o.value(9600);
o.value(19200);
o.value(38400);
o.value(57600);
o.value(115200);
o.value(230400);
o.value(460800);
o.value(921600);
o.datatype = 'uinteger';
o.modalonly = true;
o.depends({mode: 'disabled', '!reverse': true});
o = s.taboption('serial', form.ListValue, 'bytesize', _('ByteSize'));
o.default = 8;
o.value(5);
o.value(6);
o.value(7);
o.value(8);
o.datatype = 'uinteger';
o.modalonly = true;
o.depends({mode: 'disabled', '!reverse': true});
o = s.taboption('serial', form.ListValue, 'stopbits', _('StopBits'));
o.default = 1;
o.value(1);
o.value(2);
o.datatype = 'uinteger';
o.modalonly = true;
o.depends({mode: 'disabled', '!reverse': true});
o = s.taboption('serial', form.ListValue, 'parity', _('Parity'));
o.default = 'none';
o.value('even');
o.value('odd');
o.value('none');
o.datatype = 'string';
o.modalonly = true;
o.depends({mode: 'disabled', '!reverse': true});
o = s.taboption('serial', form.ListValue, 'flowcontrol', _('Flow Control'));
o.modalonly = true;
o.default = 'none';
o.value('XON/XOFF');
o.value('RTS/CTS');
o.value('none');
o.datatype = 'string';
o.depends({mode: 'disabled', '!reverse': true});
return m.render();
}
});

View File

@ -0,0 +1,86 @@
msgid ""
msgstr ""
msgid "simman"
msgstr "simman"
msgid "SIM manager for 3g modem"
msgstr "SIM manager for 3g modem"
msgid "General settings"
msgstr "General settings"
msgid "Main module options"
msgstr "Main module options"
msgid "Enable Simman"
msgstr "Enable Simman"
msgid "Number of failed attempts"
msgstr "Number of failed attempts"
msgid "Period of check, sec"
msgstr "Period of check, sec"
msgid "Return to priority SIM, sec"
msgstr "Return to priority SIM, sec"
msgid "AT modem device name"
msgstr "AT modem device name"
msgid "IP address of remote servers"
msgstr "IP address of remote servers"
msgid "SIM1 settings"
msgstr "SIM1 settings"
msgid "Priority"
msgstr "Priority"
msgid "APN"
msgstr "APN"
msgid "Pincode"
msgstr "Pincode"
msgid "User name"
msgstr "User name"
msgid "Password"
msgstr "Password"
msgid "SIM2 settings"
msgstr "SIM2 settings"
msgid "Disabled"
msgstr "Disabled"
msgid "Disable"
msgstr "Disable"
msgid "Enable"
msgstr "Enable"
msgid "New configuration (range [0-6]):"
msgstr "New configuration (range [0-6]):"
msgid "Connection Mode"
msgstr "Connection Mode"
msgid "Alternating"
msgstr "Alternating"
msgid "Simultaneous"
msgstr "Simultaneous"
msgid "Listening port"
msgstr "Listening port"
msgid "Open a port for incoming connections from the 'wan' zone"
msgstr "Open a port for incoming connections from the 'wan' zone"
msgid "Network port used for data exchange with a configurable serial port"
msgstr "Network port used for data exchange with a configurable serial port"
msgid "A new rule for traffic in the firewall will be created, allowing connections to the specified network port from external networks. Access from the 'lan' zone is open by default for all network ports"
msgstr "A new rule for traffic in the firewall will be created, allowing connections to the specified network port from external networks. Access from the 'lan' zone is open by default for all network ports"

View File

@ -0,0 +1,122 @@
msgid "PollMyDevice"
msgstr "Опрос портов по TCP"
msgid "Utility Settings"
msgstr "Настройки"
msgid "TCP to RS232/RS485 converter"
msgstr "Конвертер TCP - Последовательный порт"
msgid "BaudRate"
msgstr "Скорость (бод)"
msgid "ByteSize"
msgstr "Размер слова"
msgid "Parity"
msgstr "Четность"
msgid "Flow Control"
msgstr "Управление потоком"
msgid "StopBits"
msgstr "Стоп-биты"
msgid "Server Port"
msgstr "Порт"
msgid "Connection Hold Time (sec)"
msgstr "Время удержания приоритета соединения (сек)"
msgid "Server Host or IP Address"
msgstr "Адрес сервера"
msgid "Server Port"
msgstr "Порт сервера"
msgid "Client Reconnection Timeout (sec)"
msgstr "Таймаут соединения (сек)"
msgid "Client Authentification"
msgstr "Авторизация Teleofis"
msgid "Use Teleofis Authentification"
msgstr "Использовать авторизацию по Teleofis ID"
msgid "Save the changes. The router will reboot"
msgstr "Сохраните настройки. Роутер перезагрузится"
msgid "Disable console port"
msgstr "Отключить консоль"
msgid "Enable console port"
msgstr "Включить консоль"
msgid "Disabled"
msgstr "Отключено"
msgid "Disable"
msgstr "Отключить"
msgid "Enable"
msgstr "Включить"
msgid "Disable log messages"
msgstr "Отключить логирование"
msgid "New configuration (range [0-6]):"
msgstr "Новая конфигурация (диапазон [0-6]): "
msgid "Minimum data packet size to send. 0 - not used"
msgstr "Минимальный размер пакета данных для отправки. 0 - не применяется"
msgid "Time of data accumulation before sending. 0 - not used"
msgstr "Время накопления данных для отправки. 0 - не применяется"
msgid "Packet timeout [0-255] (x100ms)"
msgstr "Таймаут пакета [0-255] (x100мс)"
msgid "Minimum packet size [0-255] (byte)"
msgstr "Минимальный размер пакета [0-255] (байт)"
msgid "Connection Mode"
msgstr "Алгоритм опроса"
msgid "Alternating"
msgstr "Попеременный"
msgid "Simultaneous"
msgstr "Одновременный"
msgid "Port Settings"
msgstr "Настройки порта"
msgid "Console status"
msgstr "Статус консоли"
msgid "activated"
msgstr "включена"
msgid "deactivated"
msgstr "отключена"
msgid "Console"
msgstr "Консоль"
msgid "On/Off"
msgstr "Вкл/откл"
msgid "Mode Settings"
msgstr "Настройки подключения"
msgid "Listening port"
msgstr "Порт для входящих соединений"
msgid "Open a port for incoming connections from the 'wan' zone"
msgstr "Открыть порт для входящих соединений из зоны 'wan'"
msgid "Network port used for data exchange with a configurable serial port"
msgstr "Сетевой порт, используемый для обмена данными с настраиваемым последовательным портом"
msgid "A new rule for traffic in the firewall will be created, allowing connections to the specified network port from external networks. Access from the 'lan' zone is open by default for all network ports"
msgstr "Будет создано новое правило для трафика в firewall-е, разрешающее подключения к указанному сетевому порту из внешних сетей. Доступ из зоны 'lan' открыт по умолчанию для всех сетевых портов"

View File

@ -0,0 +1,14 @@
{
"admin/services/pollmydevice": {
"title": "PollMyDevice",
"order": 40,
"action": {
"type": "view",
"path": "pollmydevice/pollmydevice"
},
"depends": {
"acl": [ "luci-app-pollmydevice" ],
"uci": { "pollmydevice": true }
}
}
}

View File

@ -0,0 +1,14 @@
{
"luci-app-pollmydevice": {
"description": "Grant UCI access for luci-app-pollmydevice",
"read": {
"uci": [ "pollmydevice" ],
"ubus": {
"pollmydevice": [ "status", "con_on", "con_off", "get_id" ]
}
},
"write": {
"uci": [ "pollmydevice" ]
}
}
}

View File

@ -0,0 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-powersupply
LUCI_TITLE:=LT70 power supply control utility
LUCI_DEPENDS:=+luci-base
LUCI_DEPENDS:=powersupply
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,68 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require ui';
'require poll';
var power_status = rpc.declare({
object: 'powersupply',
method: 'info',
params: [ 'info' ],
expect: { '': {} }
});
var DummyValueExt = form.DummyValue.extend({
renderWidget: function(section_id, option_index, cfgvalue) {
return E([], [
E('input', {
'id': this.cbid(section_id),
'type': 'text',
'readonly': false
})
]);
}
});
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('powersupply', _('Power Management'));
s = m.section(form.NamedSection, 'system', _('System Properties'));
o = s.option(DummyValueExt, 'input_voltage', _('Input power supply voltage, mV'));
o = s.option(form.ListValue, 'poe_out_power', _('PoE OUT power'));
o.value(0,_('disabled'));
o.value(1,_('enabled'));
o = s.option(form.ListValue, 'poe_out_control', _('Overcurrent protection PoE OUT'));
o.value(0,_('disabled'));
o.value(1,_('enabled'));
o = s.option(form.ListValue, 'usb_power', _('USB power'));
o.value(0,_('disabled'));
o.value(1,_('enabled'));
o = s.option(form.ListValue, 'usb_control', _('Overcurrent protection USB'));
o.value(0,_('disabled'));
o.value(1,_('enabled'));
o = s.option(form.ListValue, 'ext_power', _('Power output 7.5V'));
o.value(0,_('disabled'));
o.value(1,_('enabled'));
return m.render().then(function(mapEl) {
poll.add(function() {
return power_status().then(function(t) {
document.getElementById('cbid.powersupply.system.input_voltage').value = t.input_voltage || 'n/a';
});
},1);
return mapEl;
});
}
});

View File

@ -0,0 +1,23 @@
msgid "PowerSupply"
msgstr "PowerSupply"
msgid "Power Management"
msgstr "Power Management"
msgid "Input power supply voltage, mV"
msgstr "Input power supply voltage, mV"
msgid "PoE OUT power"
msgstr "PoE OUT power"
msgid "Overcurrent protection PoE OUT"
msgstr "Overcurrent protection PoE OUT"
msgid "USB power"
msgstr "USB power"
msgid "Overcurrent protection USB"
msgstr "Overcurrent protection USB"
msgid "Power output 7.5V"
msgstr "Power output 7.5V"

View File

@ -0,0 +1,23 @@
msgid "PowerSupply"
msgstr "Управление питанием"
msgid "Power Management"
msgstr "Управление питанием"
msgid "Input power supply voltage, mV"
msgstr "Входное напряжение питания роутера, мВ"
msgid "PoE OUT power"
msgstr "Питание PoE OUT"
msgid "Overcurrent protection PoE OUT"
msgstr "Защита от превышения тока PoE OUT"
msgid "USB power"
msgstr "Питание USB"
msgid "Overcurrent protection USB"
msgstr "Защита от превышения тока USB"
msgid "Power output 7.5V"
msgstr "Выход питания 7.5 В"

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-powersupply.json" ] && {
cat > /usr/share/ucitrack/luci-app-powersupply.json << EEOF
{
"config": "powersupply",
"init": "powersupply"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@powersupply[-1]
add ucitrack powersupply
set ucitrack.@powersupply[-1].init=powersupply
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,14 @@
{
"admin/services/powersupply": {
"title": "PowerSupply",
"order": 50,
"action": {
"type": "view",
"path": "powersupply/powersupply"
},
"depends": {
"acl": [ "luci-app-powersupply" ],
"uci": { "powersupply": true }
}
}
}

View File

@ -0,0 +1,14 @@
{
"luci-app-powersupply": {
"description": "Grant UCI access for luci-app-powersupply",
"read": {
"uci": [ "powersupply" ],
"ubus": {
"powersupply": [ "info" ]
}
},
"write": {
"uci": [ "powersupply" ]
}
}
}

0
luci-app-pptpd/Makefile Normal file → Executable file
View File

View File

@ -0,0 +1,33 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('pptpd', _('PPTP Server'));
m.description = _('Simple, quick and convenient PPTP VPN, universal across the platform');
s = m.section(form.NamedSection, 'pptpd', 'pptpd');
o = s.option(form.Flag, 'enabled', _('Enable PPTP Server'));
o = s.option(form.Value, 'localip', _('Local IP'));
o.placeholder = '192.168.0.1';
o.datatype = 'ipaddr';
o = s.option(form.Value, 'remoteip_start', _('Remote IP Range Start'));
o.placeholder = '192.168.0.20';
o.datatype = 'ipaddr';
o = s.option(form.Value, 'remoteip_end', _('Remote IP Range End'));
o.placeholder = '192.168.0.30';
o.datatype = 'ipaddr';
return m.render();
}
});

View File

@ -0,0 +1,53 @@
'use strict';
'require view';
'require fs';
'require ui';
'require rpc';
return view.extend({
load: function() {
return fs.lines('/tmp/pptpd/clients');
},
updateTable: function(table, data) {
var rows = [];
for (var i = 0; i < data.length; i++) {
var client = data[i];
var info = client.split(';').map((part) => part.split(':')[1]);
rows.push([
info[0],
info[1],
info[2],
info[3]
]);
}
cbi_update_table(table, rows, E('em', _('No information available')));
},
render: function(data) {
var v = E([], [
E('h2', _('PPTP Server')),
E('div', { 'class': 'cbi-map-descr' }, _('Simple, quick and convenient PPTP VPN, universal across the platform')),
E('table', { 'class': 'table' }, [
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Interface')),
E('th', { 'class': 'th' }, _('Server IP')),
E('th', { 'class': 'th' }, _('Client IP')),
E('th', { 'class': 'th' }, _('IP address'))
])
])
]);
this.updateTable(v.lastElementChild, data);
return v;
},
handleSaveApply: null,
handleSave: null,
handleReset: null
});

View File

@ -0,0 +1,39 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('pptpd', _('PPTP Server'));
m.description = _('Simple, quick and convenient PPTP VPN, universal across the platform');
s = m.section(form.TableSection, 'login');
s.anonymous = true;
s.addremove = true;
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.editable = true;
o = s.option(form.Value, 'username', _('User name'));
o.editable = true;
o = s.option(form.Value, 'password', _('Password'));
o.editable = true;
o = s.option(form.Value, 'remoteip', _('IP address'));
o.editable = true;
o.datatype = 'ipaddr';
o = s.option(form.Value, 'route', _('Add route'));
o.editable = true;
o.datatype = "ipaddr"
o.placeholder = "192.168.10.0/24"
return m.render();
}
});

View File

@ -0,0 +1,32 @@
msgid "PPTP Server"
msgstr "PPTP Server"
msgid "Simple, quick and convenient PPTP VPN, universal across the platform"
msgstr "Simple, quick and convenient PPTP VPN, universal across the platform"
msgid "Users Manager"
msgstr "Users Manager"
msgid "Online Users"
msgstr "Online Users"
msgid "Enable PPTP Server"
msgstr "Enable PPTP Server"
msgid "Local IP"
msgstr "Local IP"
msgid "Remote IP Range Start"
msgstr "Remote IP Range Start"
msgid "Remote IP Range End"
msgstr "Remote IP Range End"
msgid "Add route"
msgstr "Add route"
msgid "Server IP"
msgstr "Server IP"
msgid "Client IP"
msgstr "Client IP"

View File

@ -0,0 +1,32 @@
msgid "PPTP Server"
msgstr "PPTP-сервер"
msgid "Simple, quick and convenient PPTP VPN, universal across the platform"
msgstr "Простой, быстрый, удобный и мультиплатформенный PPTP VPN"
msgid "Users Manager"
msgstr "Управление пользователями"
msgid "Online Users"
msgstr "Подключенные пользователи"
msgid "Enable PPTP Server"
msgstr "Включить PPTP-сервер"
msgid "Local IP"
msgstr "Локальный IP-адрес сервера"
msgid "Remote IP Range Start"
msgstr "Начало диапазона IP-адресов клиентов"
msgid "Remote IP Range End"
msgstr "Конец диапазона IP-адресов клиентов"
msgid "Add route"
msgstr "Добавить маршрут"
msgid "Server IP"
msgstr "IP-адрес сервера"
msgid "Client IP"
msgstr "IP-адрес клиента"

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-pptpd.json" ] && {
cat > /usr/share/ucitrack/luci-app-pptpd.json << EEOF
{
"config": "pptpd",
"init": "pptpd"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@pptpd[-1]
add ucitrack pptpd
set ucitrack.@pptpd[-1].init=pptpd
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,40 @@
{
"admin/vpn/pptpd": {
"title": "PPTP Server",
"order": 60,
"action": {
"type": "alias",
"path": "admin/vpn/pptpd/general"
},
"depends": {
"acl": [ "luci-app-pptpd" ]
}
},
"admin/vpn/pptpd/general": {
"title": "General Settings",
"order": 10,
"action": {
"type": "view",
"path": "pptpd/general"
}
},
"admin/vpn/pptpd/user": {
"title": "Users Manager",
"order": 20,
"action": {
"type": "view",
"path": "pptpd/user"
}
},
"admin/vpn/pptpd/online": {
"title": "Online Users",
"order": 30,
"action": {
"type": "view",
"path": "pptpd/online"
}
}
}

View File

@ -2,7 +2,10 @@
"luci-app-pptpd": {
"description": "Grant UCI access for luci-app-pptpd",
"read": {
"uci": [ "pptpd" ]
"uci": [ "pptpd" ],
"file": {
"/tmp/pptpd/clients": [ "read" ]
},
},
"write": {
"uci": [ "pptpd" ]

12
luci-app-report/Makefile Normal file
View File

@ -0,0 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-report
PKG_LICENSE:=Apache-2.0
LUCI_TITLE:=LuCI report module
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,71 @@
'use strict';
'require fs';
'require rpc';
'require uci';
'require view';
'require form';
'require ui';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('report', _('Generate report'));
m.description = _('Click "Generate archive" to download a tar archive of the selected options. It may take several minutes.');
s = m.section(form.TypedSection, 'report');
s.anonymous = true;
o = s.option(form.Flag, 'kernel', _('Kernel log:'));
o.rmempty = false;
o = s.option(form.Flag, 'system', _('System log:'));
o.rmempty = false;
o = s.option(form.Flag, 'network', _('Network config:'));
o.rmempty = false;
o = s.option(form.Flag, 'simman', _('Simman config:'));
o.rmempty = false;
o = s.option(form.Flag, 'openvpn', _('OpenVPN config:'));
o.rmempty = false;
o = s.option(form.Flag, 'mwan', _('MWAN3 config:'));
o.rmempty = false;
o = s.option(form.Flag, 'pollmydevice', _('Pollmydevice config:'));
o.rmempty = false;
o = s.option(form.Flag, 'ntp', _('NTP config:'));
o.rmempty = false;
o = s.option(form.Flag, 'smsd', _('SMS config:'));
o.rmempty = false;
o = s.option(form.Flag, 'snmp', _('SNMP config:'));
o.rmempty = false;
o = s.option(form.Button, 'dl_report',_(' '));
o.inputstyle = 'action important';
o.inputtitle = _('Generate archive');
o.onclick = function(ev) {
fs.exec('/bin/report',null).then(function(res) {
var form = E('form', {
'method': 'post',
'action': L.env.cgi_base + '/cgi-download',
'enctype': 'application/x-www-form-urlencoded'
}, [
E('input', { 'type': 'hidden', 'name': 'sessionid', 'value': rpc.getSessionID() }),
E('input', { 'type': 'hidden', 'name': 'path', 'value': '/tmp/report.tar.gz' }),
E('input', { 'type': 'hidden', 'name': 'filename', 'value': 'report.tar.gz' })
]);
ev.target.parentNode.appendChild(form);
form.submit();
form.parentNode.removeChild(form);
},this,ev.target);
}
return m.render();
},
});

View File

@ -0,0 +1,18 @@
msgid ""
msgstr ""
msgid "Report"
msgstr "Report"
msgid "Create report"
msgstr "Create report"
msgid "Click \"Generate archive\" to download a tar archive of the selected options. It may take several minutes."
msgstr "Click \"Generate archive\" to download a tar archive of the selected options. It may take several minutes."
msgid "Select the required options"
msgstr "Select the required options"
msgid "Download report"
msgstr "Download report"

View File

@ -0,0 +1,17 @@
msgid ""
msgstr ""
msgid "Report"
msgstr "Отчёт"
msgid "Generate report"
msgstr "Создать отчет"
msgid "Click \"Generate archive\" to download a tar archive of the selected options. It may take several minutes."
msgstr "Нажмите на кнопку \"Создать архив\" для загрузки tar-архива с выбранными опциями. Это может занять несколько минут."
msgid "Select the required options"
msgstr "Выберите необходимые опции"
msgid "Download report"
msgstr "Загрузить отчет"

View File

@ -0,0 +1,12 @@
{
"admin/status/report": {
"title": "Report",
"action": {
"type": "view",
"path": "report/report"
},
"depends": {
"acl": [ "luci-app-report" ]
}
}
}

View File

@ -0,0 +1,20 @@
{
"luci-app-report": {
"description": "Grant access for luci-app-report",
"read": {
"cgi-io": [ "download" ],
"file": {
"/tmp/report.tar.gz": [ "read" ]
},
"uci": [ "report" ],
"ubus": [ "exec", "read" ]
},
"write": {
"file": {
"/bin/report": [ "exec" ]
},
"uci": [ "report" ],
"ubus": [ "exec" ]
}
}
}

21
luci-app-simman/Makefile Executable file
View File

@ -0,0 +1,21 @@
# Custom configurator
#
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-simman
LUCI_DEPENDS:=+simman
# Version: <major>.<minor>.<patch>
PKG_VERSION:=0.2.6
PKG_RELEASE:=1
PKG_MAINTAINER:=Sklyarec Konstantin <atskyua@gmail.com> Vladimir Ovseychuk <vgovseychuk@gmail.com>
LUCI_TITLE:=LuCI SIM manager Configuration Frontend
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,13 @@
module("luci.controller.simman", package.seeall)
function index()
if not nixio.fs.access("/etc/config/simman") then
return
end
local page
page = entry({"admin", "services", "simman"}, cbi("simman"), _(translate("Simman")))
page.dependent = true
end

View File

@ -0,0 +1,225 @@
--
--
require 'luci.sys'
function split(text, delim)
-- returns an array of fields based on text and delimiter (one character only)
local result = {}
local magic = "().%+-*?[]^$"
if delim == nil then
delim = "%s"
elseif string.find(delim, magic, 1, true) then
-- escape magic
delim = "%"..delim
end
local pattern = "[^"..delim.."]+"
for w in string.gmatch(text, pattern) do
table.insert(result, w)
end
return result
end
m = Map("simman", "Simman", translate("SIM manager for modem"))
--- General settings ---
section_gen = m:section(NamedSection, "core", "simman", translate("General settings")) -- create general section
enabled = section_gen:option(Flag, "enabled", translate("Enabled"), translate("To switch on/off require a reboot"), translate("Enabled")) -- create enable checkbox
enabled.rmempty = false
enabled = section_gen:option(Flag, "only_first_sim", translate("Use only high priority SIM"), translate("If you use only one SIM, the remaining SIM will be considered a priority"), translate("Enabled"))
enabled.rmempty = false
retry_num = section_gen:option(Value, "retry_num", translate("Number of failed attempts"))
retry_num.default = 3
retry_num.datatype = "and(uinteger, min(1))"
retry_num.rmempty = false
retry_num.optional = false
check_period = section_gen:option(Value, "check_period", translate("Period of check, sec"))
check_period.default = 60
check_period.datatype = "and(uinteger, min(30))"
check_period.rmempty = false
check_period.optional = false
delay = section_gen:option(Value, "delay", translate("Return to priority SIM, sec"))
delay.default = 600
delay.datatype = "and(uinteger, min(60))"
delay.rmempty = false
delay.optional = false
csq_level = section_gen:option(Value, "csq_level", translate("Minimum acceptable signal level, ASU (min: 1, max: 31)"), translate("0 - not used"))
csq_level.default = 0
csq_level.datatype = "and(uinteger, min(0), max(31))"
csq_level.rmempty = false
csq_level.optional = false
atdevice = section_gen:option(Value, "atdevice", translate("AT modem device name"))
atdevice.default = "/dev/ttyACM3"
atdevice.datatype = "device"
atdevice.rmempty = false
atdevice.optional = false
iface = section_gen:option(Value, "iface", translate("Ping iface name"))
iface.default = "internet"
iface.datatype = "network"
iface.rmempty = false
iface.optional = false
testip = section_gen:option(DynamicList, "testip", translate("IP address of remote servers"))
testip.datatype = "ipaddr"
testip.cast = "string"
testip.rmempty = false
testip.optional = false
sw_before_modres = section_gen:option(Value, "sw_before_modres", translate("Switches before modem reset"), translate("0 - not used"))
sw_before_modres.default = 0
sw_before_modres.datatype = "and(uinteger, min(0), max(100))"
sw_before_modres.rmempty = false
sw_before_modres.optional = false
sw_before_sysres = section_gen:option(Value, "sw_before_sysres", translate("Switches before reboot"), translate("0 - not used"))
sw_before_sysres.default = 0
sw_before_sysres.datatype = "and(uinteger, min(0), max(100))"
sw_before_sysres.rmempty = false
sw_before_sysres.optional = false
--- SIM info ---
section_info = m:section(NamedSection, "info", "simman", translate("SIM Info"))
atdevice = section_info:option(Value, "atdevice", translate("AT modem device name"))
atdevice.default = "/dev/ttyACM3"
atdevice.datatype = "device"
atdevice.rmempty = false
atdevice.optional = false
imei = section_info:option(DummyValue, "imei", translate("Modem IMEI"))
sim = section_info:option(DummyValue, "sim", translate("SIM State"))
ccid = section_info:option(DummyValue, "ccid", translate("Active SIM CCID"))
pincode_stat = section_info:option(DummyValue, "pincode_stat", translate("Pincode Status"))
sig_lev = section_info:option(DummyValue, "sig_lev", translate("Signal Strength"))
reg_stat = section_info:option(DummyValue, "reg_stat", translate("Registration Status"))
base_st_id = section_info:option(DummyValue, "base_st_id", translate("Base Station ID"))
base_st_bw = section_info:option(DummyValue, "base_st_bw", translate("Base Station Band"))
net_type = section_info:option(DummyValue, "net_type", translate("Cellural Network Type"))
gprs_reg_stat = section_info:option(DummyValue, "gprs_reg_stat", translate("GPRS Status"))
pack_type = section_info:option(DummyValue, "pack_type", translate("Package Type"))
refresher = section_info:option( Button, "refresher", translate("Refresh") )
refresher.title = translate("Refresh Info")
refresher.inputtitle = translate("Refresh")
refresher.inputstyle = "apply"
function refresher.write()
luci.sys.call("/sbin/simman_getinfo")
end
--- SIM1 settings ---
sim = m:section(TypedSection, "sim0", translate("SIM1 settings"))
sim.addremove = false
sim.anonymous = true
priority = sim:option(ListValue, "priority", translate("Priority"))
priority.default = "1"
priority:value("0", "low")
priority:value("1", "high")
priority.optional = false
GPRS_apn = sim:option(Value, "GPRS_apn", translate("APN"))
GPRS_apn.default = ""
GPRS_apn.rmempty = true
GPRS_apn.optional = false
GPRS_apn.cast = "string"
pin = sim:option(Value, "pin", translate("Pincode"))
pin.default = ""
pin.rmempty = true
pin.optional = false
GPRS_user = sim:option(Value, "GPRS_user", translate("User name"))
GPRS_user.default = ""
GPRS_user.rmempty = true
GPRS_user.optional = false
GPRS_pass = sim:option(Value, "GPRS_pass", translate("Password"))
GPRS_pass.default = ""
GPRS_pass.rmempty = true
GPRS_pass.optional = false
testip = sim:option(DynamicList, "testip", translate("IP address of remote servers"))
testip.datatype = "ipaddr"
testip.cast = "string"
--- SIM2 settings ---
sim = m:section(TypedSection, "sim1", translate("SIM2 settings"))
sim.addremove = false
sim.anonymous = true
priority = sim:option(ListValue, "priority", translate("Priority"))
priority.default = "0"
priority:value("0", "low")
priority:value("1", "high")
priority.optional = false
GPRS_apn = sim:option(Value, "GPRS_apn", translate("APN"))
GPRS_apn.default = ""
GPRS_apn.rmempty = true
GPRS_apn.optional = false
GPRS_apn.cast = "string"
pin = sim:option(Value, "pin", translate("Pincode"))
pin.default = ""
pin.rmempty = true
pin.optional = false
GPRS_user = sim:option(Value, "GPRS_user", translate("User name"))
GPRS_user.default = ""
GPRS_user.rmempty = true
GPRS_user.optional = false
GPRS_pass = sim:option(Value, "GPRS_pass", translate("Password"))
GPRS_pass.default = ""
GPRS_pass.rmempty = true
GPRS_pass.optional = false
testip = sim:option(DynamicList, "testip", translate("IP address of remote servers"))
testip.datatype = "ipaddr"
testip.cast = "string"
nbiot = m:section(TypedSection, "nbiot", translate("NB-IoT Modem Info"), translate("if available"))
nbiot.addremove = false
nbiot.anonymous = true
nb_imei = nbiot:option(DummyValue, "nb_imei", translate("NB-IoT modem IMEI"))
nb_imei.default = ""
nb_ccid = nbiot:option(DummyValue, "nb_ccid", translate("NB-IoT SIM CCID"))
nb_ccid.default = ""
btn = nbiot:option(Button, "_btn", translate("Refresh"))
btn.title = translate("Refresh Info")
btn.inputtitle = translate("Refresh")
btn.inputstyle = "apply"
function btn.write(self, section)
local test = io.popen("/etc/simman/nbinfo.sh imei")
local result = test:read("*a")
test:close()
nb_imei.value = result
test = io.popen("/etc/simman/nbinfo.sh ccid")
local result = test:read("*a")
test:close()
nb_ccid.value = result
end
function m.on_commit(self)
-- Modified configurations got committed and the CBI is about to restart associated services
end
function m.on_init(self)
-- The CBI is about to render the Map object
end
return m

67
luci-app-simman/po/en/simman.po Executable file
View File

@ -0,0 +1,67 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-26 12:54+0300\n"
"PO-Revision-Date: 2016-02-26 12:54+0300\n"
"Last-Translator: Константин <atskyua@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Virtaal 0.7.1\n"
msgid "simman"
msgstr "simman"
msgid "SIM manager for modem"
msgstr "SIM manager for modem"
msgid "General settings"
msgstr "General settings"
msgid "Main module options"
msgstr "Main module options"
msgid "To switch on/off require a reboot"
msgstr "To switch on/off require a reboot"
msgid "Number of failed attempts"
msgstr "Number of failed attempts"
msgid "Period of check, sec"
msgstr "Period of check, sec"
msgid "Return to priority SIM, sec"
msgstr "Return to priority SIM, sec"
msgid "AT modem device name"
msgstr "AT modem device name"
msgid "IP address of remote servers"
msgstr "IP address of remote servers"
msgid "SIM1 settings"
msgstr "SIM1 settings"
msgid "Priority"
msgstr "Priority"
msgid "APN"
msgstr "APN"
msgid "Pincode"
msgstr "Pincode"
msgid "User name"
msgstr "User name"
msgid "Password"
msgstr "Password"
msgid "SIM2 settings"
msgstr "SIM2 settings"

145
luci-app-simman/po/ru/simman.po Executable file
View File

@ -0,0 +1,145 @@
# Константин <atskyua@gmail.com>, 2016.
msgid ""
msgstr ""
"Project-Id-Version: LuCI: Simman\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-22 10:10+0300\n"
"PO-Revision-Date: 2016-02-26 12:28+0300\n"
"Last-Translator: Константин <atskyua@gmail.com>\n"
"Language-Team: Konstantin Sklyarec <atskyua@gmail.com>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Virtaal 0.7.1\n"
msgid "Simman"
msgstr "Менеджер SIM"
msgid "SIM manager for modem"
msgstr "Менеджер SIM-карт модема"
msgid "General settings"
msgstr "Настройки"
msgid "To switch on/off require a reboot"
msgstr "Для переключения необходима перезагрузка"
msgid "Enabled"
msgstr "Включить"
msgid "Use only high priority SIM"
msgstr "Использовать только SIM с высоким приоритетом"
msgid "If you use only one SIM, the remaining SIM will be considered a priority"
msgstr "Если вставлен только один SIM-холдер, то SIM карта в нем будет считаться приоритетной"
msgid "Number of failed attempts"
msgstr "Число неудачных попыток пинга"
msgid "Period of check, sec"
msgstr "Период между попытками пинга, сек"
msgid "Return to priority SIM, sec"
msgstr "Период переключения на приоритетную SIM-карту, сек"
msgid "AT modem device name"
msgstr "Имя устройства АТ модема"
msgid "Ping iface name"
msgstr "Имя интерфейса"
msgid "IP address of remote servers"
msgstr "Адреса тестовых серверов для пинга"
msgid "Switches before modem reset"
msgstr "Переключений SIM-карт до сброса модема"
msgid "Switches before reboot"
msgstr "Переключений SIM-карт до перезагрузки роутера"
msgid "0 - not used"
msgstr "0 - не применяется"
msgid "SIM1 settings"
msgstr "Параметры SIM-карты 1"
msgid "Priority"
msgstr "Приоритет"
msgid "APN"
msgstr "Имя точки доступа"
msgid "Pincode"
msgstr "Пин код"
msgid "User name"
msgstr "Имя пользователя"
msgid "Password"
msgstr "Пароль"
msgid "SIM2 settings"
msgstr "Параметры SIM-карты 2"
msgid "SIM Info"
msgstr "Информация по подключению"
msgid "SIM State"
msgstr "Состояние SIM карт"
msgid "Active SIM CCID"
msgstr "CCID активной SIM карты"
msgid "Pincode Status"
msgstr "Статус PIN-кода"
msgid "Signal Strength"
msgstr "Уровень сигнала"
msgid "Registration Status"
msgstr "Статус регистрации в сети"
msgid "Base Station ID"
msgstr "ID базовой станции"
msgid "Base Station Band"
msgstr "Частотный канал"
msgid "Cellural Network Type"
msgstr "Технология доступа"
msgid "GPRS Status"
msgstr "Статус GPRS"
msgid "Package Type"
msgstr "Тип пакетной передачи"
msgid "Modem IMEI"
msgstr "IMEI модема"
msgid "Provider Info"
msgstr "Информация об операторе"
msgid "Refresh Info"
msgstr "Обновить информацию"
msgid "Refresh"
msgstr "Обновить"
msgid "NB-IoT Modem Info"
msgstr "Информация об NB-IoT модеме"
msgid "if available"
msgstr "если доступен"
msgid "NB-IoT modem IMEI"
msgstr "IMEI NB-IoT модема"
msgid "Not available"
msgstr "Не доступен"
msgid "Minimum acceptable signal level, ASU (min: 1, max: 31)"
msgstr "Минимально допустимый уровень сигнала, ASU (мин: 1, макс: 31)"

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-simman.json" ] && {
cat > /usr/share/ucitrack/luci-app-simman.json << EEOF
{
"config": "simman",
"init": "simman"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@simman[-1]
add ucitrack simman
set ucitrack.@simman[-1].init=simman
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

11
luci-app-simman2/Makefile Normal file
View File

@ -0,0 +1,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-simman2
LUCI_TITLE:=LuCI interface for Simman2 configuration
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,268 @@
'use strict';
'require fs';
'require rpc';
'require uci';
'require ui';
'require view';
'require form';
'require tools.widgets as widgets';
var modemRequestAll = rpc.declare({
object: 'simman2',
method: 'statusall',
params: [ 'config' ],
expect: { '': {} }
});
var DummyValueExt = form.DummyValue.extend({
renderWidget: function(section_id, option_index, cfgvalue) {
return E([], [
E('div', {
'class': 'cbi-value-field',
'id': this.cbid(section_id),
'style': 'color:#c73d3d;margin-left:0'
})
]);
}
});
return view.extend({
handleEnableService: rpc.declare({
object: 'luci',
method: 'setInitAction',
params: [ 'simman2', 'enable' ],
expect: { result: false }
}),
render: function() {
var m, s, o;
m = new form.Map('simman2', _('Simman2'));
m.description = _('SIM manager for modem');
s = m.section(form.GridSection, 'simman2', _('Settings'));
s.tab('general', _('General Settings'));
s.tab('sim0', _('SIM1 Settings'));
s.tab('sim1', _('SIM2 Settings'));
s.tab('info', _('Information'));
s.addremove = false;
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('simman2', section, 'enabled', value);
}, this);
o = s.taboption('general', widgets.NetworkSelect, 'iface', _('Interface name'));
o.rmempty = false;
o.textvalue = function(section_id) {
return uci.get('simman2', section_id, 'iface');
}
o = s.taboption('general', form.Value, 'atdevice', _('AT modem device name'));
o.rmempty = false;
o = s.taboption('general', form.Flag, 'only_first_sim', _('Use only high priority SIM'), _('If you use only one SIM, the remaining SIM will be considered a priority'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.DynamicList, 'testip', _('IP address of remote servers'));
o.rmempty = false;
o.datatype = 'host';
o = s.taboption('general', form.Value, 'csq_level', _('Minimum acceptable signal level, ASU (min: 1, max: 31)'), _('0 - not used'));
o.rmempty = false;
o.datatype = 'and(uinteger, min(0), max(31))'
o.default = '0';
o.modalonly = true;
o = s.taboption('general', form.Value, 'retry_num', _('Number of failed attempts'));
o.rmempty = false;
o.datatype = 'and(uinteger,min(1))';
o.default = '3';
o.modalonly = true;
o = s.taboption('general', form.Value, 'check_period', _('Period of check, sec'));
o.rmempty = false;
o.datatype = 'and(uinteger,min(30))';
o.default = '60';
o.modalonly = true;
o = s.taboption('general', form.Value, 'sw_before_modres', _('Switches before modem reset'), _('0 - not used'));
o.rmempty = false;
o.datatype = 'and(uinteger,min(0),max(100))';
o.default = '0';
o = s.taboption('general', form.Value, 'sw_before_sysres', _('Switches before reboot'), _('0 - not used'));
o.rmempty = false;
o.datatype = 'and(uinteger,min(0),max(100))';
o.default = '0';
o = s.taboption('general', form.Value, 'delay', _('Return to priority SIM, sec'));
o.rmempty = false;
o.datatype = 'and(uinteger,min(60))';
o.default = '600';
o.modalonly = true;
o = s.taboption('sim0', form.ListValue, 'sim0_priority', _('Priority'));
o.default = '1';
o.value('0','low');
o.value('1','high');
o.rmempty = false;
o.modalonly = true;
o = s.taboption('sim0', form.ListValue, 'sim0_mode', _('Service type'));
o.default = 'all';
o.value('all',_('All'));
o.value('lte',_('LTE only'));
o.value('umts',_('UMTS only'));
o.value('gsm',_('GPRS only'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('sim0', form.Value, 'sim0_apn', _('APN'));
o.modalonly = true;
o = s.taboption('sim0', form.Value, 'sim0_pincode', _('Pincode'));
o.modalonly = true;
o = s.taboption('sim0', form.ListValue, 'sim0_auth', _('Authentication Type'));
o.default = 'none';
o.value('both','PAP/CHAP');
o.value('pap','PAP');
o.value('chap','CHAP');
o.value('none','NONE');
o.modalonly = true;
o = s.taboption('sim0', form.Value, 'sim0_username', _('User name'));
o.modalonly = true;
o.depends({sim0_auth: 'none', '!reverse': true});
o = s.taboption('sim0', form.Value, 'sim0_password', _('Password'));
o.modalonly = true;
o.password = true;
o.depends({sim0_auth: 'none', '!reverse': true});
o = s.taboption('sim0', form.DynamicList, 'sim0_testip', _('IP address of remote servers'));
o.datatype = 'host';
o.modalonly = true;
o = s.taboption('sim1', form.ListValue, 'sim1_priority', _('Priority'));
o.default = '0';
o.value('0','low');
o.value('1','high');
o.rmempty = false;
o.modalonly = true;
o = s.taboption('sim1', form.ListValue, 'sim1_mode', _('Service type'));
o.default = 'all';
o.value('all',_('All'));
o.value('lte',_('LTE only'));
o.value('umts',_('UMTS only'));
o.value('gsm',_('GPRS only'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('sim1', form.Value, 'sim1_apn', _('APN'));
o.modalonly = true;
o = s.taboption('sim1', form.Value, 'sim1_pincode', _('Pincode'));
o.modalonly = true;
o = s.taboption('sim1', form.ListValue, 'sim1_auth', _('Authentication Type'));
o.default = 'none';
o.value('both','PAP/CHAP');
o.value('pap','PAP');
o.value('chap','CHAP');
o.value('none','NONE');
o.modalonly = true;
o = s.taboption('sim1', form.Value, 'sim1_username', _('User name'));
o.modalonly = true;
o.depends({sim1_auth: 'none', '!reverse': true});
o = s.taboption('sim1', form.Value, 'sim1_password', _('Password'));
o.modalonly = true;
o.password = true;
o.depends({sim1_auth: 'none', '!reverse': true});
o = s.taboption('sim1', form.DynamicList, 'sim1_testip', _('IP address of remote servers'));
o.datatype = 'host';
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'modem', _('Modem'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'firmware', _('Firmware version'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'imei', _('Modem IMEI'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'ccid', _('Active SIM CCID'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'imsi', _('Active SIM IMSI'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'sim', _('SIM State'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'pincode_stat', _('Pincode Status'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'operator', _('Operator'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'sig_lev', _('Signal Strength'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'reg_stat', _('Registration Status'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'net_type', _('Cellural Network Type'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'gprs_reg_stat', _('GPRS Status'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'pack_type', _('Package Type'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'base_st_id', _('Base Station ID'));
o.modalonly = true;
o = s.taboption('info', DummyValueExt, 'base_st_bw', _('Base Station Band'));
o.modalonly = true;
o = s.taboption('info', form.Button, 'refresh',_(' '));
o.modalonly = true;
o.inputstyle = 'action important';
o.inputtitle = _('Refresh');
o.onclick = L.bind(function(ev, section_id) {
return modemRequestAll(section_id).then(function(t) {
document.getElementById('cbid.simman2.%s.modem'.format(section_id)).textContent = t.modem || 'n/a';
document.getElementById('cbid.simman2.%s.firmware'.format(section_id)).textContent = t.firmware || 'n/a';
document.getElementById('cbid.simman2.%s.imei'.format(section_id)).textContent = t.imei || 'n/a';
document.getElementById('cbid.simman2.%s.ccid'.format(section_id)).textContent = t.ccid || 'n/a';
document.getElementById('cbid.simman2.%s.imsi'.format(section_id)).textContent = t.imsi || 'n/a';
document.getElementById('cbid.simman2.%s.sim'.format(section_id)).textContent = t.sim_state || 'n/a';
document.getElementById('cbid.simman2.%s.pincode_stat'.format(section_id)).textContent = t.pin_state || 'n/a';
document.getElementById('cbid.simman2.%s.operator'.format(section_id)).textContent = t.operator || 'n/a';
document.getElementById('cbid.simman2.%s.sig_lev'.format(section_id)).textContent = t.csq || 'n/a';
document.getElementById('cbid.simman2.%s.reg_stat'.format(section_id)).textContent = t.net_reg || 'n/a';
document.getElementById('cbid.simman2.%s.net_type'.format(section_id)).textContent = t.net_type || 'n/a';
document.getElementById('cbid.simman2.%s.gprs_reg_stat'.format(section_id)).textContent = t.data_reg || 'n/a';
document.getElementById('cbid.simman2.%s.pack_type'.format(section_id)).textContent = t.data_type || 'n/a';
document.getElementById('cbid.simman2.%s.base_st_id'.format(section_id)).textContent = t.bs_id || 'n/a';
document.getElementById('cbid.simman2.%s.base_st_bw'.format(section_id)).textContent = t.band || 'n/a';
});
})
return m.render();
}
});

View File

@ -0,0 +1,70 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-26 12:54+0300\n"
"PO-Revision-Date: 2016-02-26 12:54+0300\n"
"Last-Translator: Константин <atskyua@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Virtaal 0.7.1\n"
msgid "simman"
msgstr "simman"
msgid "SIM manager for modem"
msgstr "SIM manager for modem"
msgid "General settings"
msgstr "General settings"
msgid "Main module options"
msgstr "Main module options"
msgid "To switch on/off require a reboot"
msgstr "To switch on/off require a reboot"
msgid "Number of failed attempts"
msgstr "Number of failed attempts"
msgid "Period of check, sec"
msgstr "Period of check, sec"
msgid "Return to priority SIM, sec"
msgstr "Return to priority SIM, sec"
msgid "AT modem device name"
msgstr "AT modem device name"
msgid "IP address of remote servers"
msgstr "IP address of remote servers"
msgid "SIM1 settings"
msgstr "SIM1 settings"
msgid "Priority"
msgstr "Priority"
msgid "APN"
msgstr "APN"
msgid "Pincode"
msgstr "Pincode"
msgid "User name"
msgstr "User name"
msgid "Password"
msgstr "Password"
msgid "SIM2 settings"
msgstr "SIM2 settings"
msgid "Operator"
msgstr "Operator"

169
luci-app-simman2/po/ru/simman2.po Executable file
View File

@ -0,0 +1,169 @@
# Константин <atskyua@gmail.com>, 2016.
msgid ""
msgstr ""
"Project-Id-Version: LuCI: Simman\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-22 10:10+0300\n"
"PO-Revision-Date: 2016-02-26 12:28+0300\n"
"Last-Translator: Константин <atskyua@gmail.com>\n"
"Language-Team: Konstantin Sklyarec <atskyua@gmail.com>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%"
"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Virtaal 0.7.1\n"
msgid "Simman"
msgstr "Менеджер SIM"
msgid "SIM manager for modem"
msgstr "Менеджер SIM-карт модема"
msgid "General settings"
msgstr "Настройки"
msgid "To switch on/off require a reboot"
msgstr "Для переключения необходима перезагрузка"
msgid "Enabled"
msgstr "Включить"
msgid "Use only high priority SIM"
msgstr "Использовать только SIM с высоким приоритетом"
msgid "If you use only one SIM, the remaining SIM will be considered a priority"
msgstr "Если вставлен только один SIM-холдер, то SIM карта в нем будет считаться приоритетной"
msgid "Number of failed attempts"
msgstr "Число неудачных попыток пинга"
msgid "Period of check, sec"
msgstr "Период между попытками пинга, сек"
msgid "Return to priority SIM, sec"
msgstr "Период переключения на приоритетную SIM-карту, сек"
msgid "AT modem device name"
msgstr "Имя устройства АТ модема"
msgid "Ping iface name"
msgstr "Имя интерфейса"
msgid "IP address of remote servers"
msgstr "Адреса тестовых серверов для пинга"
msgid "Switches before modem reset"
msgstr "Переключений SIM-карт до сброса модема"
msgid "Switches before reboot"
msgstr "Переключений SIM-карт до перезагрузки роутера"
msgid "0 - not used"
msgstr "0 - не применяется"
msgid "SIM1 settings"
msgstr "Параметры SIM-карты 1"
msgid "Priority"
msgstr "Приоритет"
msgid "APN"
msgstr "Имя точки доступа"
msgid "Pincode"
msgstr "Пин код"
msgid "User name"
msgstr "Имя пользователя"
msgid "Password"
msgstr "Пароль"
msgid "SIM2 settings"
msgstr "Параметры SIM-карты 2"
msgid "SIM Info"
msgstr "Информация по подключению"
msgid "SIM State"
msgstr "Состояние SIM карт"
msgid "Active SIM CCID"
msgstr "CCID активной SIM карты"
msgid "Pincode Status"
msgstr "Статус PIN-кода"
msgid "Signal Strength"
msgstr "Уровень сигнала"
msgid "Registration Status"
msgstr "Статус регистрации в сети"
msgid "Base Station ID"
msgstr "ID базовой станции"
msgid "Base Station Band"
msgstr "Частотный канал"
msgid "Cellural Network Type"
msgstr "Технология доступа"
msgid "GPRS Status"
msgstr "Статус GPRS"
msgid "Package Type"
msgstr "Тип пакетной передачи"
msgid "Modem IMEI"
msgstr "IMEI модема"
msgid "Provider Info"
msgstr "Информация об операторе"
msgid "Refresh Info"
msgstr "Обновить информацию"
msgid "Refresh"
msgstr "Обновить"
msgid "NB-IoT Modem Info"
msgstr "Информация об NB-IoT модеме"
msgid "if available"
msgstr "если доступен"
msgid "NB-IoT modem IMEI"
msgstr "IMEI NB-IoT модема"
msgid "Not available"
msgstr "Не доступен"
msgid "Minimum acceptable signal level, ASU (min: 1, max: 31)"
msgstr "Минимально допустимый уровень сигнала, ASU (мин: 1, макс: 31)"
msgid "Modem"
msgstr "Модем"
msgid "Firmware version"
msgstr "Версия прошивки"
msgid "Active SIM IMSI"
msgstr "IMSI активной SIM карты"
msgid "Simman2"
msgstr "Менеджер SIM"
msgid "SIM1 Settings"
msgstr "Настройки SIM1"
msgid "SIM2 Settings"
msgstr "Настройки SIM2"
msgid "Service type"
msgstr "Тип службы"
msgid "Operator"
msgstr "Оператор"

View File

@ -0,0 +1,14 @@
{
"admin/services/simman2": {
"title": "Simman2",
"order": 60,
"action": {
"type": "view",
"path": "simman2/simman2"
},
"depends": {
"acl": [ "luci-app-simman2" ],
"uci": { "simman2": true }
}
}
}

View File

@ -0,0 +1,17 @@
{
"luci-app-simman2": {
"description": "Grant UCI access for luci-app-simman2",
"read": {
"uci": [ "simman2" ],
"ubus": {
"simman2": [ "info", "statusall"]
}
},
"write": {
"uci": [ "simman2" ],
"ubus": {
"simman2": [ "info" ]
}
}
}
}

19
luci-app-smscontrol/Makefile Executable file
View File

@ -0,0 +1,19 @@
# Custom configurator
#
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-smscontrol
LUCI_DEPENDS:=
# Version: <major>.<minor>.<patch>
PKG_VERSION:=0.2.0
PKG_RELEASE:=1
LUCI_TITLE:=LuCI utility to remote control via SMS
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,33 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('smscontrol', _('Command over SMS'));
m.description = _('You can make a call from the allowed phone number and then the router will execute the command');
s = m.section(form.TableSection, 'call');
s.anonymous = true;
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.rmempty = false;
o.editable = true;
o = s.option(form.Flag, 'ack', _('Reply via SMS'));
o.rmempty = true;
o.editable = true;
o = s.option(form.Value, 'command', _('Linux command'));
o.rmempty =false;
o.optional = false;
o.editable = true;
return m.render();
}
});

View File

@ -0,0 +1,35 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('smscontrol', _('Remote SMS Control'));
m.description = _('Here you can send commands to router via a call or SMS');
s = m.section(form.NamedSection, 'common', 'smscontrol');
o = s.option(form.Flag, 'enabled', _('Enabled'));
o = s.option(form.Value, 'pass', _('Password'));
o.rmempty = false;
o.optional = false;
o.datatype = 'and(uciname,maxlength(15))';
o = s.option(form.DynamicList, 'whitelist', _('Allowed phone numbers'), _('The phone number is set in the international format without \'+\''));
o.datatype = 'phonedigit';
o.cast = 'string';
o.rmempty =true;
o.optional = false;
o = s.option(form.Flag, 'smscontrol_log', _('Enable sms and call log'));
o.optional = false;
return m.render();
}
});

View File

@ -0,0 +1,40 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('smscontrol_log', _('Event log'));
m.description = _('SMS and call log');
s = m.section(form.TableSection, 'event');
s.anonymous = true;
s.addremove = true;
s.rowcolors = true;
s.addbtntitle = _('Remove all');
s.handleAdd = function(ev) {
var sections;
sections = uci.sections('smscontrol_log');
for (var i = 0; i < sections.length; i++) {
uci.remove('smscontrol_log',sections[i]['.name']);
}
return this.map.save(null, true);
};
o = s.option(form.DummyValue, 'date', _('Date'));
o = s.option(form.DummyValue, 'type', _('Type'));
o = s.option(form.DummyValue, 'from', _('From'));
o.default = "-";
o = s.option(form.DummyValue, 'to', _('To'));
o.default = "-";
o = s.option(form.DummyValue, 'message', _('Message text'));
o.default = "-";
return m.render();
}
});

View File

@ -0,0 +1,50 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require fs';
'require ui'
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('smscontrol', _('Send SMS'));
s = m.section(form.NamedSection, 'common', 'send');
o = s.option(form.Value, 'to', _('To phone number'), _('The phone number is set in the international format without \'+\''));
o.datatype = 'phonedigit';
o.cast = 'string';
o.rmempty = true;
o.optional = false;
o = s.option(form.Value, 'msgtxt', _('Message text'));
o.rmempty = true;
o.optional = false;
o = s.option(form.Button, 'sendsms',_(' '));
o.inputstyle = 'action important';
o.inputtitle = _('Send');
o.onclick = function(section_id) {
var to = document.getElementById('widget.cbid.smscontrol.common.to').value,
msgtxt = document.getElementById('widget.cbid.smscontrol.common.msgtxt').value;
if (to !== '') {
fs.exec('/usr/bin/sendsms', [String(to), String(msgtxt)]).then(function(res) {
ui.addNotification(null, [
E('p', [ _('SMS to "%s" with message "%s" generated and will be sent').format(to, msgtxt) ])
]);
}).catch(function(err) {
ui.addNotification(null, [
E('p', [ _('Error: '), err ])
]);
});
} else {
ui.addNotification(null, E('p', _('The phone number cannot be empty.')), 'error');
}
}
return m.render();
}
});

View File

@ -0,0 +1,39 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('smscontrol', _('Command over SMS'));
m.description = _('For example, if you enter \'1234\' as a password and send an SMS command \'1234;reboot\' to the router, the router will reboot');
s = m.section(form.TableSection, 'remote');
s.anonymous = true;
s.addremove = true;
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.rmempty = false;
o.editable = true;
o = s.option(form.Flag, 'ack', _('Reply via SMS'));
o.rmempty = true;
o.editable = true;
o = s.option(form.Value, 'received', _('Message text'));
o.rmempty =false;
o.optional = false;
o.editable = true;
o = s.option(form.Value, 'command', _('Linux command'));
o.rmempty =false;
o.optional = false;
o.editable = true;
return m.render();
}
});

View File

@ -0,0 +1,37 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('smscontrol', _('Command over SMS'));
m.description = _('For example, if you enter \'1234\' as a password and send an SMS command \'1234;CLI$ifconfig br-lan down\' to the router, the router will execute CLI-command ifconfig br-lan down');
s = m.section(form.TableSection, 'cli');
s.anonymous = true;
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.rmempty = false;
o.editable = true;
o = s.option(form.Flag, 'ack', _('Reply via SMS'));
o.rmempty = false;
o.editable = true;
o = s.option(form.DummyValue, 'received', _('Message text'));
o.rmempty =false;
o.value = 'CLI$any_cli_command_here';
o = s.option(form.DummyValue, 'command', _('Linux command'));
o.rmempty =false;
o.optional = false;
o.value = 'any_cli_command_here';
return m.render();
}
});

View File

@ -0,0 +1,55 @@
msgid "Allowed phone numbers"
msgstr "Allowed phone numbers"
msgid "Command over SMS"
msgstr "Command over SMS"
msgid "Command over call"
msgstr "Command over call"
msgid ""
"For example, if you enter '1234' as a password and send an SMS command '1234;"
"CLI$ifconfig br-lan down' to the router, the router will execute CLI-command "
"ifconfig br-lan down"
msgstr ""
"For example, if you enter '1234' as a password and send an SMS command '1234;"
"CLI$ifconfig br-lan down' to the router, the router will execute CLI-command "
"ifconfig br-lan down"
msgid ""
"For example, if you enter '1234' as a password and send an SMS command '1234;"
"reboot' to the router, the router will reboot"
msgstr ""
"For example, if you enter '1234' as a password and send an SMS command '1234;"
"reboot' to the router, the router will reboot"
msgid "Here you can send commands to router via a call or SMS"
msgstr "Here you can send commands to router via a call or SMS"
msgid "Linux command"
msgstr "Linux command"
msgid "Message text"
msgstr "Message text"
msgid "Reply via SMS"
msgstr "Reply via SMS"
msgid "Send"
msgstr "Send"
msgid "Send SMS"
msgstr "Send SMS"
msgid "To phone number"
msgstr "To phone number"
msgid "Universal command over SMS"
msgstr "Universal command over SMS"
msgid ""
"You can make a call from the allowed phone number and then the router will "
"execute the command"
msgstr ""
"You can make a call from the allowed phone number and then the router will "
"execute the command"

View File

@ -0,0 +1,75 @@
msgid "Allowed phone numbers"
msgstr "Разрешенные телефонные номера"
msgid "Command over SMS"
msgstr "Команда по SMS"
msgid "Command over call"
msgstr "Команда по звонку"
msgid ""
"For example, if you enter '1234' as a password and send an SMS command '1234;"
"CLI$ifconfig br-lan down' to the router, the router will execute CLI-command "
"ifconfig br-lan down"
msgstr "Например, если задать пароль '1234' и отправить SMS с текстом '1234;CLI$ifconfig br-lan down' на роутер, то роутер выполнит консольную команду ifconfig br-lan down"
msgid ""
"For example, if you enter '1234' as a password and send an SMS command '1234;"
"reboot' to the router, the router will reboot"
msgstr "Например, если задать пароль '1234' и отправить SMS с текстом '1234;reboot' на роутер, то роутер перезагрузится"
msgid "Here you can send commands to router via a call or SMS"
msgstr "Здесь осуществляется управление роутером посредством звонков или SMS"
msgid "Linux command"
msgstr "Linux-команда"
msgid "Message text"
msgstr "Текст сообщения"
msgid "Reply via SMS"
msgstr "Ответ по SMS"
msgid "Send"
msgstr "Отправить"
msgid "Send SMS"
msgstr "Отправить SMS"
msgid "To phone number"
msgstr "На телефонный номер"
msgid "Universal command over SMS"
msgstr "Универсальная команда по SMS"
msgid ""
"You can make a call from the allowed phone number and then the router will "
"execute the command"
msgstr "Если совершить звонок с разрешенного телефонного номера, роутер выполнит указанную команду"
msgid "Remote SMS Control"
msgstr "Управление по SMS"
msgid "Enable sms and call log"
msgstr "Включить логирование сообщений и звонков"
msgid "From"
msgstr "От"
msgid "To"
msgstr "Кому"
msgid "Date"
msgstr "Дата"
msgid "SMS and call log"
msgstr "Журнал сообщений и звонков"
msgid "Event log"
msgstr "Журнал событий"
msgid "Remove all"
msgstr "Удалить все"
msgid "The phone number is set in the international format without '+'"
msgstr "Номер телефона задается в международном формате без символа '+'"

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-smscontrol.json" ] && {
cat > /usr/share/ucitrack/luci-app-smscontrol.json << EEOF
{
"config": "smscontrol",
"init": "smscontrol"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@smscontrol[-1]
add ucitrack smscontrol
set ucitrack.@smscontrol[-1].init=smscontrol
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,68 @@
{
"admin/services/smscontrol": {
"title": "Remote SMS Control",
"order": 10,
"action": {
"type": "alias",
"path": "admin/services/smscontrol/general"
},
"depends": {
"acl": [ "luci-app-smscontrol" ],
"uci": { "smscontrol": true }
}
},
"admin/services/smscontrol/general": {
"title": "General Settings",
"order": 10,
"action": {
"type": "view",
"path": "smscontrol/general"
}
},
"admin/services/smscontrol/sms2cli": {
"title": "Command over SMS",
"order": 20,
"action": {
"type": "view",
"path": "smscontrol/sms2cli"
}
},
"admin/services/smscontrol/sms2ucli": {
"title": "Universal command over SMS",
"order": 30,
"action": {
"type": "view",
"path": "smscontrol/sms2ucli"
}
},
"admin/services/smscontrol/call2cli": {
"title": "Command over call",
"order": 40,
"action": {
"type": "view",
"path": "smscontrol/call2cli"
}
},
"admin/services/smscontrol/log": {
"title": "Event log",
"order": 50,
"action": {
"type": "view",
"path": "smscontrol/log"
}
},
"admin/services/smscontrol/sendsms": {
"title": "Send SMS",
"order": 60,
"action": {
"type": "view",
"path": "smscontrol/sendsms"
}
}
}

View File

@ -0,0 +1,14 @@
{
"luci-app-smscontrol": {
"description": "Grant UCI access for luci-app-smscontrol",
"read": {
"uci": [ "smscontrol" ]
},
"write": {
"uci": [ "smscontrol" ],
"file": {
"/usr/bin/sendsms": [ "exec" ]
}
}
}
}

View File

@ -0,0 +1,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-snmpd-ssl
LUCI_TITLE:=Net-SNMP LuCI interface with v3 support
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,171 @@
'use strict';
'require form';
'require view';
'require uci';
'require ui';
'require fs';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('snmpd', _('SNMP Settings'));
s = m.section(form.TypedSection, 'snmpd');
s.anonymous = true;
s.addremove = false;
s.tab('general', _('General Settings'));
s.tab('snmpv1v2c', _('SNMPv1/SNMPv2c'));
s.tab('snmpv3', _('SNMPv3'));
s.tab('system', _('System'));
o = s.taboption('general', form.Flag, 'enabled', _('Enabled'));
o.rmempty = false;
o = s.taboption('general', form.ListValue, 'ip_family', _('IP family') );
o.default = 'ipv4';
o.value('ipv4',_('IPv4'));
o.value('ipv6',_('IPv6'));
o.value('both',_('IPv4 and IPv6'));
o.write = function(section_id, value) {
var section = uci.get_first('snmpd', 'agent');
var agentaddress = uci.get('snmpd', section['.name'], 'agentaddress');
if (!agentaddress)
return null;
var port = agentaddress.match(/(?:UDP|UDP6):(\d+)/);
if (value == "ipv4") {
uci.set('snmpd', section['.name'], 'agentaddress', 'UDP:%s'.format(port[1]));
}
if (value == "ipv6") {
uci.set('snmpd', section['.name'], 'agentaddress', 'UDP6:%s'.format(port[1]));
}
if (value == "both") {
uci.set('snmpd', section['.name'], 'agentaddress', 'UDP:%s,UDP6:%s'.format(port[1],port[1]));
}
uci.set('snmpd', section_id, this.option, value)
};
o = s.taboption('general', form.Value, 'port', _('Port'), _('Port for SNMP connections'));
o.datatype = 'port';
o.rmempty = false;
o.cfgvalue = function(section_id) {
var section = uci.get_first('snmpd', 'agent');
var agentaddress = uci.get('snmpd', section['.name'], 'agentaddress');
if (!agentaddress)
return null;
var port = agentaddress.match(/(?:UDP|UDP6):(\d+)/);
return port[1];
};
o.write = function(section_id, value) {
var ip_family = uci.get('snmpd', section_id, 'ip_family');
var section = uci.get_first('snmpd', 'agent');
if (ip_family == "ipv4") {
uci.set('snmpd', section['.name'], 'agentaddress', 'UDP:%s'.format(value));
}
if (ip_family == "ipv6") {
uci.set('snmpd', section['.name'], 'agentaddress', 'UDP6:%s'.format(value));
}
if (ip_family == "both") {
uci.set('snmpd', section['.name'], 'agentaddress', 'UDP:%s,UDP6:%s'.format(value,value));
}
};
o = s.taboption('general', form.ListValue, 'mode', _('SNMP mode'));
o.default = 'v1_v2c_v3';
o.value('v1_v2c',_('SNMPv1/SNMPv2c'));
o.value('v3',_('SNMPv3'));
o.value('v1_v2c_v3',_('SNMPv1/SNMPv2c/SNMPv3'));
o = s.taboption('snmpv1v2c', form.Value, 'community_name', _('Community'), _('Community string, sent to the monitoring system along with the request'));
o.rmempty = false;
o.depends({mode: /v2c/});
o.cfgvalue = function(section_id) {
return uci.get('snmpd', 'public', 'community');
};
o.write = function(section_id, value) {
uci.set('snmpd', 'public', 'community', value);
uci.set('snmpd', 'public6', 'community', value);
};
o = s.taboption('snmpv1v2c', form.ListValue, 'v2c_mode', _('Acces mode'));
o.value('ro',_('Read-only parameters (monitoring)'));
o.depends({mode: /v2c/});
o = s.taboption('snmpv3', form.Value, 'security_name', _('Security name'), _('Username for authentication when working via SNMP'));
o.rmempty = false;
o.depends({mode: /v3/});
o = s.taboption('snmpv3', form.ListValue, 'security_type', _('Security level'), _('Security level selection when working via SNMP'));
o.default = 'noAuthNoPriv';
o.value('noAuthNoPriv',_('No authentication and encryption settings'));
o.value('authNoPriv',_('With authentication'));
o.value('authPriv',_('With authentication and encryption'));
o.depends({mode: /v3/});
o = s.taboption('snmpv3', form.ListValue, 'auth_prot', _('Authentication protocol'), _('Type of authentication protocol'));
o.default = 'authPriv';
o.value('MD5');
o.value('SHA');
o.value('SHA-224');
o.value('SHA-256');
o.value('SHA-384');
o.value('SHA-512');
o.depends({mode: /v3/, security_type: /auth/});
o = s.taboption('snmpv3', form.Value, 'auth_pass', _('Authentication passphrase'), _('Passphrase for authentication when working via SNMP'));
o.rmempty = false;
o.depends({mode: /v3/, security_type: /auth/});
o = s.taboption('snmpv3', form.ListValue, 'priv_prot', _('Privacy protocol'), _('Type of encryption protocol'));
o.default = 'authPriv';
o.value('DES');
o.value('AES');
o.depends({mode: /v3/, security_type: 'authPriv'});
o = s.taboption('snmpv3', form.Value, 'priv_pass', _('Privacy passphrase'), _('Passphrase for encrypting the data transmission channel when working via SNMP'));
o.rmempty = false;
o.depends({mode: /v3/, security_type: 'authPriv'});
o = s.taboption('snmpv3', form.ListValue, 'v3_mode', _('Acces mode'));
o.value('rouser',_('Read-only parameters (monitoring)'));
o.depends({mode: /v3/});
function system_section_cfgvalue(section_id) {
var section = uci.get_first('snmpd', 'system');
return uci.get('snmpd', section['.name'], this.option);
};
function system_section_write(section_id, value) {
var section = uci.get_first('snmpd', 'system');
uci.set('snmpd', section['.name'], this.option, value);
};
function system_section_remove(section_id) {
var section = uci.get_first('snmpd', 'system');
uci.unset('snmpd', section['.name'], this.option);
};
o = s.taboption('system', form.Value, 'sysName', _('sysName'), _('Device name in the monitoring system. This field is optional'));
o.cfgvalue = system_section_cfgvalue;
o.write = system_section_write;
o.remove = system_section_remove;
o = s.taboption('system', form.Value, 'sysContact', _('sysContact'), _('Contact information. This field is optional'));
o.cfgvalue = system_section_cfgvalue;
o.write = system_section_write;
o.remove = system_section_remove;
o = s.taboption('system', form.Value, 'sysLocation', _('sysLocation'), _('Device location description. This field is optional'));
o.cfgvalue = system_section_cfgvalue;
o.write = system_section_write;
o.remove = system_section_remove;
o = s.taboption('system', form.Value, 'sysDescr', _('sysDescr'), _('Device description. This field is optional'));
o.cfgvalue = system_section_cfgvalue;
o.write = system_section_write;
o.remove = system_section_remove;
return m.render();
}
});

View File

@ -0,0 +1,110 @@
msgid "SNMP Settings"
msgstr "SNMP Settings"
msgid "General Settings"
msgstr "General Settings"
msgid "SNMPv1/SNMPv2c"
msgstr "SNMPv1/SNMPv2c"
msgid "SNMPv3"
msgstr "SNMPv3"
msgid "System"
msgstr "System"
msgid "Enabled"
msgstr "Enabled"
msgid "IP family"
msgstr "IP family"
msgid "Port"
msgstr "Port"
msgid "Port for SNMP connections"
msgstr "Port for SNMP connections"
msgid "SNMP mode"
msgstr "SNMP mode"
msgid "Community"
msgstr "Community"
msgid "Community string, sent to the monitoring system along with the request"
msgstr "Community string, sent to the monitoring system along with the request"
msgid "Acces mode"
msgstr "Acces mode"
msgid "Read-only parameters (monitoring)"
msgstr "Read-only parameters (monitoring)"
msgid "Security name"
msgstr "Security name"
msgid "Username for authentication when working via SNMP"
msgstr "Username for authentication when working via SNMP"
msgid "Security level"
msgstr "Security level"
msgid "Security level selection when working via SNMP"
msgstr "Security level selection when working via SNMP"
msgid "No authentication and encryption settings"
msgstr "No authentication and encryption settings"
msgid "With authentication"
msgstr "With authentication"
msgid "With authentication and encryption"
msgstr "With authentication and encryption"
msgid "Authentication protocol"
msgstr "Authentication protocol"
msgid "Type of authentication protocol"
msgstr "Type of authentication protocol"
msgid "Authentication passphrase"
msgstr "Authentication passphrase"
msgid "Passphrase for authentication when working via SNMP"
msgstr "Passphrase for authentication when working via SNMP"
msgid "Privacy protocol"
msgstr "Privacy protocol"
msgid "Type of encryption protocol"
msgstr "Type of encryption protocol"
msgid "Privacy passphrase"
msgstr "Privacy passphrase"
msgid "Passphrase for encrypting the data transmission channel when working via SNMP"
msgstr "Passphrase for encrypting the data transmission channel when working via SNMP"
msgid "sysName"
msgstr "sysName"
msgid "Device name in the monitoring system. This field is optional"
msgstr "Device name in the monitoring system. This field is optional"
msgid "sysContact"
msgstr "sysContact"
msgid "Contact information. This field is optional"
msgstr "Contact information. This field is optional"
msgid "sysLocation"
msgstr "sysLocation"
msgid "Device location description. This field is optional"
msgstr "Device location description. This field is optional"
msgid "sysDescr"
msgstr "sysDescr"
msgid "Device description. This field is optional"
msgstr "Device description. This field is optional"

View File

@ -0,0 +1,110 @@
msgid "SNMP Settings"
msgstr "Настройки SNMP"
msgid "General Settings"
msgstr "General Settings"
msgid "SNMPv1/SNMPv2c"
msgstr "SNMPv1/SNMPv2c"
msgid "SNMPv3"
msgstr "SNMPv3"
msgid "System"
msgstr "Описание системы"
msgid "Enabled"
msgstr "Включено"
msgid "IP family"
msgstr "IP family"
msgid "Port"
msgstr "Port"
msgid "Port for SNMP connections"
msgstr "Порт для подключений по SNMP"
msgid "SNMP mode"
msgstr "SNMP mode"
msgid "Community"
msgstr "Community"
msgid "Community string, sent to the monitoring system along with the request"
msgstr "Строка сообщества, отправляется в систему мониторинга вместе с запросом"
msgid "Acces mode"
msgstr "Acces mode"
msgid "Read-only parameters (monitoring)"
msgstr "Только чтение параметров (мониторинг)"
msgid "Security name"
msgstr "Security name"
msgid "Username for authentication when working via SNMP"
msgstr "Имя пользователя для авторизации при работе по SNMP"
msgid "Security level"
msgstr "Security level"
msgid "Security level selection when working via SNMP"
msgstr "Выбор уровня защиты при работе по SNMP"
msgid "No authentication and encryption settings"
msgstr "Без настроек авторизации и шифрования"
msgid "With authentication"
msgstr "С авторизацией"
msgid "With authentication and encryption"
msgstr "С авторизацией и шифрованием"
msgid "Authentication protocol"
msgstr "Authentication protocol"
msgid "Type of authentication protocol"
msgstr "Протокол авторизации"
msgid "Authentication passphrase"
msgstr "Authentication passphrase"
msgid "Passphrase for authentication when working via SNMP"
msgstr "Ключевая фраза для авторизации при работе по SNMP"
msgid "Privacy protocol"
msgstr "Privacy protocol"
msgid "Type of encryption protocol"
msgstr "Протокол шифрования"
msgid "Privacy passphrase"
msgstr "Privacy passphrase"
msgid "Passphrase for encrypting the data transmission channel when working via SNMP"
msgstr "Ключевая фраза для шифрования канала передачи данных при работе по SNMP"
msgid "sysName"
msgstr "sysName"
msgid "Device name in the monitoring system. This field is optional"
msgstr "Имя устройства в системе мониторинга. Поле не обязательно для заполнения"
msgid "sysContact"
msgstr "sysContact"
msgid "Contact information. This field is optional"
msgstr "Контактные данные. Поле не обязательно для заполнения"
msgid "sysLocation"
msgstr "sysLocation"
msgid "Device location description. This field is optional"
msgstr "Описание местоположения устройства. Поле не обязательно для заполнения"
msgid "sysDescr"
msgstr "sysDescr"
msgid "Device description. This field is optional"
msgstr "Описание устройства. Поле не обязательно для заполнения"

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-snmpd.json" ] && {
cat > /usr/share/ucitrack/luci-app-snmpd.json << EEOF
{
"config": "snmpd",
"init": "snmpd"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@snmpd[-1]
add ucitrack snmpd
set ucitrack.@snmpd[-1].init=snmpd
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,13 @@
{
"admin/services/snmpd-ssl": {
"title": "SNMP",
"order": 70,
"action": {
"type": "view",
"path": "snmpd-ssl/snmpd-ssl"
},
"depends": {
"acl": [ "luci-app-snmpd-ssl" ]
}
}
}

View File

@ -0,0 +1,11 @@
{
"luci-app-snmpd-ssl": {
"description": "Grant UCI access for luci-app-snmpd-ssl",
"read": {
"uci": [ "snmpd" ]
},
"write": {
"uci": [ "snmpd" ]
}
}
}

View File

@ -0,0 +1,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-strongswan
LUCI_TITLE:=LuCI interface for Strongswan configuration
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,182 @@
'use strict';
'require fs';
'require rpc';
'require uci';
'require view';
'require form';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('ipsec', _('IPsec (Internet Protocol Security)'));
m.description = _('strongSwan IPsec Configuration');
s = m.section(form.GridSection, 'conn', _('Settings'));
s.tab('general', _('General Settings'));
s.tab('phase1', _('Phase 1'));
s.tab('phase2', _('Phase 2'));
s.addremove = true;
s.nodescriptions = true;
o = s.taboption('general', form.Flag, 'enabled', _('Enabled'));
o.rmempty = false;
o = s.taboption('general', form.ListValue, 'keyexchange', _('IKE version'), _('Method of key exchange'));
o.default = 'ikev2';
o.value('ikev1',_('IKEv1'));
o.value('ikev2',_('IKEv2'));
o = s.taboption('general', form.ListValue, 'aggressive', _('Mode'), _('ISAKMP (Internet Security Association and Key Management Protocol) phase 1 exchange mode'));
o.default = 'no';
o.value('no',_('Main'));
o.value('yes',_('Aggressive'));
o.depends({keyexchange: 'ikev1'});
o.modalonly = true;
o = s.taboption('general', form.Value, 'psk_key', _('Preshared key'), _('A shared password to authenticate between the peers'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.ListValue, 'leftidtype', _('Local identifier type'), _('Choose one accordingly to your IPSec configuration'));
o.default = 'address';
o.value('address',_('Address'));
o.value('fqdn',_('FQDN'));
o.value('user_fqdn',_('User FQDN'));
o.modalonly = true;
o = s.taboption('general', form.Value, 'leftid', _('Local identifier'), _('Set the device identifier for IPSec tunnel'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.DynamicList, 'leftsubnet', _('Local IP address/Subnet mask'));
o.placeholder = '192.168.88.0/24'
o.datatype = 'ipaddr'
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.ListValue, 'rightidtype', _('Remote identifier type'), _('Choose one accordingly to your IPSec configuration'));
o.default = 'address';
o.value('address',_('Address'));
o.value('fqdn',_('FQDN'));
o.value('user_fqdn',_('User FQDN'));
o.modalonly = true;
o = s.taboption('general', form.Value, 'rightid', _('Remote identifier'), _('Set the remote identifier for IPSec tunnel'));
o.rmempty = false;
o.modalonly = true;
o = s.taboption('general', form.Value, 'right', _('Remote VPN endpoint'), _('Domain name or IP address. Leave empty for any'));
o.datatype = 'host'
o.textvalue = function(section_id) {
if(!uci.get('ipsec', section_id, 'right')) {
return _('any')
} else {
return uci.get('ipsec', section_id, 'right')
}
};
o = s.taboption('general', form.DynamicList, 'rightsubnet', _('Remote IP address/Subnet mask'), _('Should differ from local IP address/Subnet mask'));
o.placeholder = '192.168.100.0/24'
o.datatype = 'ipaddr'
o.rmempty = false;
o = s.taboption('general', form.ListValue, 'dpdaction', _('Dead Peer Detection action'));
o.default = 'restart';
o.value('none');
o.value('restart');
o.rmempty = false;
o = s.taboption('general', form.Value, 'dpddelay', _('DPD delay (sec)'), _('Delay between peer acknowledgement requests'));
o.default = '30';
o.datatype = 'and(uinteger, min(0))'
o.rmempty = false;
o.modalonly = true;
o.depends({dpdaction: 'restart'});
o = s.taboption('phase1', form.ListValue, 'ike_encryption_algorithm', _('Encryption algorithm'), _('The encryption algorithm must match with another incoming connection to establish IPSec'));
o.default = '3des';
o.value('des',_('DES'));
o.value('3des',_('3DES'));
o.value('aes128',_('AES128'));
o.value('aes192',_('AES192'));
o.value('aes256',_('AES256'));
o.modalonly = true;
o = s.taboption('phase1', form.ListValue, 'ike_authentication_algorithm', _('Authentication algorithm'), _('The authentication algorithm must match with another incoming connection to establish IPSec'));
o.default = 'sha1';
o.value('md5',_('MD5'));
o.value('sha1',_('SHA1'));
o.value('sha256',_('SHA256'));
o.value('sha384',_('SHA384'));
o.value('sha512',_('SHA512'));
o.modalonly = true;
o = s.taboption('phase1', form.ListValue, 'ike_dh_group', _('DH group'), _('The DH (Diffie-Hellman) group must match with another incoming connection to establish IPSec'));
o.default = 'modp1536';
o.value('modp768',_('MODP768'));
o.value('modp1024',_('MODP1024'));
o.value('modp1536',_('MODP1536'));
o.value('modp2048',_('MODP2048'));
o.value('modp3072',_('MODP3072'));
o.value('modp4096',_('MODP4096'));
o.modalonly = true;
o = s.taboption('phase1', form.Value, 'ikelifetime', _('Lifetime'), _('The time duration for phase 1'));
o.datatype = 'and(uinteger, min(0))'
o.default = '8';
o.modalonly = true;
o = s.taboption('phase1', form.ListValue, 'ikeletter', _('in'));
o.default = 'h';
o.value('h',_('hours'));
o.value('m',_('minutes'));
o.value('s',_('seconds'));
o.modalonly = true;
o = s.taboption('phase2', form.ListValue, 'esp_encryption_algorithm', _('Encryption algorithm'), _('The encryption algorithm must match with another incoming connection to establish IPSec'));
o.default = '3des';
o.value('des',_('DES'));
o.value('3des',_('3DES'));
o.value('aes128',_('AES128'));
o.value('aes192',_('AES192'));
o.value('aes256',_('AES256'));
o.modalonly = true;
o = s.taboption('phase2', form.ListValue, 'esp_hash_algorithm', _('Hash algorithm'), _('The hash algorithm must match with another incoming connection to establish IPSec'));
o.default = 'sha1';
o.value('md5',_('MD5'));
o.value('sha1',_('SHA1'));
o.value('sha256',_('SHA256'));
o.value('sha384',_('SHA384'));
o.value('sha512',_('SHA512'));
o.modalonly = true;
o = s.taboption('phase2', form.ListValue, 'esp_pfs_group', _('PFS group'), _('The PFS (Perfect Forward Secrecy) group must match with another incoming connection to establish IPSec'));
o.default = 'modp1536';
o.value('modp768',_('MODP768'));
o.value('modp1024',_('MODP1024'));
o.value('modp1536',_('MODP1536'));
o.value('modp2048',_('MODP2048'));
o.value('modp3072',_('MODP3072'));
o.value('modp4096',_('MODP4096'));
o.value('no_pfs',_('No PFS'));
o.modalonly = true;
o = s.taboption('phase2', form.Value, 'keylife', _('Lifetime'), _('The time duration for phase 2'));
o.datatype = 'and(uinteger, min(0))'
o.default = '8';
o.modalonly = true;
o = s.taboption('phase2', form.ListValue, 'letter', _('in'));
o.default = 'h';
o.value('h',_('hours'));
o.value('m',_('minutes'));
o.value('s',_('seconds'));
o.modalonly = true;
return m.render();
}
});

View File

@ -0,0 +1,137 @@
msgid "IPsec Configuration"
msgstr "IPsec Configuration"
msgid "Enable IPsec (Internet Protocol Security)"
msgstr "Enable IPsec (Internet Protocol Security)"
msgid "IKE version"
msgstr "IKE version"
msgid "Method of key exchange"
msgstr "Method of key exchange"
msgid "ISAKMP (Internet Security Association and Key Management Protocol) phase 1 exchange mode"
msgstr "ISAKMP (Internet Security Association and Key Management Protocol) phase 1 exchange mode"
msgid "My identifier type"
msgstr "My identifier type"
msgid "Choose one accordingly to your IPSec configuration"
msgstr "Choose one accordingly to your IPSec configuration"
msgid "My identifier"
msgstr "My identifier"
msgid "Set the device identifier for IPSec tunnel"
msgstr "Set the device identifier for IPSec tunnel"
msgid "Remote identifier type"
msgstr "Remote identifier type"
msgid "Choose one accordingly to your IPSec configuration"
msgstr "Choose one accordingly to your IPSec configuration"
msgid "Remote identifier"
msgstr "Remote identifier"
msgid "Set the remote identifier for IPSec tunnel"
msgstr "Set the remote identifier for IPSec tunnel"
msgid "The values clear, hold, and restart all activate DPD."
msgstr "The values clear, hold, and restart all activate DPD."
msgid "Dead Peer Detection"
msgstr "Dead Peer Detection"
msgid "Pre shared key"
msgstr "Pre shared key"
msgid "A shared password to authenticate between the peers."
msgstr "A shared password to authenticate between the peers."
msgid "Remote VPN endpoint"
msgstr "Remote VPN endpoint"
msgid "Domain name or IP address. Leave empty for any"
msgstr "Domain name or IP address. Leave empty for any"
msgid "Local IP address/Subnet mask"
msgstr "Local IP address/Subnet mask"
msgid "Remote IP address/Subnet mask"
msgstr "Remote IP address/Subnet mask"
msgid "Remote network secure group IP address and mask used to determine to what subnet an IP address belongs to. Range [0 - 32]. IP should differ from device LAN IP"
msgstr "Remote network secure group IP address and mask used to determine to what subnet an IP address belongs to. Range [0 - 32]. IP should differ from device LAN IP"
msgid "Enable keepalive"
msgstr "Enable keepalive"
msgid "Enable tunnel keep alive"
msgstr "Enable tunnel keep alive"
msgid "A host address to which ICMP (Internet Control Message Protocol) echo requests will be sent"
msgstr "A host address to which ICMP (Internet Control Message Protocol) echo requests will be sent"
msgid "Ping period (sec)"
msgstr "Ping period (sec)"
msgid "Send ICMP (Internet Control Message Protocol) echo request every x seconds. Range [0 - 9999999]"
msgstr "Send ICMP (Internet Control Message Protocol) echo request every x seconds. Range [0 - 9999999]"
msgid "The phase must match with another incoming connection to establish IPSec"
msgstr "The phase must match with another incoming connection to establish IPSec"
msgid "Encryption algorithm"
msgstr "Encryption algorithm"
msgid "The encryption algorithm must match with another incoming connection to establish IPSec"
msgstr "The encryption algorithm must match with another incoming connection to establish IPSec"
msgid "The authentication algorithm must match with another incoming connection to establish IPSec"
msgstr "The authentication algorithm must match with another incoming connection to establish IPSec"
msgid "DH group"
msgstr "DH group"
msgid "Lifetime"
msgstr "Lifetime"
msgid "in"
msgstr "in"
msgid "The DH (Diffie-Hellman) group must match with another incoming connection to establish IPSec"
msgstr "The DH (Diffie-Hellman) group must match with another incoming connection to establish IPSec"
msgid "The time duration for phase 1"
msgstr "The time duration for phase 1"
msgid "Phase"
msgstr "Phase"
msgid "Phase 1"
msgstr "Phase 1"
msgid "Phase 2"
msgstr "Phase 2"
msgid "Hash algorithm"
msgstr "Hash algorithm"
msgid "The hash algorithm must match with another incoming connection to establish IPSec"
msgstr "The hash algorithm must match with another incoming connection to establish IPSec"
msgid "PFS group"
msgstr "PFS group"
msgid "The PFS (Perfect Forward Secrecy) group must match with another incoming connection to establish IPSec"
msgstr "The PFS (Perfect Forward Secrecy) group must match with another incoming connection to establish IPSec"
msgid "The time duration for phase 2"
msgstr "The time duration for phase 2"
msgid "Name"
msgstr "Name"
msgid "There are no IPsec configurations yet"
msgstr "There are no IPsec configurations yet"

View File

@ -0,0 +1,137 @@
msgid "IPsec Configuration"
msgstr "Конфигурация IPsec"
msgid "Enable IPsec (Internet Protocol Security)"
msgstr "Включить IPsec (Internet Protocol Security)"
msgid "IKE version"
msgstr "Версия IKE"
msgid "Method of key exchange"
msgstr "Протокол обмена ключами"
msgid "ISAKMP (Internet Security Association and Key Management Protocol) phase 1 exchange mode"
msgstr "ISAKMP (Internet Security Association and Key Management Protocol) режим обмена первой фазы"
msgid "My identifier type"
msgstr "Тип локального идентификатора"
msgid "Choose one accordingly to your IPSec configuration"
msgstr "Выберите в соответствии с вашей конфигурацией IPsec"
msgid "My identifier"
msgstr "Локальный идентификатор"
msgid "Set the device identifier for IPSec tunnel"
msgstr "Укажите локальный идентификатор для IPsec туннеля"
msgid "Remote identifier type"
msgstr "Тип удаленного идентификатора"
msgid "Choose one accordingly to your IPSec configuration"
msgstr "Выберите в соответствии с вашей конфигурацией IPsec"
msgid "Remote identifier"
msgstr "Удаленный идентификатор"
msgid "Set the remote identifier for IPSec tunnel"
msgstr "Укажите удаленный идентификатор для IPsec туннеля"
msgid "The values clear, hold, and restart all activate DPD."
msgstr "Использовать DPD"
msgid "Dead Peer Detection"
msgstr "Dead Peer Detection"
msgid "Pre shared key"
msgstr "Общий ключ"
msgid "A shared password to authenticate between the peers."
msgstr "Общий ключ для идентификации между участниками"
msgid "Remote VPN endpoint"
msgstr "Удаленная точка туннеля"
msgid "Domain name or IP address. Leave empty for any"
msgstr "Доменное имя или IP адрес. Оставьте пустым для любых входящих соединений"
msgid "Local IP address/Subnet mask"
msgstr "Локальная подсеть/маска подсети"
msgid "Remote IP address/Subnet mask"
msgstr "Удаленная подсеть/маска подсети"
msgid "Remote network secure group IP address and mask used to determine to what subnet an IP address belongs to. Range [0 - 32]. IP should differ from device LAN IP"
msgstr "Подсеть и маска на удаленном устройстве. Диапазон [0-32]. Подсети на локальном и удаленном устройстве не должны совпадать"
msgid "Enable keepalive"
msgstr "Включить поддержку активности"
msgid "Enable tunnel keep alive"
msgstr "Включить поддержку активности туннеля"
msgid "A host address to which ICMP (Internet Control Message Protocol) echo requests will be sent"
msgstr "Адрес хоста, на который будут отправляться эхо-запросы ICMP (Internet Control Message Protocol) "
msgid "Ping period (sec)"
msgstr "Период отправки ping-запроса (сек)"
msgid "Send ICMP (Internet Control Message Protocol) echo request every x seconds. Range [0 - 9999999]"
msgstr "Отправлять ICMP (Internet Control Message Protocol) эхо-запросы каждые x секунд. Диапазон [0 - 9999999]"
msgid "The phase must match with another incoming connection to establish IPSec"
msgstr "Фаза должна совпадать с другим входящим подключением для установки IPSec"
msgid "Encryption algorithm"
msgstr "Алгоритм шифрования"
msgid "The encryption algorithm must match with another incoming connection to establish IPSec"
msgstr "Алгоритм шифрования должен совпадать с другим входящим подключением для установки IPSec"
msgid "The authentication algorithm must match with another incoming connection to establish IPSec"
msgstr "Аутентификационный алгоритм должен совпадать с другим входящим подключением для установки IPSec"
msgid "DH group"
msgstr "Группа Диффи-Хелмана"
msgid "Lifetime"
msgstr "Время жизни"
msgid "in"
msgstr "в"
msgid "The DH (Diffie-Hellman) group must match with another incoming connection to establish IPSec"
msgstr "Группа Диффи-Хелмана должна совпадать с другим входящим подключением для установки IPSec"
msgid "The time duration for phase 1"
msgstr "Продолжительность фазы 1"
msgid "Phase"
msgstr "Фаза"
msgid "Phase 1"
msgstr "Фаза 1"
msgid "Phase 2"
msgstr "Фаза 2"
msgid "Hash algorithm"
msgstr "Алгоритм хэширования"
msgid "The hash algorithm must match with another incoming connection to establish IPSec"
msgstr "Алгоритм хиширования должен совпадать с другим входящим подключением для установки IPSec"
msgid "PFS group"
msgstr "Группа PFS"
msgid "The PFS (Perfect Forward Secrecy) group must match with another incoming connection to establish IPSec"
msgstr "Группа PFS должна совпадать с другим входящим подключением для установки IPSec"
msgid "The time duration for phase 2"
msgstr "Продолжительность фазы 2"
msgid "Name"
msgstr "Имя"
msgid "There are no IPsec configurations yet"
msgstr "Конфигурации IPsec отсутствуют"

View File

@ -0,0 +1,14 @@
{
"admin/vpn/strongswan": {
"title": "IPsec",
"order": 85,
"action": {
"type": "view",
"path": "strongswan/strongswan"
},
"depends": {
"acl": [ "luci-app-strongswan" ],
"uci": { "ipsec": true }
}
}
}

View File

@ -0,0 +1,11 @@
{
"luci-app-strongswan": {
"description": "Grant UCI access for luci-app-strongswan",
"read": {
"uci": [ "ipsec" ]
},
"write": {
"uci": [ "ipsec" ]
}
}
}

11
luci-app-xl2tpd/Makefile Executable file
View File

@ -0,0 +1,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-xl2tpd
LUCI_TITLE:=xl2tpd server configuration
LUCI_DEPENDS:=+luci-base
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,33 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('xl2tpd', _('L2TP Server'));
m.description = _('Simple, quick and convenient L2TP VPN, universal across the platform');
s = m.section(form.NamedSection, 'xl2tpd', 'xl2tpd');
o = s.option(form.Flag, 'enabled', _('Enable L2TP Server'));
o = s.option(form.Value, 'localip', _('Local IP'));
o.placeholder = '192.168.0.1';
o.datatype = 'ipaddr';
o = s.option(form.Value, 'remoteip_start', _('Remote IP Range Start'));
o.placeholder = '192.168.0.20';
o.datatype = 'ipaddr';
o = s.option(form.Value, 'remoteip_end', _('Remote IP Range End'));
o.placeholder = '192.168.0.30';
o.datatype = 'ipaddr';
return m.render();
}
});

View File

@ -0,0 +1,51 @@
'use strict';
'require view';
'require fs';
'require ui';
'require rpc';
return view.extend({
load: function() {
return fs.lines('/tmp/xl2tpd/clients');
},
updateTable: function(table, data) {
var rows = [];
for (var i = 0; i < data.length; i++) {
var client = data[i];
var info = client.split(';').map((part) => part.split(':')[1]);
rows.push([
info[0],
info[1],
info[2]
]);
}
cbi_update_table(table, rows, E('em', _('No information available')));
},
render: function(data) {
var v = E([], [
E('h2', _('L2TP Server')),
E('div', { 'class': 'cbi-map-descr' }, _('Simple, quick and convenient L2TP VPN, universal across the platform')),
E('table', { 'class': 'table' }, [
E('tr', { 'class': 'tr table-titles' }, [
E('th', { 'class': 'th' }, _('Interface')),
E('th', { 'class': 'th' }, _('Server IP')),
E('th', { 'class': 'th' }, _('Client IP'))
])
])
]);
this.updateTable(v.lastElementChild, data);
return v;
},
handleSaveApply: null,
handleSave: null,
handleReset: null
});

View File

@ -0,0 +1,38 @@
'use strict';
'require form';
'require view';
'require uci';
'require rpc';
'require tools.widgets as widgets';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('xl2tpd', _('L2TP Server'));
m.description = _('Simple, quick and convenient L2TP VPN, universal across the platform');
s = m.section(form.TableSection, 'login');
s.anonymous = true;
s.addremove = true;
o = s.option(form.Flag, 'enabled', _('Enabled'));
o.editable = true;
o = s.option(form.Value, 'username', _('User name'));
o.editable = true;
o = s.option(form.Value, 'password', _('Password'));
o.editable = true;
o = s.option(form.Value, 'remoteip', _('IP address'));
o.editable = true;
o.datatype = 'ipaddr';
o = s.option(form.Value, 'route', _('Add route'));
o.editable = true;
o.datatype = "ipaddr"
return m.render();
}
});

View File

@ -0,0 +1,32 @@
msgid "L2TP Server"
msgstr "L2TP Server"
msgid "Simple, quick and convenient L2TP VPN, universal across the platform"
msgstr "Simple, quick and convenient L2TP VPN, universal across the platform"
msgid "Users Manager"
msgstr "Users Manager"
msgid "Online Users"
msgstr "Online Users"
msgid "Enable L2TP Server"
msgstr "Enable L2TP Server"
msgid "Local IP"
msgstr "Local IP"
msgid "Remote IP Range Start"
msgstr "Remote IP Range Start"
msgid "Remote IP Range End"
msgstr "Remote IP Range End"
msgid "Add route"
msgstr "Add route"
msgid "Server IP"
msgstr "Server IP"
msgid "Client IP"
msgstr "Client IP"

View File

@ -0,0 +1,32 @@
msgid "L2TP Server"
msgstr "L2TP-сервер"
msgid "Simple, quick and convenient L2TP VPN, universal across the platform"
msgstr "Простой, быстрый, удобный и мультиплатформенный L2TP VPN"
msgid "Users Manager"
msgstr "Управление пользователями"
msgid "Online Users"
msgstr "Подключенные пользователи"
msgid "Enable L2TP Server"
msgstr "Включить L2TP-сервер"
msgid "Local IP"
msgstr "Локальный IP-адрес сервера"
msgid "Remote IP Range Start"
msgstr "Начало диапазона IP-адресов клиентов"
msgid "Remote IP Range End"
msgstr "Конец диапазона IP-адресов клиентов"
msgid "Add route"
msgstr "Добавить маршрут"
msgid "Server IP"
msgstr "IP-адрес сервера"
msgid "Client IP"
msgstr "IP-адрес клиента"

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-xl2tpd.json" ] && {
cat > /usr/share/ucitrack/luci-app-xl2tpd.json << EEOF
{
"config": "xl2tpd",
"init": "xl2tpd"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@xl2tpd[-1]
add ucitrack xl2tpd
set ucitrack.@xl2tpd[-1].init=xl2tpd
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,40 @@
{
"admin/vpn/xl2tpd": {
"title": "L2TP Server",
"order": 60,
"action": {
"type": "alias",
"path": "admin/vpn/xl2tpd/general"
},
"depends": {
"acl": [ "luci-app-xl2tpd" ]
}
},
"admin/vpn/xl2tpd/general": {
"title": "General Settings",
"order": 10,
"action": {
"type": "view",
"path": "xl2tpd/general"
}
},
"admin/vpn/xl2tpd/user": {
"title": "Users Manager",
"order": 20,
"action": {
"type": "view",
"path": "xl2tpd/user"
}
},
"admin/vpn/xl2tpd/online": {
"title": "Online Users",
"order": 30,
"action": {
"type": "view",
"path": "xl2tpd/online"
}
}
}

View File

@ -0,0 +1,14 @@
{
"luci-app-xl2tpd": {
"description": "Grant UCI access for luci-app-xl2tpd",
"read": {
"uci": [ "xl2tpd" ],
"file": {
"/tmp/xl2tpd/clients": [ "read" ]
},
},
"write": {
"uci": [ "xl2tpd" ]
}
}
}

12
luci-app-zabbix/Makefile Normal file
View File

@ -0,0 +1,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-zabbix
LUCI_TITLE:=zabbix agentd configuration
LUCI_DEPENDS:=+luci-base
LUCI_DEPENDS:=zabbix-agentd-ssl
LUCI_PKGARCH:=all
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,81 @@
'use strict';
'require form';
'require view';
'require uci';
'require ui';
'require fs';
return view.extend({
render: function() {
var m, s, o;
m = new form.Map('zabbix', _('Zabbix Agent configuration'));
s = m.section(form.TypedSection, 'zabbix');
s.anonymous = true;
s.addremove = false;
s.tab('general', _('General Settings'));
s.tab('passive', _('Passive Checks'));
s.tab('active', _('Active Checks'));
s.tab('tls', _('TLS Configuration'));
o = s.taboption('general', form.Flag, 'enabled', _('Enabled'));
o.rmempty = false;
o = s.taboption('general', form.Value, 'hostname', _('Hostname'), _('Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server.'));
o.rmempty = false;
o.datatype = 'host';
o.cfgvalue = function(section_id) {
return uci.get('zabbix', section_id, 'hostname') || fs.trimmed('/proc/sys/kernel/hostname')
};
o = s.taboption('passive', form.DynamicList, 'server', _('Server'), _('List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address.'));
o.rmempty = false;
o.datatype = 'or(cidr,ipmask,host)';
o = s.taboption('passive', form.Value, 'listen_ip', _('ListenIP'), _('IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server.'));
o.datatype = 'host';
o = s.taboption('passive', form.Value, 'listen_port', _('ListenPort'), _('The agent will listen on this port for connections from the server.'));
o.placeholder = 10050;
o.datatype = 'range(1024,32767)';
o = s.taboption('passive', form.ListValue, 'tls_accept', _('TLSAccept'), _('The parameter defines which types of TLS connections the agent will accept.'));
o.default = 'unencrypted';
o.value('unencrypted',_('without encryption'));
o.value('psk',_('pre-shared key'));
o.value('cert',_('certificate'));
o = s.taboption('active', form.Value, 'server_active', _('ServerActive'), _('IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled.'));
o.datatype = 'or(cidr,host,hostport,ipaddrport)';
o = s.taboption('active', form.ListValue, 'tls_connect', _('TLSConnect'), _('The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy.'));
o.default = 'unencrypted';
o.value('unencrypted',_('without encryption'));
o.value('psk',_('pre-shared key'));
o.value('cert',_('certificate'));
o = s.taboption('tls', form.Value, 'tls_psk_identity', _('TLSPSKIdentity'), _('Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server.'));
o.depends({tls_accept: 'psk'});
o.depends({tls_connect: 'psk'});
o = s.taboption('tls', form.FileUpload, 'tls_psk_file', _('TLSPSKFile'), _('Agent pre-shared key.'));
o.depends({tls_accept: 'psk'});
o.depends({tls_connect: 'psk'});
o = s.taboption('tls', form.FileUpload, 'tls_ca_file', _('TLSCAFile'), _('Root CA certificate. Used for encrypted connections between Zabbix components.'));
o.depends({tls_accept: 'cert'});
o.depends({tls_connect: 'cert'});
o = s.taboption('tls', form.FileUpload, 'tls_cert_file', _('TLSCertFile'), _('Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components.'));
o.depends({tls_accept: 'cert'});
o.depends({tls_connect: 'cert'});
o = s.taboption('tls', form.FileUpload, 'tls_key_file', _('TLSKeyFile'), _('Agent private key.'));
o.depends({tls_accept: 'cert'});
o.depends({tls_connect: 'cert'});
return m.render();
}
});

95
luci-app-zabbix/po/en/zabbix.po Executable file
View File

@ -0,0 +1,95 @@
msgid "Zabbix Agent configuration"
msgstr "Zabbix Agent configuration"
msgid "General Settings"
msgstr "General Settings"
msgid "Passive Checks"
msgstr "Passive Checks"
msgid "Active Checks"
msgstr "Active Checks"
msgid "TLS Configuration"
msgstr "TLS Configuration"
msgid "Enabled"
msgstr "Enabled"
msgid "Hostname"
msgstr "Hostname"
msgid "Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server."
msgstr "Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server."
msgid "Server"
msgstr "Server"
msgid "List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address."
msgstr "List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address."
msgid "IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server."
msgstr "IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server."
msgid "ListenPort"
msgstr "ListenPort"
msgid "The agent will listen on this port for connections from the server."
msgstr "The agent will listen on this port for connections from the server."
msgid "TLSAccept"
msgstr "TLSAccept"
msgid "The parameter defines which types of TLS connections the agent will accept."
msgstr "The parameter defines which types of TLS connections the agent will accept."
msgid "without encryption"
msgstr "without encryption"
msgid "pre-shared key"
msgstr "pre-shared key"
msgid "certificate"
msgstr "certificate"
msgid "ServerActive"
msgstr "ServerActive"
msgid "IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled."
msgstr "IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled."
msgid "TLSConnect"
msgstr "TLSConnect"
msgid "The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy."
msgstr "The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy."
msgid "TLSPSKIdentity"
msgstr "TLSPSKIdentity"
msgid "Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server."
msgstr "Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server."
msgid "TLSPSKFile"
msgstr "TLSPSKFile"
msgid "Agent pre-shared key."
msgstr "Agent pre-shared key."
msgid "TLSCAFile"
msgstr "TLSCAFile"
msgid "Root CA certificate. Used for encrypted connections between Zabbix components."
msgstr "Root CA certificate. Used for encrypted connections between Zabbix components."
msgid "TLSCertFile"
msgstr "TLSCertFile"
msgid "Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components."
msgstr "Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components."
msgid "TLSKeyFile"
msgstr "TLSKeyFile"
msgid "Agent private key."
msgstr "Agent private key."

95
luci-app-zabbix/po/ru/zabbix.po Executable file
View File

@ -0,0 +1,95 @@
msgid "Zabbix Agent configuration"
msgstr "Настройки Zabbix Agent"
msgid "General Settings"
msgstr "Основные настройки"
msgid "Passive Checks"
msgstr "Пассивные проверки"
msgid "Active Checks"
msgstr "Активные проверки"
msgid "TLS Configuration"
msgstr "TLS шифрование"
msgid "Enabled"
msgstr "Включить"
msgid "Hostname"
msgstr "Hostname"
msgid "Unique hostname used by the agent to register with the Zabbix server. Required for active checks and must match the node name specified on the server."
msgstr "Уникальное имя хоста, используемое агентом для регистрации на сервере Zabbix. Необходимо для активных проверок и должно соответствовать имени узла, указанному на сервере."
msgid "Server"
msgstr "Server"
msgid "List of IP addresses (or hostnames) of Zabbix servers allowed to connect to this agent. If 0.0.0.0/0 is specified, the agent will accept connections from any IP address."
msgstr "Список IP-адресов (или имён хостов) серверов Zabbix, которым разрешено подключаться к этому агенту. Если указать 0.0.0.0/0, агент будет принимать подключения с любого IP-адреса."
msgid "IP address of the local network interfaces on which the Zabbix agent will listen for incoming connections from the server."
msgstr "IP-адрес локальных сетевых интерфейсов, на которых Zabbix-агент будет ожидать входящие соединения от сервера."
msgid "ListenPort"
msgstr "ListenPort"
msgid "The agent will listen on this port for connections from the server."
msgstr "Агент будет слушать этот порт для подключений с сервера."
msgid "TLSAccept"
msgstr "TLSAccept"
msgid "The parameter defines which types of TLS connections the agent will accept."
msgstr "Параметр определяет, какие типы TLS-соединений агент будет принимать."
msgid "without encryption"
msgstr "без шифрования"
msgid "pre-shared key"
msgstr "pre-shared ключ"
msgid "certificate"
msgstr "сертификат"
msgid "ServerActive"
msgstr "ServerActive"
msgid "IP address or hostname of the Zabbix server for active checks. If the parameter is not specified, active checks are disabled."
msgstr "IP адрес или имя хоста Zabbix-сервера для активных проверок. Если параметр не указан, активные проверки отключены."
msgid "TLSConnect"
msgstr "TLSConnect"
msgid "The parameter defines how the agent should establish a secure connection with the Zabbix server or proxy."
msgstr "Параметр определяет, как агент должен устанавливать защищенное соединение с Zabbix-сервером или прокси."
msgid "TLSPSKIdentity"
msgstr "TLSPSKIdentity"
msgid "Pre-shared key identifier string. Used for unique identification and management of the pre-shared key, ensuring the security of the connection between the agent and the server."
msgstr "Строка идентификатор pre-shared ключа. Используется для уникальной идентификации и управления предустановленным ключом, обеспечивая безопасность соединения между агентом и сервером."
msgid "TLSPSKFile"
msgstr "TLSPSKFile"
msgid "Agent pre-shared key."
msgstr "Pre-shared ключ агента."
msgid "TLSCAFile"
msgstr "TLSCAFile"
msgid "Root CA certificate. Used for encrypted connections between Zabbix components."
msgstr "Сертификат верхнего уровня CA. Используется для зашифрованных соединений между Zabbix компонентами."
msgid "TLSCertFile"
msgstr "TLSCertFile"
msgid "Agent certificate or certificate chain used to establish secure (TLS/SSL) connections between Zabbix components."
msgstr "Сертификат агента или цепочка сертификатов, используемых для установления защищенных (TLS/SSL) соединений между компонентами Zabbix."
msgid "TLSKeyFile"
msgstr "TLSKeyFile"
msgid "Agent private key."
msgstr "Приватный ключ агента."

View File

@ -0,0 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-zabbix.json" ] && {
cat > /usr/share/ucitrack/luci-app-zabbix.json << EEOF
{
"config": "zabbix",
"init": "zabbix"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@zabbix[-1]
add ucitrack zabbix
set ucitrack.@zabbix[-1].init=zabbix_agentd
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,12 @@
{
"admin/services/zabbix": {
"title": "Zabbix Agent",
"action": {
"type": "view",
"path": "zabbix/zabbix"
},
"depends": {
"acl": [ "luci-app-zabbix" ]
}
}
}

View File

@ -0,0 +1,11 @@
{
"luci-app-zabbix": {
"description": "Grant UCI access for luci-app-zabbix",
"read": {
"uci": [ "zabbix" ]
},
"write": {
"uci": [ "zabbix" ]
}
}
}

14
luci-proto-nbiot/Makefile Normal file
View File

@ -0,0 +1,14 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Support for NB-IoT SIM7020E
LUCI_DEPENDS:=+comgt
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,119 @@
'use strict';
'require rpc';
'require uci';
'require form';
'require network';
var callFileList = rpc.declare({
object: 'file',
method: 'list',
params: [ 'path' ],
expect: { entries: [] },
filter: function(list, params) {
var rv = [];
for (var i = 0; i < list.length; i++)
if (list[i].name.match(/^tty[A-Z]/) || list[i].name.match(/^[0-9]+$/))
rv.push(params.path + list[i].name);
return rv.sort();
}
});
network.registerPatternVirtual(/^nbiot-.+$/);
return network.registerProtocol('nbiot', {
getI18n: function() {
return _('NB-IoT (SIM7020E)');
},
getIfname: function() {
return this._ubus('l3_device') || 'nbiot-%s'.format(this.sid);
},
getOpkgPackage: function() {
return 'comgt';
},
isFloating: function() {
return true;
},
isVirtual: function() {
return true;
},
getDevices: function() {
return null;
},
containsDevice: function(ifname) {
return (network.getIfnameOf(ifname) == this.getIfname());
},
renderFormOptions: function(s) {
var o;
o = s.taboption('general', form.Value, '_modem_device', _('Modem device'));
o.ucioption = 'device';
o.rmempty = false;
o.load = function(section_id) {
return callFileList('/dev/').then(L.bind(function(devices) {
for (var i = 0; i < devices.length; i++)
this.value(devices[i]);
return callFileList('/dev/tts/');
}, this)).then(L.bind(function(devices) {
for (var i = 0; i < devices.length; i++)
this.value(devices[i]);
return form.Value.prototype.load.apply(this, [section_id]);
}, this));
};
o = s.taboption('general', form.DummyValue, 'imei', _('IMEI'));
o = s.taboption('general', form.DummyValue, 'ccid', _('SIM CCID'));
o = s.taboption('general', form.Value, 'apn', _('APN'));
o.validate = function(section_id, value) {
if (value == null || value == '')
return true;
if (!/^[a-zA-Z0-9\-.]*[a-zA-Z0-9]$/.test(value))
return _('Invalid APN provided');
return true;
};
o = s.taboption('general', form.Value, 'pincode', _('PIN'));
o.datatype = 'and(uinteger,minlength(4),maxlength(8))';
o = s.taboption('general', form.ListValue, 'auth', _('Authentication Type'));
o.value('pap', 'PAP');
o.value('chap', 'CHAP');
o.value('none', 'NONE');
o.default = 'none';
o = s.taboption('general', form.Value, 'username', _('PAP/CHAP username'));
o.depends('auth', 'pap');
o.depends('auth', 'chap');
o.depends('auth', 'both');
o = s.taboption('general', form.Value, 'password', _('PAP/CHAP password'));
o.depends('auth', 'pap');
o.depends('auth', 'chap');
o.depends('auth', 'both');
o.password = true;
o = s.taboption('general', form.Value, 'dialnumber', _('Dial number'));
o.placeholder = '*99***1#';
o = s.taboption('general', form.MultiValue, 'band', _('NB-IoT band'));
o.value(1);
o.value(3);
o.value(5);
o.value(8);
o.value(20);
o.value(28);
o = s.taboption('advanced', form.Value, 'delay', _('Modem init timeout'), _('Maximum amount of seconds to wait for the modem to become ready'));
o.placeholder = '10';
o.datatype = 'min(1)';
}
});