mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 04:45:13 +08:00
🎉 Sync 2026-04-20 23:57:06
This commit is contained in:
1 parent
ede68af29e
commit
c8457a2742
27 files changed
+1000
-151
No files matched your search
@@ -117,6 +117,8 @@ function index()
|
||||
|
||||
--[[geoview]]
|
||||
entry({"admin", "services", appname, "geo_view"}, call("geo_view")).leaf = true
|
||||
|
||||
entry({"admin", "services", appname, "fetch_certsha256"}, call("fetch_certsha256")).leaf = true
|
||||
end
|
||||
|
||||
local function http_write_json(content)
|
||||
@@ -1103,3 +1105,15 @@ function flush_set()
|
||||
http.redirect(api.url("log"))
|
||||
end
|
||||
end
|
||||
|
||||
function fetch_certsha256()
|
||||
local id = http.formvalue("id") or ""
|
||||
local address = (id ~= "") and uci:get(appname, id, "address") or ""
|
||||
local port = (id ~= "") and uci:get(appname, id, "port") or 0
|
||||
if id == "" or address == "" or not api.datatypes.hostname(address) or port == 0 then
|
||||
http_write_json({ code = 1 })
|
||||
return
|
||||
end
|
||||
local data = api.fetch_cert_sha256(address, port, 5)
|
||||
http_write_json(data ~= "" and { code = 0, data = data } or { code = 1 })
|
||||
end
|
||||
Reference in new issue
Block a user