Initial commit of index html and add ability to delete jobs

This commit is contained in:
Brett Williams
2022-12-07 18:24:02 -08:00
parent cc394932a1
commit fbaf2e3661
7 changed files with 252 additions and 38 deletions

View File

@@ -126,7 +126,7 @@ class RenderQueue:
try:
logger.debug("Saving Render History")
output = {'timestamp': datetime.now().isoformat(),
'jobs': [j.json_safe_copy() for j in cls.job_queue],
'jobs': [j.json() for j in cls.job_queue],
'clients': cls.render_clients}
output_path = json_path or JSON_FILE
with open(output_path, 'w') as f:
@@ -167,9 +167,16 @@ class RenderQueue:
@classmethod
def cancel_job(cls, job):
logger.info('Cancelling job ID: {}'.format(job.id))
logger.info(f'Cancelling job ID: {job.id}')
job.stop()
return job.render_status == RenderStatus.CANCELLED
return job.render_status() == RenderStatus.CANCELLED
@classmethod
def delete_job(cls, job):
logger.info(f"Deleting job ID: {job.id}")
job.stop()
cls.job_queue.remove(job)
return True
@classmethod
def renderer_instances(cls):