add luci support for omcproxy
authorShun Li <riverscn@gmail.com>
Sat, 30 Nov 2019 12:38:56 +0000 (20:38 +0800)
committerPaul Spooren <mail@aparcar.org>
Tue, 3 Dec 2019 19:59:55 +0000 (20:59 +0100)
Signed-off-by: Shun Li <riverscn@gmail.com>
applications/luci-app-omcproxy/Makefile [new file with mode: 0644]
applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js [new file with mode: 0644]
applications/luci-app-omcproxy/luasrc/controller/omcproxy.lua [new file with mode: 0644]
applications/luci-app-omcproxy/po/templates/omcproxy.pot [new file with mode: 0644]
applications/luci-app-omcproxy/po/zh-cn/omcproxy.po [new file with mode: 0644]

diff --git a/applications/luci-app-omcproxy/Makefile b/applications/luci-app-omcproxy/Makefile
new file mode 100644 (file)
index 0000000..7091f66
--- /dev/null
@@ -0,0 +1,22 @@
+#
+# Copyright 2019 Shun Li <riverscn@gmail.com>
+#
+# This is free software, licensed under the Apache License, Version 2.0 .
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-omcproxy
+PKG_VERSION:=0.1.0
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Shun Li <riverscn@gmail.com>
+PKG_LICENSE:=Apache-2.0
+
+LUCI_TITLE:=LuCI support for omcproxy
+LUCI_DEPENDS:=+omcproxy
+LUCI_PKGARCH:=all
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js b/applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js
new file mode 100644 (file)
index 0000000..cbc77f6
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright 2019 Shun Li <riverscn@gmail.com>
+// This is free software, licensed under the Apache License, Version 2.0
+
+'use strict';
+'require form';
+'require tools.widgets as widgets';
+
+return L.view.extend({
+       render: function () {
+               var m, s, o;
+
+               m = new form.Map('omcproxy', _('omcproxy'), _('Embedded IGMPv3 and MLDv2 proxy'));
+
+               s = m.section(form.TypedSection, 'proxy', _('Proxy Instance'));
+               s.anonymous = true;
+               s.addremove = true;
+               s.addbtntitle = _('Add instance');
+
+               o = s.option(form.ListValue, 'scope', _('Scope'), _('Minimum multicast scope to proxy (only affects IPv6 multicast)'));
+               o.datatype = 'string';
+               o.value('', _('default'))
+               o.value('global', _('global'))
+               o.value('organization', _('organization-local'))
+               o.value('site', _('site-local'))
+               o.value('admin', _('admin-local'))
+               o.value('realm', _('realm'))
+               o.default = '';
+               o.rmempty = true;
+
+               o = s.option(widgets.NetworkSelect, 'uplink', _('Uplink interface'), _('Where does the multicast come from?'));
+               o.nocreate = true;
+               o.rmempty = false;
+
+               o = s.option(widgets.NetworkSelect, 'downlink', _('Downlink interface'), _('Where does the multicast go to?'));
+               o.nocreate = true;
+               o.rmempty = false;
+
+               return m.render();
+       }
+});
diff --git a/applications/luci-app-omcproxy/luasrc/controller/omcproxy.lua b/applications/luci-app-omcproxy/luasrc/controller/omcproxy.lua
new file mode 100644 (file)
index 0000000..6842a20
--- /dev/null
@@ -0,0 +1,13 @@
+-- Copyright 2019 Shun Li <riverscn@gmail.com>
+-- This is free software, licensed under the Apache License, Version 2.0
+
+module("luci.controller.omcproxy", package.seeall)
+
+function index()
+       if not nixio.fs.access("/etc/config/omcproxy") then
+               return
+       end
+
+       entry({"admin", "services", "omcproxy"}, view("omcproxy"), _("omcproxy")).dependent = true
+
+end
\ No newline at end of file
diff --git a/applications/luci-app-omcproxy/po/templates/omcproxy.pot b/applications/luci-app-omcproxy/po/templates/omcproxy.pot
new file mode 100644 (file)
index 0000000..ab19dfb
--- /dev/null
@@ -0,0 +1,67 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:14
+msgid "Add instance"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:31
+msgid "Downlink interface"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:9
+msgid "Embedded IGMPv3 and MLDv2 proxy"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:16
+msgid "Minimum multicast scope to proxy (only affects IPv6 multicast)"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:11
+msgid "Proxy Instance"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:16
+msgid "Scope"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:27
+msgid "Uplink interface"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:27
+msgid "Where does the multicast come from?"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:31
+msgid "Where does the multicast go to?"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:22
+msgid "admin-local"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:18
+msgid "default"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:19
+msgid "global"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:9
+#: luasrc/controller/omcproxy.lua:11
+msgid "omcproxy"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:20
+msgid "organization-local"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:23
+msgid "realm"
+msgstr ""
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:21
+msgid "site-local"
+msgstr ""
\ No newline at end of file
diff --git a/applications/luci-app-omcproxy/po/zh-cn/omcproxy.po b/applications/luci-app-omcproxy/po/zh-cn/omcproxy.po
new file mode 100644 (file)
index 0000000..ed47bcb
--- /dev/null
@@ -0,0 +1,67 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8\n"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:14
+msgid "Add instance"
+msgstr "添加实例"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:31
+msgid "Downlink interface"
+msgstr "下行链路接口"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:9
+msgid "Embedded IGMPv3 and MLDv2 proxy"
+msgstr "嵌入式IGMPv3和MLDv2组播代理(omcproxy)"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:16
+msgid "Minimum multicast scope to proxy (only affects IPv6 multicast)"
+msgstr "代理的最小范围(只影响IPv6的组播)"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:11
+msgid "Proxy Instance"
+msgstr "代理实例"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:16
+msgid "Scope"
+msgstr "范围"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:27
+msgid "Uplink interface"
+msgstr "上行链路接口"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:27
+msgid "Where does the multicast come from?"
+msgstr "组播数据来源"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:31
+msgid "Where does the multicast go to?"
+msgstr "组播代理去向"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:22
+msgid "admin-local"
+msgstr "管理本地范围"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:18
+msgid "default"
+msgstr "默认"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:19
+msgid "global"
+msgstr "全球范围"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:9
+#: luasrc/controller/omcproxy.lua:11
+msgid "omcproxy"
+msgstr "组播代理"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:20
+msgid "organization-local"
+msgstr "机构本地范围"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:23
+msgid "realm"
+msgstr "保留"
+
+#: htdocs/luci-static/resources/view/omcproxy/overview.js:21
+msgid "site-local"
+msgstr "站点本地范围"
\ No newline at end of file