search ported to fastapi
This commit is contained in:
parent
97d6e65bb8
commit
c36a1ea0cc
1 changed files with 5 additions and 5 deletions
|
@ -76,7 +76,7 @@ def create():
|
||||||
|
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
start = date_read(req["starttime"]) if "starttime" in req else now
|
start = date_read(req["starttime"]) if "starttime" in req else now
|
||||||
name = req["name"] if "name" in req else u""
|
name = req["name"] if "name" in req else ""
|
||||||
end = date_read(req["endtime"]) if "endtime" in req else now
|
end = date_read(req["endtime"]) if "endtime" in req else now
|
||||||
|
|
||||||
rec = Rec(name=name, starttime=start, endtime=end)
|
rec = Rec(name=name, starttime=start, endtime=end)
|
||||||
|
@ -222,15 +222,15 @@ def check_job(job_id: int):
|
||||||
@app.get("/api/jobs")
|
@app.get("/api/jobs")
|
||||||
def running_jobs():
|
def running_jobs():
|
||||||
res = {}
|
res = {}
|
||||||
res["last_job_id"] = self._app.pq.last_job_id
|
res["last_job_id"] = pq.last_job_id
|
||||||
res["running"] = self._app.pq.jobs.keys()
|
res["running"] = pq.jobs.keys()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/get/search")
|
@app.get("/api/get/search")
|
||||||
def search(args=None):
|
def search(request: Request):
|
||||||
req = dict()
|
req = dict()
|
||||||
req.update(request.GET.allitems())
|
req.update(request.query_params.items())
|
||||||
logger.debug("Search request: %s" % (req))
|
logger.debug("Search request: %s" % (req))
|
||||||
|
|
||||||
values = db._search(**req)
|
values = db._search(**req)
|
||||||
|
|
Loading…
Reference in a new issue