mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 22:03:56 +08:00
update 2026-10-07 18:47:42
This commit is contained in:
1 parent
617f7ca2a6
commit
bd061545ed
4832 files changed
+1693456
No files matched your search
@@ -0,0 +1,15 @@
|
||||
module("luci.controller.lingti",package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/lingti") then return end
|
||||
|
||||
entry({"admin", "services", "lingti"}, cbi("lingti/lingti"), ("LingTi GameAcc"),99).dependent=true
|
||||
entry({"admin","services","lingti","status"},call("act_status")).leaf=true
|
||||
end
|
||||
|
||||
function act_status()
|
||||
local e={}
|
||||
e.running=luci.sys.call("pgrep -f lingti >/dev/null")==0
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
require("luci.util")
|
||||
|
||||
mp = Map("lingti", translate("LingTi Game Accelerator"))
|
||||
mp.description = translate("A Paid Game Acceleration service, Please use with Mobile App")
|
||||
mp:section(SimpleSection).template = "lingti/lingti_status"
|
||||
|
||||
s = mp:section(TypedSection, "lingti")
|
||||
s.anonymous=true
|
||||
s.addremove=false
|
||||
|
||||
o = s:option(Flag, "enabled", translate("Enable"))
|
||||
o.default = 0
|
||||
o.optional = false
|
||||
|
||||
local apply = luci.http.formvalue("cbi.apply")
|
||||
if apply then
|
||||
io.popen("/etc/init.d/lingti_luci start &")
|
||||
end
|
||||
|
||||
return mp
|
||||
@@ -0,0 +1,21 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
XHR.poll(3, '<%=url([[admin]], [[services]], [[lingti]], [[status]])%>', null,
|
||||
function(x, data) {
|
||||
var tb = document.getElementById('lingti_status');
|
||||
if (data && tb) {
|
||||
if (data.running) {
|
||||
tb.innerHTML = '<em><b><font color=green>LingTi GameAcc <%:RUNNING%></font></b></em>';
|
||||
} else {
|
||||
tb.innerHTML = '<em><b><font color=red>LingTi GameAcc <%:NOT RUNNING%></font></b></em>';
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
|
||||
<fieldset class="cbi-section">
|
||||
<p id="lingti_status">
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
Reference in new issue
Block a user