luci-app-ps3netsrv: add package luci

This commit is contained in:
coolsnowwolf 2020-06-13 00:27:53 +08:00 committed by CN_SZTL
parent 8a61efbb17
commit 3b69a6c100
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
6 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Luci for PS3NETSRV
LUCI_DEPENDS:=+ps3netsrv
LUCI_PKGARCH:=all
PKG_VERSION:=1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,21 @@
module("luci.controller.ps3netsrv",package.seeall)
function index()
if not nixio.fs.access("/etc/config/ps3netsrv")then
return
end
entry({"admin", "nas"}, firstchild(), "NAS", 44).dependent = false
local page
entry({"admin", "nas","ps3netsrv"},cbi("ps3netsrv"),_("PS3 NET Server"),40).dependent=true
entry({"admin", "nas","ps3netsrv","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("ps | grep ps3netsrv |grep -v grep >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,24 @@
-- Copyright 2020 Lean <coolsnowwolf@gmail.com>
-- Licensed to the public under the Apache License 2.0.
m = Map("ps3netsrv", translate("PS3 NET Server"), translate("PS3NETSRV is ISO/PKG server for Sony PlayStation 3 webMAN-MOD plugin"))
m:section(SimpleSection).template = "ps3netsrv/ps3netsrv_status"
s = m:section(TypedSection, "ps3netsrv")
s.addremove = false
s.anonymous = true
enable=s:option(Flag, "enabled", translate("Enabled"))
enable.default = "0"
enable.rmempty = false
db_path=s:option(Value, "dir", translate("Dir Path"))
db_path.default = "/root"
db_path.rmempty = false
port=s:option(Value, "port", translate("Port"))
port.rmempty = false
port.datatype = "port"
return m

View File

@ -0,0 +1,22 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[nas]], [[ps3netsrv]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('ps3netsrv_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>PS3NETSRV <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>PS3NETSRV <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="ps3netsrv_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -0,0 +1,26 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-23 20:16+0800\n"
"PO-Revision-Date: 2015-06-23 20:17+0800\n"
"Last-Translator: coolsnowwolf <coolsnowwolf@gmail.com>\n"
"Language-Team: PandoraBox Team\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 1.8.1\n"
"X-Poedit-SourceCharset: UTF-8\n"
msgid "PS3 NET Server"
msgstr "PS3 NET 服务器"
msgid "PS3NETSRV is ISO/PKG server for Sony PlayStation 3 webMAN-MOD plugin"
msgstr "PS3NETSRV 是一个 Sony PlayStation 3 自制系统 webMAN-MOD 插件的服务器端(用于加载蓝光/游戏ISO/PKG"
msgid "Dir Path"
msgstr "目录路径"
msgid "Port"
msgstr "端口"

View File

@ -0,0 +1,11 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@ps3netsrv[-1]
add ucitrack ps3netsrv
set ucitrack.@ps3netsrv[-1].init=ps3netsrv
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0