mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
93b77cb4f0
* 14729 rq table * 14729 rq table * 14729 rq table * 14729 rq table * 14729 jobs table * 14729 jobs detail * 14729 formatting fixup * 14729 formatting fixup * 14729 format datetime in tables * 14729 display job id * Update templates for #12128 * 14729 review fixes * 14729 review fixes * 14729 review fixes * 14729 review fixes * 14729 merge feature * 14729 add modal * 14729 review changes * 14729 url fixup * 14729 no queue param on task * 14729 queue pages * 14729 job status handling * 14729 worker list * 14729 exec detail and common view * 14729 worker detail * 14729 background task delete * 14729 background task delete * 14729 background task requeue * 14729 background task enqueue stop * 14729 review changes * 14729 remove rq from admin * 14729 add tests * 14729 add tests * Clean up HTML templates * Clean up tables * Clean up views * Fix tests * Clean up tests * Move navigation menu entry for background tasks * Remove custom deletion form --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
27 lines
677 B
Python
27 lines
677 B
Python
from dataclasses import dataclass
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
from rq.job import JobStatus
|
|
|
|
__all__ = (
|
|
'RQ_TASK_STATUSES',
|
|
)
|
|
|
|
|
|
@dataclass
|
|
class Status:
|
|
label: str
|
|
color: str
|
|
|
|
|
|
RQ_TASK_STATUSES = {
|
|
JobStatus.QUEUED: Status(_('Queued'), 'cyan'),
|
|
JobStatus.FINISHED: Status(_('Finished'), 'green'),
|
|
JobStatus.FAILED: Status(_('Failed'), 'red'),
|
|
JobStatus.STARTED: Status(_('Started'), 'blue'),
|
|
JobStatus.DEFERRED: Status(_('Deferred'), 'gray'),
|
|
JobStatus.SCHEDULED: Status(_('Scheduled'), 'purple'),
|
|
JobStatus.STOPPED: Status(_('Stopped'), 'orange'),
|
|
JobStatus.CANCELED: Status(_('Cancelled'), 'yellow'),
|
|
}
|