diff --git a/luci-app-mlvpn/Makefile b/luci-app-mlvpn/Makefile index 33548c8e9..80d97c856 100644 --- a/luci-app-mlvpn/Makefile +++ b/luci-app-mlvpn/Makefile @@ -1,12 +1,12 @@ # -# Copyright (C) 2018-2019 Ycarus (Yannick Chabanois) +# Copyright (C) 2018-2020 Ycarus (Yannick Chabanois) # # include $(TOPDIR)/rules.mk -LUCI_TITLE:=LuCI Support for MLVPN -LUCI_DEPENDS:=+mlvpn +LUCI_TITLE:=LuCI Interface to Glorytun TCP +LUCI_DEPENDS:=+glorytun PKG_LICENSE:=GPLv3 diff --git a/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js b/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js new file mode 100644 index 000000000..8dcfb422b --- /dev/null +++ b/luci-app-mlvpn/htdocs/luci-static/resources/view/services/mlvpn.js @@ -0,0 +1,83 @@ +'use strict'; +'require rpc'; +'require form'; +'require fs'; +'require uci'; +'require tools.widgets as widgets'; + +var callHostHints; + +return L.view.extend({ + callHostHints: rpc.declare({ + object: 'luci-rpc', + method: 'getHostHints', + expect: { '': {} } + }), + + load: function() { + return this.callHostHints(); + }, + + render: function(hosts) { + var m, s, o; + + m = new form.Map('mlvpn', _('MLVPN')); + + s = m.section(form.GridSection, 'mlvpn', _('Instances')); + s.addremove = true; + s.anonymous = true; + s.nodescriptions = true; + + s.tab('general', _('General Settings')); + s.tab('advanced', _('Advanced Settings')); + + o = s.taboption('general', form.Flag, 'enable', _('Enabled')); + o.default = o.enabled; + + o = s.taboption('general', form.ListValue, 'mode', _('Mode')); + o.value('client',_('Client')); + o.value('server',_('Server')); + o.modalonly = true; + + o = s.taboption('general', form.Value, 'host', _('Host')); + o.rmempty = false; + + o = s.taboption('general', form.Value, 'firstport', _('First Port')); + o.default = "65201" + o.datatype = "port" + o.rmempty = false; + + o = s.taboption('general', form.Value, 'password', _('Password')); + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('general', form.Value, 'interface_name', _('Interface name')); + o.default = "mlvpn0" + o.placeholder = "mlvpn0" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('advanced', form.Value, 'timeout', _('Timeout (s)')); + o.default = '30'; + o.datatype = "uinteger" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('advanced', form.Value, 'reorder_buffer_size', _('Reorder buffer size')); + o.default = '128'; + o.datatype = "uinteger" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('advanced', form.Value, 'loss_tolerance', _('Loss tolerance')); + o.default = '50'; + o.datatype = "uinteger" + o.rmempty = false; + o.modalonly = true; + + o = s.taboption('general',form.Value, 'label', _('Label')); + o.rmempty = true; + + return m.render(); + } +}); diff --git a/luci-app-mlvpn/luasrc/controller/mlvpn.lua b/luci-app-mlvpn/luasrc/controller/mlvpn.lua deleted file mode 100644 index 154222265..000000000 --- a/luci-app-mlvpn/luasrc/controller/mlvpn.lua +++ /dev/null @@ -1,7 +0,0 @@ -module("luci.controller.mlvpn", package.seeall) - -function index() - --entry({"admin", "openmptcprouter", "mlvpn"}, cbi("mlvpn"), _("MLVPN")) - --entry({"admin", "services", "mlvpn"}, cbi("mlvpn"), _("MLVPN")) - entry({"admin", "vpn", "mlvpn"}, cbi("mlvpn"), _("MLVPN")) -end diff --git a/luci-app-mlvpn/luasrc/model/cbi/mlvpn.lua b/luci-app-mlvpn/luasrc/model/cbi/mlvpn.lua deleted file mode 100644 index eaef23d7e..000000000 --- a/luci-app-mlvpn/luasrc/model/cbi/mlvpn.lua +++ /dev/null @@ -1,77 +0,0 @@ -local net = require "luci.model.network".init() -local sys = require "luci.sys" -local ifaces = sys.net:devices() -local m, s, o - -m = Map("mlvpn", translate("MLVPN")) - -s = m:section(TypedSection, "mlvpn", translate("Settings")) -s.anonymous = true -s.addremove = false - -o = s:option(Flag, "enable", translate("Enable")) -o.rmempty = false - -o = s:option(Value, "timeout", translate("Timeout (s)")) -o.placeholder = "30" -o.default = "30" -o.datatype = "uinteger" -o.rmempty = false - -o = s:option(Value, "reorder_buffer_size", translate("Reorder buffer size")) -o.placeholder = "64" -o.default = "64" -o.datatype = "uinteger" -o.rmempty = false - -o = s:option(Value, "loss_tolerance", translate("Loss tolerance")) -o.placeholder = "50" -o.default = "50" -o.datatype = "uinteger" -o.rmempty = false - -o = s:option(Value, "host", translate("Remote host")) -o.placeholder = "128.128.128.128" -o.default = "128.128.128.128" -o.datatype = "host" -o.rmempty = false - -o = s:option(Value, "firstport", translate("First remote port"),translate("Interface will increase port used beginning with this")) -o.default = "65201" -o.datatype = "port" -o.rmempty = false - -o = s:option(Value, "password", translate("Password")) -o.password = true -o.rmempty = false - - -o = s:option(Value, "interface_name", translate("Interface name")) -o.placeholder = "mlvpn0" -o.default = "mlvpn0" -o.rmempty = false - ---o = s:option(Value, "mode", translate("Mode")) ---o:value("client") ---o:value("server") ---o.default = "client" ---o.rmempty = false - - ---s = m:section(TypedSection, "interface", translate("Interfaces")) ---s.template_addremove = "mlvpn/cbi-select-add" ---s.addremove = true ---s.add_select_options = { } ---s.add_select_options[''] = '' ---for _, iface in ipairs(ifaces) do --- if not (iface == "lo" or iface:match("^ifb.*")) then --- s.add_select_options[iface] = iface --- end ---end - ---o = s:option(Value, "port", translate("Remote/Bind port")) ---o.placeholder = "65201" ---o.default = "65201" ---o.datatype = "port" - -return m diff --git a/luci-app-mlvpn/luasrc/view/mlvpn/cbi-select-add.htm b/luci-app-mlvpn/luasrc/view/mlvpn/cbi-select-add.htm deleted file mode 100644 index 97ee647d2..000000000 --- a/luci-app-mlvpn/luasrc/view/mlvpn/cbi-select-add.htm +++ /dev/null @@ -1,10 +0,0 @@ -
- <% if self.invalid_cts then -%>
<% end %> - - - <% if self.invalid_cts then %>
<%:Invalid%>
<% end %> -
diff --git a/luci-app-mlvpn/po/de/mlvpn.po b/luci-app-mlvpn/po/de/mlvpn.po deleted file mode 100644 index f60844ce4..000000000 --- a/luci-app-mlvpn/po/de/mlvpn.po +++ /dev/null @@ -1,59 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-10-05 12:39+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: German \n" -"Language: de\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.0.4\n" - -msgid "Add" -msgstr "Hinzufügen" - -msgid "Enable" -msgstr "Aktivieren" - -msgid "First remote port" -msgstr "Erster Gegenstellen-Port" - -msgid "Interface name" -msgstr "Name der Verbindung" - -msgid "Interface will increase port used beginning with this" -msgstr "Der Anschluss wird die Pornummern nutzen beginnend mit diesem Wert" - -msgid "Interfaces" -msgstr "Anschlüsse" - -msgid "Invalid" -msgstr "Ungültig" - -msgid "Loss tolerance" -msgstr "Verlust-Toleranz" - -msgid "MLVPN" -msgstr "MLVPN" - -msgid "Mode" -msgstr "Betriebsmodus" - -msgid "Password" -msgstr "Schlüssel" - -msgid "Remote host" -msgstr "Gegenstelle (FQDN oder IP-Adresse)" - -msgid "Remote/Bind port" -msgstr "Portnummer der Gegenstelle" - -msgid "Reorder buffer size" -msgstr "Größe des Sortierpuffers" - -msgid "Settings" -msgstr "Einstellungen" - -msgid "Timeout (s)" -msgstr "Wartezeit (in Sekunden)" diff --git a/luci-app-mlvpn/po/fr/mlvpn.po b/luci-app-mlvpn/po/fr/mlvpn.po deleted file mode 100644 index af2708373..000000000 --- a/luci-app-mlvpn/po/fr/mlvpn.po +++ /dev/null @@ -1,62 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: 2020-10-07 10:57+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: French \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.0.4\n" - -msgid "Add" -msgstr "Ajouter" - -msgid "Enable" -msgstr "Activer" - -msgid "First remote port" -msgstr "Premier port distant" - -msgid "Interface name" -msgstr "Nom de l'interface" - -msgid "Interface will increase port used beginning with this" -msgstr "L'interface augmentera le port utilisé à partir de celui ci" - -msgid "Interfaces" -msgstr "Interfaces" - -msgid "Invalid" -msgstr "Invalide" - -msgid "Loss tolerance" -msgstr "Tolérance aux pertes" - -msgid "MLVPN" -msgstr "MLVPN" - -msgid "Mode" -msgstr "Mode" - -msgid "Password" -msgstr "Mot de passe" - -msgid "Remote host" -msgstr "Nom de l'hôte distant ou adresse IP" - -msgid "Remote/Bind port" -msgstr "Port de connexion distant" - -msgid "Reorder buffer size" -msgstr "Taille du tampon de réordonnancement" - -msgid "Settings" -msgstr "Paramètres" - -msgid "Timeout (s)" -msgstr "Délais d'attente (s)" diff --git a/luci-app-mlvpn/po/it/mlvpn.po b/luci-app-mlvpn/po/it/mlvpn.po deleted file mode 100644 index f7c495c5c..000000000 --- a/luci-app-mlvpn/po/it/mlvpn.po +++ /dev/null @@ -1,59 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-09-21 12:51+0000\n" -"Last-Translator: Weblate Admin \n" -"Language-Team: Italian \n" -"Language: it\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.0.4\n" - -msgid "Add" -msgstr "Aggiungi" - -msgid "Enable" -msgstr "Attivare" - -msgid "First remote port" -msgstr "Prima porta remota" - -msgid "Interface name" -msgstr "Nome interfaccia" - -msgid "Interface will increase port used beginning with this" -msgstr "L'interfaccia aumenterà la porta utilizzata a partire da questa" - -msgid "Interfaces" -msgstr "Interfaccia" - -msgid "Invalid" -msgstr "Non valido" - -msgid "Loss tolerance" -msgstr "Tolleranza alla perdita" - -msgid "MLVPN" -msgstr "MLVPN" - -msgid "Mode" -msgstr "Modo" - -msgid "Password" -msgstr "Password" - -msgid "Remote host" -msgstr "Rimuovi server" - -msgid "Remote/Bind port" -msgstr "Porta remota / Bind" - -msgid "Reorder buffer size" -msgstr "" - -msgid "Settings" -msgstr "Impostazioni" - -msgid "Timeout (s)" -msgstr "" diff --git a/luci-app-mlvpn/po/templates/mlvpn.pot b/luci-app-mlvpn/po/templates/mlvpn.pot deleted file mode 100644 index 0eecd2f65..000000000 --- a/luci-app-mlvpn/po/templates/mlvpn.pot +++ /dev/null @@ -1,50 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -msgid "Add" -msgstr "" - -msgid "Enable" -msgstr "" - -msgid "First remote port" -msgstr "" - -msgid "Interface name" -msgstr "" - -msgid "Interface will increase port used beginning with this" -msgstr "" - -msgid "Interfaces" -msgstr "" - -msgid "Invalid" -msgstr "" - -msgid "Loss tolerance" -msgstr "" - -msgid "MLVPN" -msgstr "" - -msgid "Mode" -msgstr "" - -msgid "Password" -msgstr "" - -msgid "Remote host" -msgstr "" - -msgid "Remote/Bind port" -msgstr "" - -msgid "Reorder buffer size" -msgstr "" - -msgid "Settings" -msgstr "" - -msgid "Timeout (s)" -msgstr "" diff --git a/luci-app-mlvpn/po/zh_Hans/mlvpn.po b/luci-app-mlvpn/po/zh_Hans/mlvpn.po deleted file mode 100644 index eca37c59d..000000000 --- a/luci-app-mlvpn/po/zh_Hans/mlvpn.po +++ /dev/null @@ -1,59 +0,0 @@ -msgid "" -msgstr "" -"PO-Revision-Date: 2020-06-11 16:36+0000\n" -"Last-Translator: antrouter \n" -"Language-Team: Chinese (Simplified) \n" -"Language: zh_Hans\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.0.4\n" - -msgid "Add" -msgstr "添加" - -msgid "Enable" -msgstr "开启" - -msgid "First remote port" -msgstr "第一个远程端口" - -msgid "Interface name" -msgstr "网卡名称" - -msgid "Interface will increase port used beginning with this" -msgstr "接口将从此开始增加使用的端口" - -msgid "Interfaces" -msgstr "网卡" - -msgid "Invalid" -msgstr "无效" - -msgid "Loss tolerance" -msgstr "损失容忍" - -msgid "MLVPN" -msgstr "MLVPN设置" - -msgid "Mode" -msgstr "模式" - -msgid "Password" -msgstr "密码" - -msgid "Remote host" -msgstr "远程主机" - -msgid "Remote/Bind port" -msgstr "远程/绑定端口" - -msgid "Reorder buffer size" -msgstr "重新排序缓冲区大小" - -msgid "Settings" -msgstr "设置" - -msgid "Timeout (s)" -msgstr "超时 (秒)" diff --git a/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json b/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json index 085d95305..90afc4494 100644 --- a/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json +++ b/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json @@ -3,8 +3,8 @@ "title": "MLVPN", "order": 30, "action": { - "type": "cbi", - "path": "mlvpn" + "type": "view", + "path": "services/mlvpn" }, "depends": { "acl": [ "luci-app-mlvpn" ]