update 2023-08-17 02:01:23

This commit is contained in:
github-actions[bot] 2023-08-17 02:01:23 +08:00
parent 8475e5bc15
commit 802100bf2e
2 changed files with 7 additions and 1 deletions

View File

@ -11,7 +11,7 @@ LUCI_DEPENDS:=+luci-lib-xterm +taskd
LUCI_EXTRA_DEPENDS:=taskd (>=1.0.3-1)
LUCI_PKGARCH:=all
PKG_VERSION:=1.0.17
PKG_VERSION:=1.0.18
PKG_RELEASE:=
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>

View File

@ -3,6 +3,7 @@ module("luci.controller.tasks-lib", package.seeall)
function index()
entry({"admin", "system", "tasks"}, call("tasks_ping")).dependent=false -- just for compatible
entry({"admin", "system", "tasks", "status"}, call("tasks_status")).dependent=false
entry({"admin", "system", "tasks", "log"}, call("tasks_log")).dependent=false
entry({"admin", "system", "tasks", "stop"}, post("tasks_stop")).dependent=false
@ -14,6 +15,11 @@ local ltn12 = require "luci.ltn12"
local taskd = require "luci.model.tasks"
function tasks_ping()
luci.http.prepare_content("application/json")
luci.http.write_json({})
end
function tasks_status()
local data = taskd.status(luci.http.formvalue("task_id"))
luci.http.prepare_content("application/json")