From: Shun Li Date: Sat, 30 Nov 2019 12:38:56 +0000 (+0800) Subject: add luci support for omcproxy X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=796301a02f95739383262051ad1a551c153a680e;p=oweals%2Fluci.git add luci support for omcproxy Signed-off-by: Shun Li --- diff --git a/applications/luci-app-omcproxy/Makefile b/applications/luci-app-omcproxy/Makefile new file mode 100644 index 000000000..7091f66df --- /dev/null +++ b/applications/luci-app-omcproxy/Makefile @@ -0,0 +1,22 @@ +# +# Copyright 2019 Shun Li +# +# 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 +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 index 000000000..cbc77f66f --- /dev/null +++ b/applications/luci-app-omcproxy/htdocs/luci-static/resources/view/omcproxy.js @@ -0,0 +1,40 @@ +// Copyright 2019 Shun Li +// 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 index 000000000..6842a2097 --- /dev/null +++ b/applications/luci-app-omcproxy/luasrc/controller/omcproxy.lua @@ -0,0 +1,13 @@ +-- Copyright 2019 Shun Li +-- 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 index 000000000..ab19dfb26 --- /dev/null +++ b/applications/luci-app-omcproxy/po/templates/omcproxy.pot @@ -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 index 000000000..ed47bcbb4 --- /dev/null +++ b/applications/luci-app-omcproxy/po/zh-cn/omcproxy.po @@ -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