mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 09:33:56 +08:00
🌈 Sync 2026-09-24 15:19:50
This commit is contained in:
1 parent
b1685a36b7
commit
37ff0ceb2f
126 files changed
+4403
-2879
No files matched your search
@@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=kai
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_RELEASE:=10
|
||||
LUCI_DEPENDS:=+kai +kai_session +luci-compat
|
||||
PKG_RELEASE:=11
|
||||
LUCI_DEPENDS:=+kai +luci-compat +luci-lib-linkeaseauth +linkease-app-entry
|
||||
LUCI_MINIFY_CSS:=0
|
||||
LUCI_MINIFY_JS:=0
|
||||
|
||||
|
||||
@@ -16,10 +16,14 @@ end
|
||||
function kai_status()
|
||||
local sys = require "luci.sys"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local port = tonumber(uci:get_first("kai", "kai", "port")) or 8197
|
||||
if port < 1 or port > 65535 or port % 1 ~= 0 then
|
||||
port = 8197
|
||||
end
|
||||
local status = {
|
||||
running = (sys.call("pidof kai_bin >/dev/null") == 0),
|
||||
port = 8197
|
||||
port = port
|
||||
}
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(status)
|
||||
http.prepare_content("application/json")
|
||||
http.write_json(status)
|
||||
end
|
||||
@@ -1,4 +1,6 @@
|
||||
<script <script type="text/javascript">//<![CDATA[
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var kaiOpenUrl = '<%=url("admin/services/linkease_apps/open")%>?id=kai';
|
||||
|
||||
XHR.poll(5, '<%=url("admin/services/kai_status")%>', null,function(x, st){
|
||||
var el = document.getElementById('kai_status');
|
||||
if (st && el){
|
||||
@@ -7,7 +9,7 @@ XHR.poll(5, '<%=url("admin/services/kai_status")%>', null,function(x, st){
|
||||
}
|
||||
if (st.running){
|
||||
el.innerHTML = '<br/><em style=\"color:green\"><%:The KAI service is running.%></em>'
|
||||
+ "<br/><br/><input class=\"btn cbi-button cbi-button-apply\" type=\"button\" value=\" <%:Click to open KAI%> \" onclick=\"window.open('http://" + window.location.hostname + ":" + st.port + "/')\"/>";
|
||||
+ "<br/><br/><input class=\"btn cbi-button cbi-button-apply\" type=\"button\" value=\" <%:Click to open KAI%> \" onclick=\"window.open(kaiOpenUrl, '_blank', 'noopener')\"/>";
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -19,4 +21,3 @@ XHR.poll(5, '<%=url("admin/services/kai_status")%>', null,function(x, st){
|
||||
<em><%:Collecting data...%></em>
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
Reference in new issue
Block a user