changed to store history by uniqueid
fixed removing history items
This commit is contained in:
parent
5c5725dac0
commit
9f391ab656
5
main.py
5
main.py
|
@ -335,10 +335,11 @@ class PromptQueue:
|
|||
|
||||
def task_done(self, item_id, outputs):
|
||||
with self.mutex:
|
||||
self.history[item_id] = { "prompt": self.currently_running.pop(item_id), "outputs": {} }
|
||||
prompt = self.currently_running.pop(item_id)
|
||||
self.history[prompt[1]] = { "prompt": prompt, "outputs": {} }
|
||||
for o in outputs:
|
||||
if "ui" in outputs[o]:
|
||||
self.history[item_id]["outputs"][o] = outputs[o]["ui"]
|
||||
self.history[prompt[1]]["outputs"][o] = outputs[o]["ui"]
|
||||
self.server.queue_updated()
|
||||
|
||||
def get_current_queue(self):
|
||||
|
|
|
@ -790,7 +790,7 @@ function loadItems(type) {
|
|||
button.style.fontSize = "10px";
|
||||
button.delete_id = id;
|
||||
button.onclick = function(event) {
|
||||
deleteQueueElement(type, event.target.delete_id, loadItems);
|
||||
deleteQueueElement(type, event.target.delete_id, () => loadItems(type));
|
||||
};
|
||||
append_to_element.appendChild(button);
|
||||
}
|
||||
|
@ -807,11 +807,11 @@ function loadItems(type) {
|
|||
if(type === "queue") {
|
||||
items = data.queue_pending;
|
||||
} else {
|
||||
items = Object.values(data).map(d => d.prompt);
|
||||
items = Object.values(data);
|
||||
}
|
||||
items.sort((a, b) => a[0] - b[0]);
|
||||
for (let i in items) {
|
||||
append_to_list(items[i], queuecontents, true, type === "queue"? null : data[i].outputs);
|
||||
for (let i of items) {
|
||||
append_to_list(type === "queue" ? i : i.prompt, queuecontents, true, i.outputs);
|
||||
}
|
||||
}).catch((response) => {console.log(response)});
|
||||
}
|
||||
|
@ -891,7 +891,7 @@ function clearItems(type) {
|
|||
<br>
|
||||
</div>
|
||||
<span style="padding: 5px;display:inline-block;">
|
||||
<button style="font-size: 12px;" onclick="clearQueue()">Clear Queue</button>
|
||||
<button style="font-size: 12px;" onclick="clearItems('queue')">Clear Queue</button>
|
||||
<button style="font-size: 12px;" onclick="loadQueue()">Refresh</button>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -901,7 +901,7 @@ function clearItems(type) {
|
|||
<div id="historycontents" style="overflow-y: scroll;height: 100px;background-color: #d0d0d0;padding: 5px;">
|
||||
</div>
|
||||
<span style="padding: 5px;display:inline-block;">
|
||||
<button style="font-size: 12px;" onclick="clearHistory()">Clear History</button>
|
||||
<button style="font-size: 12px;" onclick="clearItems('history')">Clear History</button>
|
||||
<button style="font-size: 12px;" onclick="loadHistory()">Refresh</button>
|
||||
</span>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue