mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-08-13 13:18:27 +01:00
revert blocking image gen
This commit is contained in:
parent
34f8a05035
commit
f5427d18ed
@ -73,19 +73,6 @@
|
||||
background: #555;
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
background: #555;
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.queue-message {
|
||||
color: #ffcc00;
|
||||
font-size: 14px;
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
#spinner-overlay {
|
||||
position: fixed;
|
||||
@ -211,10 +198,9 @@
|
||||
|
||||
<div class="button-group">
|
||||
<button onclick="showSpinner(); location.href='/'">Back</button>
|
||||
<button id="send-prompt-btn" onclick="sendPrompt()">Send Prompt</button>
|
||||
<button id="random-prompt-btn" onclick="randomPrompt()">Random Prompt</button>
|
||||
<button onclick="sendPrompt()">Send Prompt</button>
|
||||
<button onclick="randomPrompt()">Random Prompt</button>
|
||||
</div>
|
||||
<div id="queue-message" class="queue-message"></div>
|
||||
|
||||
<div class="model-selection">
|
||||
<div class="model-group">
|
||||
@ -288,31 +274,10 @@
|
||||
{% block scripts %}
|
||||
<script>
|
||||
const overlay = document.getElementById('spinner-overlay');
|
||||
const sendPromptBtn = document.getElementById('send-prompt-btn');
|
||||
const randomPromptBtn = document.getElementById('random-prompt-btn');
|
||||
const queueMessage = document.getElementById('queue-message');
|
||||
|
||||
function showSpinner() { overlay.style.visibility = 'visible'; }
|
||||
|
||||
function updateButtonStates(queueCount) {
|
||||
if (queueCount > 0) {
|
||||
sendPromptBtn.disabled = true;
|
||||
randomPromptBtn.disabled = true;
|
||||
queueMessage.textContent = "Please wait until the current image is processed...";
|
||||
} else {
|
||||
sendPromptBtn.disabled = false;
|
||||
randomPromptBtn.disabled = false;
|
||||
queueMessage.textContent = "";
|
||||
}
|
||||
}
|
||||
|
||||
function sendPrompt() {
|
||||
// Check if buttons are disabled
|
||||
if (sendPromptBtn.disabled) {
|
||||
alert("Please wait until the current image is processed.");
|
||||
return;
|
||||
}
|
||||
|
||||
showSpinner();
|
||||
const prompt = document.getElementById('prompt-box').value;
|
||||
const model = document.getElementById('model-select').value;
|
||||
@ -338,12 +303,6 @@
|
||||
}
|
||||
|
||||
function randomPrompt() {
|
||||
// Check if buttons are disabled
|
||||
if (randomPromptBtn.disabled) {
|
||||
alert("Please wait until the current image is processed.");
|
||||
return;
|
||||
}
|
||||
|
||||
showSpinner();
|
||||
const model = document.getElementById('model-select').value;
|
||||
const promptModel = document.getElementById('prompt-model-select').value;
|
||||
@ -372,10 +331,6 @@
|
||||
const queueDropdown = document.getElementById('queue-dropdown');
|
||||
const queueCountSpan = document.getElementById('queue-count');
|
||||
|
||||
// Check initial queue count and update button states
|
||||
const initialQueueCount = parseInt(queueCountSpan.textContent) || 0;
|
||||
updateButtonStates(initialQueueCount);
|
||||
|
||||
// Toggle dropdown visibility
|
||||
queueBtn.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
@ -401,10 +356,7 @@
|
||||
fetch('/api/queue')
|
||||
.then(response => response.json())
|
||||
.then(jobs => {
|
||||
const queueCount = jobs.length;
|
||||
queueCountSpan.textContent = queueCount;
|
||||
updateButtonStates(queueCount);
|
||||
|
||||
queueCountSpan.textContent = jobs.length;
|
||||
const container = queueDropdown;
|
||||
container.innerHTML = '';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user