Implemented JeLuF's suggestion

This commit is contained in:
ManInDark 2023-08-12 16:23:36 +02:00
parent 2bf7116f01
commit f3367a6773
No known key found for this signature in database
GPG Key ID: 72EC12A5B2D62779

View File

@ -3097,12 +3097,12 @@ function galleryImage(item) {
function refreshGallery() {
let container = document.getElementById("imagecontainer")
let promptsearchfield = document.getElementById("gallery-prompt-search").value
let promptsearch = promptsearchfield.length > 0 ? "prompt=" + promptsearchfield + "&" : ""
let modelsearchfield = document.getElementById("gallery-model-search").value
let modelsearch = modelsearchfield.length > 0 ? "model=" + modelsearchfield + "&" : ""
params = new URLSearchParams({
prompt: promptsearchfield,
model: modelsearchfield
})
container.innerHTML=""
fetch('/all_images?' + promptsearch + modelsearch)
fetch('/all_images?' + params)
.then(response => response.json())
.then(json => {
console.log(json)