summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js
diff options
context:
space:
mode:
authorBogdan Shatik <bogdikxxx@mail.ru>2021-01-26 16:12:14 +0300
committerHannu Nyman <hannu.nyman@iki.fi>2021-02-01 18:01:59 +0200
commita4b88152b214d8bb4fe80ad8a8ef6fe5ee0b96b8 (patch)
treeee75317764078d287f8feddcd9cce1534d523332 /applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js
parentaf1f961589e9c339a774d42682b9978eabaebcfd (diff)
luci-app-eoip: Add LuCI for EoIP
LuCI Support for EoIP tunnel Signed-off-by: Bogdan Shatik <bogdikxxx@mail.ru>
Diffstat (limited to 'applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js')
-rw-r--r--applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js50
1 files changed, 50 insertions, 0 deletions
diff --git a/applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js b/applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js
new file mode 100644
index 0000000000..9419d6183d
--- /dev/null
+++ b/applications/luci-app-eoip/htdocs/luci-static/resources/view/eoip/eoip.js
@@ -0,0 +1,50 @@
+'use strict';
+'require form';
+'require view';
+'require uci';
+
+return view.extend({
+ render: function() {
+ var m, s, n, id, d, o, v;
+
+ m = new form.Map("eoip", _("EoIP - Tunneling"), _("Here you can configure EoIP tunnel. At current moment it is easiest way to create stateless tunnel with Mikrotik."));
+
+ s = m.section(form.TypedSection, "eoip", _("Settings"));
+ s.addremove = true;
+ s.anonymous = true;
+
+ o = s.option(form.Flag, "enabled", _("Enable tunnel"));
+
+ n = s.option(form.Value, "name", _("Name interface [zeoip"), _("If you input 0 interface name zeoip0"));
+ n.rmempty = false;
+ n.datatype = "uinteger";
+ n.default = 0;
+ n.validate = function(section_id, value) {
+ var sections = uci.sections('eoip');
+ for (var i = 0; i < sections.length; i++) {
+ if (uci.get('eoip', sections[i]['.name'], 'name') == value && section_id != sections[i]['.name'])
+ {return _('Name interface already in used');}
+
+ }
+ return true;
+ };
+
+
+ id = s.option(form.Value, "idtun", _("ID tunnel"), _("Indeficator id tunnel"));
+ id.rmempty = false;
+ id.datatype = "and(min(1), integer)";
+ id.default = 1;
+
+ d = s.option(form.Value, "dst", _("Destination"), _("Destination IP address for connection EoIP."));
+ d.rmempty = false;
+ d.datatype = "ipaddr";
+ d.placeholder = "0.0.0.0";
+
+ o = s.option(form.Flag, "dynamic", _("Dynamic"), _("If you use dynamic option, take attention that there is no authorization, and it is not secure. It is not good idea to use this feature with public ip or insecure(not completely under your control, each host) network."));
+
+ v = s.option(form.DynamicList,"vlan", _("VLAN"), _("VLAN TAG on this interface"));
+ v.datatype = "range(1,4094)";
+
+ return m.render();
+ }
+});