|
|
|
@ -82,7 +82,7 @@ class PromptServer():
|
|
|
|
|
|
|
|
|
|
@routes.get("/history") |
|
|
|
|
async def get_history(request): |
|
|
|
|
return web.json_response(self.prompt_queue.history) |
|
|
|
|
return web.json_response(self.prompt_queue.get_history()) |
|
|
|
|
|
|
|
|
|
@routes.get("/queue") |
|
|
|
|
async def get_queue(request): |
|
|
|
@ -146,11 +146,11 @@ class PromptServer():
|
|
|
|
|
json_data = await request.json() |
|
|
|
|
if "clear" in json_data: |
|
|
|
|
if json_data["clear"]: |
|
|
|
|
self.prompt_queue.history = {} |
|
|
|
|
self.prompt_queue.wipe_history() |
|
|
|
|
if "delete" in json_data: |
|
|
|
|
to_delete = json_data['delete'] |
|
|
|
|
for id_to_delete in to_delete: |
|
|
|
|
self.prompt_queue.history.pop(id_to_delete, None) |
|
|
|
|
self.prompt_queue.delete_history_item(id_to_delete) |
|
|
|
|
|
|
|
|
|
return web.Response(status=200) |
|
|
|
|
|
|
|
|
|