mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[enh] plug apps page to jobs updates
This commit is contained in:
parent
24c5eb63eb
commit
2e19f5471e
2 changed files with 13 additions and 1 deletions
2
run.py
2
run.py
|
@ -453,7 +453,7 @@ async def ws_job(request, websocket, job_id):
|
|||
|
||||
@app.websocket('/apps-ws')
|
||||
async def ws_apps(request, websocket):
|
||||
# subscribe(websocket, f"job-{job.id}")
|
||||
subscribe(websocket, "jobs")
|
||||
|
||||
# I need to do this because peewee strangely fuck up on join and remove the
|
||||
# subquery fields which breaks everything
|
||||
|
|
|
@ -76,7 +76,19 @@
|
|||
|
||||
if (action == "init_apps") {
|
||||
app.apps = data;
|
||||
} else if (action == "update_job") {
|
||||
for (var i = 0; i < app.apps.length; ++i) {
|
||||
if (app.apps[i].job_id == data.id) {
|
||||
Vue.set(app.apps[i], 'job_state', data.state);
|
||||
Vue.set(app.apps[i], 'created_time', data.created_time);
|
||||
Vue.set(app.apps[i], 'started_time', data.started_time);
|
||||
Vue.set(app.apps[i], 'end_time', data.end_time);
|
||||
}
|
||||
}
|
||||
} else if (action == "add_job") {
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
})()
|
||||
</script>
|
||||
|
|
Loading…
Add table
Reference in a new issue