mmo-job
1 symbol · generated 27 Oct 2026
mmo-job
mmo-job.jhs:1Follows a long job of the server (mmo.core's JobController) live: its state, its progress, its log, its result or its error, as the job reports them (Server-Sent Events, api/jobs/{id}/events.sse). Leaving the page does not stop the job: coming back shows it again, from its start, still running or ended.
- Extends
- CustomShadowElement
Index
| url | where the jobs' api answers (api/jobs, relative to the site) | |
| job | the declared name of the job: follow its current run, and start new ones | |
| job-id | the id of the job to follow | |
| params | the parameters « Run » starts the job with (json) | |
| job accessor | The declared name of the job | |
| jobId accessor | The id of the job followed | |
| params accessor | The parameters « Run » starts the job with | |
| current readonly accessor | The record of the job followed: {id, job, title, state, progress, result, error, created, started, ended, info} | |
| constructor() | ||
| init() | ||
| disconnectedCallback() | ||
| isActive() | Whether the job followed is still queued or running | |
| load() | Follow the job of job-id, else the current or last run of job, and list job's earlier runs. | |
| loadHistory() | The earlier runs of job, newest first, in the select of the header | |
| run(params) | Start a new run of job, and follow it | |
| stop() | Ask the job followed to stop (it stops at its next check) | |
| attach(id) | Follow a job: its log from its start, then live until it ends | |
| detach() | Stop following the job (it goes on running). | |
| setRecord(record) | Show a job's record: its title, state, progress | |
| receive(event) | Show one of the job's events | |
| setProgress(progress) | Show how far the job is | |
| addLine(level, content, time) | Add a line to the log | |
| update() | Update the header: title, state, buttons | |
| tick(on) | Refresh the time it took every second, while the job runs | |
| showTime() | Show how long the job ran (or runs) | |
| fillHistory(list) | List the earlier runs in the header | |
| downloadLogs() | Download the log, as html | |
| clearLogs() | Empty the log shown (the job's own stays on the server) |
Attributes4
url
mmo-job.jhswhere the jobs' api answers (api/jobs, relative to the site)
url="api/jobs"
job
mmo-job.jhsthe declared name of the job: follow its current run, and start new ones
job
job-id
mmo-job.jhsthe id of the job to follow
job-id
params
mmo-job.jhsthe parameters « Run » starts the job with (json)
params
Properties4
job
accessormmo-job.jhs:67The declared name of the job
- Type
?string
jobId
accessormmo-job.jhs:80The id of the job followed
- Type
?string
params
accessormmo-job.jhs:93The parameters « Run » starts the job with
- Type
Object
current
readonlyaccessormmo-job.jhs:107The record of the job followed: {id, job, title, state, progress, result, error, created, started, ended, info}
- Type
?Object
Methods20
constructor()
mmo-job.jhs:39init()
mmo-job.jhs:49disconnectedCallback()
mmo-job.jhs:58isActive()
mmo-job.jhs:115Whether the job followed is still queued or running
| returns | boolean |
load()
mmo-job.jhs:126Follow the job of job-id, else the current or last run of job, and list job's earlier runs.
| returns | Promise |
loadHistory()
mmo-job.jhs:140The earlier runs of job, newest first, in the select of the header
| returns | Promise<Array> | their records |
run(params)
mmo-job.jhs:158Start a new run of job, and follow it
| params = null | ?Object | - its parameters (default: params) |
| returns | Promise<Object> | its record |
stop()
mmo-job.jhs:179Ask the job followed to stop (it stops at its next check)
| returns | Promise |
attach(id)
mmo-job.jhs:190Follow a job: its log from its start, then live until it ends
| id | string |
detach()
mmo-job.jhs:221Stop following the job (it goes on running).
setRecord(record)
mmo-job.jhs:233Show a job's record: its title, state, progress
| record | Object |
receive(event)
mmo-job.jhs:244Show one of the job's events
| event | Object | - {id, t, type, ...} |
setProgress(progress)
mmo-job.jhs:286Show how far the job is
| progress | Object | - {done, total, percent, label} |
addLine(level, content, time)
mmo-job.jhs:300Add a line to the log
| level | string | - a log level, or html, result, error |
| content | string | Node | - text (shown as text) or a node |
| time = null | ?number | - when, in seconds |
update()
mmo-job.jhs:310Update the header: title, state, buttons
tick(on)
mmo-job.jhs:330Refresh the time it took every second, while the job runs
| on | boolean |
showTime()
mmo-job.jhs:339Show how long the job ran (or runs)
fillHistory(list)
mmo-job.jhs:355List the earlier runs in the header
| list | Array | - their records, newest first |
downloadLogs()
mmo-job.jhs:365Download the log, as html
clearLogs()
mmo-job.jhs:375Empty the log shown (the job's own stays on the server)