mirror of
https://github.com/kenzok8/small-package
synced 2025-01-07 07:06:58 +08:00
update 2023-03-03 12:31:58
This commit is contained in:
parent
224aa71f7a
commit
69eb393606
@ -1,11 +1,19 @@
|
||||
# Copyright (C) 2022 ImmortalWrt.org
|
||||
#
|
||||
# Copyright (C) 2008-2022 The LuCI Team
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0.
|
||||
#
|
||||
# Converted by ximitech
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for Multi stream daemon lite
|
||||
LUCI_DEPENDS:=+msd_lite
|
||||
PKG_VERSION:=20221214
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI support for Multi Stream Daemon Lite
|
||||
LUCI_DEPENDS:=+msd_lite +luci-compat
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
1
luci-app-msd_lite/README.md
Normal file
1
luci-app-msd_lite/README.md
Normal file
@ -0,0 +1 @@
|
||||
# msd_lite's lua luci app, use it with msd_lite package from ImmortalWrt.
|
@ -1,66 +0,0 @@
|
||||
/* Copyright (C) 2022 ImmortalWrt.org */
|
||||
|
||||
'use strict';
|
||||
'require view';
|
||||
'require form';
|
||||
'require tools.widgets as widgets';
|
||||
|
||||
return view.extend({
|
||||
render: function () {
|
||||
var m, s, o;
|
||||
|
||||
m = new form.Map('msd_lite', _('Multi Stream daemon Lite'),
|
||||
_('The lightweight version of Multi Stream daemon (msd) Program for organizing IP TV streaming on the network via HTTP.'));
|
||||
|
||||
s = m.section(form.TypedSection, 'instance');
|
||||
s.anonymous = true;
|
||||
s.addremove = true;
|
||||
s.addbtntitle = _('Add instance');
|
||||
|
||||
o = s.option(form.Flag, 'enabled', _('Enable'));
|
||||
o.default = o.disabled;
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.DynamicList, 'address', _('Bind address'));
|
||||
o.datatype = 'ipaddrport(1)';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(widgets.DeviceSelect, 'interface', _('Source interface'),
|
||||
_('For multicast receive.'));
|
||||
o.noaliases = true;
|
||||
o.nocreate = true;
|
||||
o.optional = true;
|
||||
|
||||
o = s.option(form.Value, 'threads', _('Worker threads'),
|
||||
_('Leave 0 or <em>empty</em> to auto detect.'));
|
||||
o.datatype = 'uinteger';
|
||||
o.default = '0';
|
||||
|
||||
o = s.option(form.Flag, 'bind_to_cpu', _('Bind threads to CPUs'));
|
||||
o.default = o.disabled;
|
||||
|
||||
o = s.option(form.Flag, 'drop_slow_clients', _('Disconnect slow clients'));
|
||||
o.default = o.disabled;
|
||||
|
||||
o = s.option(form.Value, 'precache_size', _('Pre cache size'));
|
||||
o.datatype = 'uinteger';
|
||||
o.default = '4096';
|
||||
|
||||
o = s.option(form.Value, 'ring_buffer_size', _('Ring buffer size'),
|
||||
_('Stream receive ring buffer size.'));
|
||||
o.datatype = 'uinteger';
|
||||
o.default = '1024';
|
||||
|
||||
o = s.option(form.Value, 'multicast_recv_buffer_size', _('Receive buffer size'),
|
||||
_('Multicast receive socket buffer size.'));
|
||||
o.datatype = 'uinteger';
|
||||
o.default = '512';
|
||||
|
||||
o = s.option(form.Value, 'multicast_recv_timeout', _('Receive timeout'),
|
||||
_('Multicast receive timeout.'));
|
||||
o.datatype = 'uinteger';
|
||||
o.default = '2';
|
||||
|
||||
return m.render();
|
||||
}
|
||||
});
|
25
luci-app-msd_lite/luasrc/controller/msd_lite.lua
Normal file
25
luci-app-msd_lite/luasrc/controller/msd_lite.lua
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
module("luci.controller.msd_lite", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/msd_lite") then
|
||||
return
|
||||
end
|
||||
|
||||
local page
|
||||
page = entry({"admin", "services", "msd_lite"}, cbi("msd_lite"), _("MultiSD_Lite"), 60)
|
||||
page.dependent = true
|
||||
page = entry({"admin", "services", "msd_lite", "status"}, call("act_status"))
|
||||
page.leaf = true
|
||||
end
|
||||
|
||||
local function is_running()
|
||||
return luci.sys.call("pidof msd_lite >/dev/null") == 0
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e = {}
|
||||
e.running = is_running()
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
65
luci-app-msd_lite/luasrc/model/cbi/msd_lite.lua
Normal file
65
luci-app-msd_lite/luasrc/model/cbi/msd_lite.lua
Normal file
@ -0,0 +1,65 @@
|
||||
require ("nixio.fs")
|
||||
require ("luci.sys")
|
||||
require ("luci.http")
|
||||
require ("luci.dispatcher")
|
||||
require "luci.model.uci".cursor()
|
||||
|
||||
m = Map("msd_lite")
|
||||
m.title = translate("Multi Stream daemon Lite")
|
||||
m.description = translate("The lightweight version of Multi Stream daemon (msd) Program for organizing IP TV streaming on the network via HTTP.")
|
||||
|
||||
m:section(SimpleSection).template = "msd_lite/msd_lite_status"
|
||||
|
||||
s = m:section(TypedSection, "instance")
|
||||
s.addremove = true
|
||||
s.anonymous = false
|
||||
s.addbtntitle = translate("Add instance")
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.default = o.disabled
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(DynamicList, "address", translate("Bind address"))
|
||||
o.datatype = "list(ipaddrport(1))"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "interface", translate("Source interface"))
|
||||
local interfaces = luci.sys.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null")
|
||||
for interface in string.gmatch(interfaces, "%S+") do
|
||||
o:value(interface)
|
||||
end
|
||||
o:value("", translate("Disable"))
|
||||
o.default = ""
|
||||
o.description = translate("For multicast receive.")
|
||||
|
||||
o = s:option(Value, "threads", translate("Worker threads"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = "0"
|
||||
o.description = translate("0 = auto.")
|
||||
|
||||
o = s:option(Flag, "bind_to_cpu", translate("Bind threads to CPUs"))
|
||||
o.default = o.disabled
|
||||
|
||||
o = s:option(Flag, "drop_slow_clients", translate("Disconnect slow clients"))
|
||||
o.default = o.disabled
|
||||
|
||||
o = s:option(Value, "precache_size", translate("Pre cache size"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = "4096"
|
||||
|
||||
o = s:option(Value, "ring_buffer_size", translate("Ring buffer size"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = "1024"
|
||||
o.description = translate("Stream receive ring buffer size.")
|
||||
|
||||
o = s:option(Value, "multicast_recv_buffer_size", translate("Receive buffer size"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = "512"
|
||||
o.description = translate("Multicast receive socket buffer size.")
|
||||
|
||||
o = s:option(Value, "multicast_recv_timeout", translate("Receive timeout"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = "2"
|
||||
o.description = translate("Multicast receive timeout.")
|
||||
|
||||
return m
|
24
luci-app-msd_lite/luasrc/view/msd_lite/msd_lite_status.htm
Normal file
24
luci-app-msd_lite/luasrc/view/msd_lite/msd_lite_status.htm
Normal file
@ -0,0 +1,24 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=luci.dispatcher.build_url("admin", "services", "msd_lite", "status")%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('msd_lite_status');
|
||||
if (data && tb) {
|
||||
var links = "";
|
||||
if (data.running) {
|
||||
links = '<b><font color=green>msd_lite - <%:RUNNING%></font></b></em>';
|
||||
} else {
|
||||
links = '<b><font color=red>msd_lite - <%:NOT RUNNING%></font></b>';
|
||||
}
|
||||
|
||||
tb.innerHTML = links;
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="msd_lite_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
@ -1,81 +0,0 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:18
|
||||
msgid "Add instance"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:24
|
||||
msgid "Bind address"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:39
|
||||
msgid "Bind threads to CPUs"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:42
|
||||
msgid "Disconnect slow clients"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:20
|
||||
msgid "Enable"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:29
|
||||
msgid "For multicast receive."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/root/usr/share/rpcd/acl.d/luci-app-msd_lite.json:3
|
||||
msgid "Grant UCI access for luci-app-msd_lite"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:35
|
||||
msgid "Leave 0 or <em>empty</em> to auto detect."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:12
|
||||
#: applications/luci-app-msd_lite/root/usr/share/luci/menu.d/luci-app-msd_lite.json:3
|
||||
msgid "Multi Stream daemon Lite"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:55
|
||||
msgid "Multicast receive socket buffer size."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:60
|
||||
msgid "Multicast receive timeout."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:45
|
||||
msgid "Pre cache size"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:54
|
||||
msgid "Receive buffer size"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:59
|
||||
msgid "Receive timeout"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:49
|
||||
msgid "Ring buffer size"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:28
|
||||
msgid "Source interface"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:50
|
||||
msgid "Stream receive ring buffer size."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:13
|
||||
msgid ""
|
||||
"The lightweight version of Multi Stream daemon (msd) Program for organizing "
|
||||
"IP TV streaming on the network via HTTP."
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:34
|
||||
msgid "Worker threads"
|
||||
msgstr ""
|
@ -1 +0,0 @@
|
||||
zh_Hans
|
63
luci-app-msd_lite/po/zh-cn/msd_lite.po
Normal file
63
luci-app-msd_lite/po/zh-cn/msd_lite.po
Normal file
@ -0,0 +1,63 @@
|
||||
|
||||
msgid "NOT RUNNING"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "RUNNING"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "MultiSD_Lite"
|
||||
msgstr "MultiSD_Lite"
|
||||
|
||||
msgid "Multi Stream daemon Lite"
|
||||
msgstr "组播转换 Lite"
|
||||
|
||||
msgid "The lightweight version of Multi Stream daemon (msd) Program for organizing IP TV streaming on the network via HTTP."
|
||||
msgstr "Multi Stream daemon (msd) 程序的轻量级版本,用于通过 HTTP 管理网络上的 IP TV 流。"
|
||||
|
||||
msgid "Add instance"
|
||||
msgstr "添加实例"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Bind address"
|
||||
msgstr "绑定地址"
|
||||
|
||||
msgid "Source interface"
|
||||
msgstr "源接口"
|
||||
|
||||
msgid "For multicast receive."
|
||||
msgstr "用于接收组播流。"
|
||||
|
||||
msgid "Worker threads"
|
||||
msgstr "工作线程"
|
||||
|
||||
msgid "0 = auto."
|
||||
msgstr "保留为 0 以自动检测。"
|
||||
|
||||
msgid "Bind threads to CPUs"
|
||||
msgstr "绑定线程到 CPU"
|
||||
|
||||
msgid "Disconnect slow clients"
|
||||
msgstr "断开慢速客户端"
|
||||
|
||||
msgid "Pre cache size"
|
||||
msgstr "预缓存大小"
|
||||
|
||||
msgid "Ring buffer size"
|
||||
msgstr "环形缓冲区大小"
|
||||
|
||||
msgid "Stream receive ring buffer size."
|
||||
msgstr "流接收环形缓冲区大小。"
|
||||
|
||||
msgid "Receive buffer size"
|
||||
msgstr "接收缓冲区大小"
|
||||
|
||||
msgid "Multicast receive socket buffer size."
|
||||
msgstr "组播接收套接字缓冲区大小。"
|
||||
|
||||
msgid "Receive timeout"
|
||||
msgstr "接收超时"
|
||||
|
||||
msgid "Multicast receive timeout."
|
||||
msgstr "组播接收超时。"
|
1
luci-app-msd_lite/po/zh_Hans
Symbolic link
1
luci-app-msd_lite/po/zh_Hans
Symbolic link
@ -0,0 +1 @@
|
||||
zh-cn
|
@ -1,90 +0,0 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Last-Translator: Automatically generated\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: zh-Hans\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:18
|
||||
msgid "Add instance"
|
||||
msgstr "添加实例"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:24
|
||||
msgid "Bind address"
|
||||
msgstr "绑定地址"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:39
|
||||
msgid "Bind threads to CPUs"
|
||||
msgstr "绑定线程到 CPU"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:42
|
||||
msgid "Disconnect slow clients"
|
||||
msgstr "断开慢速客户端"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:20
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:29
|
||||
msgid "For multicast receive."
|
||||
msgstr "用于接收组播流。"
|
||||
|
||||
#: applications/luci-app-msd_lite/root/usr/share/rpcd/acl.d/luci-app-msd_lite.json:3
|
||||
msgid "Grant UCI access for luci-app-msd_lite"
|
||||
msgstr "授予 luci-app-msd_lite 访问 UCI 配置的权限。"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:35
|
||||
msgid "Leave 0 or <em>empty</em> to auto detect."
|
||||
msgstr "保留为 0 或<em>留空</em>以自动检测。"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:12
|
||||
#: applications/luci-app-msd_lite/root/usr/share/luci/menu.d/luci-app-msd_lite.json:3
|
||||
msgid "Multi Stream daemon Lite"
|
||||
msgstr "组播转换 Lite"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:55
|
||||
msgid "Multicast receive socket buffer size."
|
||||
msgstr "组播接收套接字缓冲区大小。"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:60
|
||||
msgid "Multicast receive timeout."
|
||||
msgstr "组播接收超时。"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:45
|
||||
msgid "Pre cache size"
|
||||
msgstr "预缓存大小"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:54
|
||||
msgid "Receive buffer size"
|
||||
msgstr "接收缓冲区大小"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:59
|
||||
msgid "Receive timeout"
|
||||
msgstr "接收超时"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:49
|
||||
msgid "Ring buffer size"
|
||||
msgstr "环形缓冲区大小"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:28
|
||||
msgid "Source interface"
|
||||
msgstr "源接口"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:50
|
||||
msgid "Stream receive ring buffer size."
|
||||
msgstr "流接收环形缓冲区大小。"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:13
|
||||
msgid ""
|
||||
"The lightweight version of Multi Stream daemon (msd) Program for organizing "
|
||||
"IP TV streaming on the network via HTTP."
|
||||
msgstr ""
|
||||
"Multi Stream daemon (msd) 程序的轻量级版本,用于通过 HTTP 管理网络上的 IP TV "
|
||||
"流。"
|
||||
|
||||
#: applications/luci-app-msd_lite/htdocs/luci-static/resources/view/msd_lite.js:34
|
||||
msgid "Worker threads"
|
||||
msgstr "工作线程"
|
12
luci-app-msd_lite/root/etc/uci-defaults/40_luci-msd_lite
Normal file
12
luci-app-msd_lite/root/etc/uci-defaults/40_luci-msd_lite
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
# needed for "Save and Apply" to restart msd_lite
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@msd_lite[-1]
|
||||
add ucitrack msd_lite
|
||||
set ucitrack.@msd_lite[-1].init=msd_lite
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
@ -1,13 +0,0 @@
|
||||
{
|
||||
"admin/services/msd_lite": {
|
||||
"title": "Multi Stream daemon Lite",
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "msd_lite"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-msd_lite" ],
|
||||
"uci": { "msd_lite": true }
|
||||
}
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"luci-app-msd_lite": {
|
||||
"description": "Grant UCI access for luci-app-msd_lite",
|
||||
"read": {
|
||||
"uci": [ "msd_lite" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "msd_lite" ]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user