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