mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 06:15:13 +08:00
⛅ Sync 2026-10-04 22:17:19
This commit is contained in:
1 parent
d132e566f2
commit
aef2d67550
143 files changed
+442
-212
No files matched your search
@@ -107,7 +107,8 @@ function index()
|
||||
entry({"admin", "services", appname, "read_rulelist"}, call("read_rulelist")).leaf = true
|
||||
|
||||
--[[Components update]]
|
||||
entry({"admin", "services", appname, "check_passwall"}, call("app_check")).leaf = true
|
||||
entry({"admin", "services", appname, "check_" .. appname}, call("app_check")).leaf = true
|
||||
entry({"admin", "services", appname, "update_" .. appname}, call("app_update")).leaf = true
|
||||
local coms = require "luci.passwall.com"
|
||||
local com
|
||||
for _, com in ipairs(coms.order) do
|
||||
@@ -886,6 +887,23 @@ function app_check()
|
||||
http_write_json(json)
|
||||
end
|
||||
|
||||
function app_update()
|
||||
local id = http.formvalue("id")
|
||||
if not id or not id:match("^[%w_-]+$") then http_write_json({code = 1}); return end
|
||||
local task = http.formvalue("task")
|
||||
local result
|
||||
if task == "progress" then
|
||||
result = api.to_download_progress(appname, id, http.formvalue("total_size"))
|
||||
elseif task == "install" then
|
||||
if not luci.dispatcher.test_post_security() then return end
|
||||
result = api.to_install_self(id, http.formvalue("force"))
|
||||
else
|
||||
local part = http.formvalue("part") == "2" and "2" or "1"
|
||||
result = api.to_download(appname, http.formvalue("url"), http.formvalue("size"), id .. part, part == "2")
|
||||
end
|
||||
http_write_json(result)
|
||||
end
|
||||
|
||||
function com_check(comname)
|
||||
local json = api.to_check("",comname)
|
||||
http_write_json(json)
|
||||
|
||||
Reference in new issue
Block a user