mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[mod] if not job, list apps without jobs
This commit is contained in:
parent
4eee2a056d
commit
5b7f47dbbf
1 changed files with 38 additions and 18 deletions
56
run.py
56
run.py
|
@ -511,24 +511,44 @@ async def ws_apps(request, websocket):
|
||||||
"name"
|
"name"
|
||||||
''')
|
''')
|
||||||
|
|
||||||
repos = [
|
if len(repos):
|
||||||
{
|
repos = [
|
||||||
"id": x.id,
|
{
|
||||||
"name": x.name,
|
"id": x.id,
|
||||||
"url": x.url,
|
"name": x.name,
|
||||||
"revision": x.revision,
|
"url": x.url,
|
||||||
"app_list": x.app_list,
|
"revision": x.revision,
|
||||||
"state": x.state,
|
"app_list": x.app_list,
|
||||||
"random_job_day": x.random_job_day,
|
"state": x.state,
|
||||||
"job_id": x.job_id,
|
"random_job_day": x.random_job_day,
|
||||||
"job_name": x.job_name,
|
"job_id": x.job_id,
|
||||||
"job_state": x.job_state,
|
"job_name": x.job_name,
|
||||||
"log": x.log,
|
"job_state": x.job_state,
|
||||||
"created_time": datetime.strptime(x.created_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.created_time else None,
|
"log": x.log,
|
||||||
"started_time": datetime.strptime(x.started_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.started_time else None,
|
"created_time": datetime.strptime(x.created_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.created_time else None,
|
||||||
"end_time": datetime.strptime(x.end_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.end_time else None,
|
"started_time": datetime.strptime(x.started_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.started_time else None,
|
||||||
} for x in repos
|
"end_time": datetime.strptime(x.end_time.split(".")[0], '%Y-%m-%d %H:%M:%S') if x.end_time else None,
|
||||||
]
|
} for x in repos
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
repos = [
|
||||||
|
{
|
||||||
|
"id": x.id,
|
||||||
|
"name": x.name,
|
||||||
|
"url": x.url,
|
||||||
|
"revision": x.revision,
|
||||||
|
"app_list": x.app_list,
|
||||||
|
"state": x.state,
|
||||||
|
"random_job_day": x.random_job_day,
|
||||||
|
"job_id": "",
|
||||||
|
"job_name": "",
|
||||||
|
"job_state": "",
|
||||||
|
"log": "",
|
||||||
|
"created_time": "",
|
||||||
|
"started_time": "",
|
||||||
|
"end_time": "",
|
||||||
|
} for x in Repo.select()
|
||||||
|
]
|
||||||
|
|
||||||
await websocket.send(ujson.dumps({
|
await websocket.send(ujson.dumps({
|
||||||
"action": "init_apps",
|
"action": "init_apps",
|
||||||
|
|
Loading…
Add table
Reference in a new issue