0.10.2-17 Queue Update

This commit is contained in:
2026-03-17 11:25:41 +00:00
parent 4008e4eb47
commit 57ffc40a95
7 changed files with 28 additions and 18 deletions
+19 -9
View File
@@ -1794,6 +1794,11 @@ export default function DashboardPage({
};
const openInsertQueueDialog = async (afterEntryId) => {
const hasJob = (queueState?.runningJobs || []).some((i) => i.jobId != null)
|| (queueState?.queuedJobs || []).some((i) => i.jobId != null);
if (!hasJob) {
return;
}
setInsertQueueDialog({ visible: true, afterEntryId: afterEntryId ?? null });
try {
const [scriptsRes, chainsRes] = await Promise.allSettled([api.getScripts(), api.getScriptChains()]);
@@ -1971,6 +1976,8 @@ export default function DashboardPage({
const queueRunningJobs = Array.isArray(queueState?.runningJobs) ? queueState.runningJobs : [];
const queuedJobs = Array.isArray(queueState?.queuedJobs) ? queueState.queuedJobs : [];
const canReorderQueue = queuedJobs.length > 1 && !queueReorderBusy;
const queueHasJobEntry = queueRunningJobs.some((i) => i.jobId != null)
|| queuedJobs.some((i) => i.jobId != null);
const buildRunningQueueScriptKey = (jobId) => `running-${normalizeJobId(jobId) || '-'}`;
const buildQueuedQueueScriptKey = (entryId) => `queued-${Number(entryId) || '-'}`;
const toggleQueueScriptDetails = (key) => {
@@ -2578,7 +2585,8 @@ export default function DashboardPage({
<button
type="button"
className="queue-add-entry-btn"
title="Skript, Kette oder Wartezeit zur Queue hinzufügen"
title={queueHasJobEntry ? 'Skript, Kette oder Wartezeit zur Queue hinzufügen' : 'Nur möglich wenn mind. ein Job in der Queue ist'}
disabled={!queueHasJobEntry}
onClick={() => void openInsertQueueDialog(null)}
>
<i className="pi pi-plus" /> Hinzufügen
@@ -2667,14 +2675,16 @@ export default function DashboardPage({
</div>
</div>
{detailsExpanded ? <QueueJobScriptSummary item={item} /> : null}
<button
type="button"
className="queue-insert-btn"
title="Eintrag danach einfügen"
onClick={() => void openInsertQueueDialog(entryId)}
>
<i className="pi pi-plus" />
</button>
{queueHasJobEntry ? (
<button
type="button"
className="queue-insert-btn"
title="Eintrag danach einfügen"
onClick={() => void openInsertQueueDialog(entryId)}
>
<i className="pi pi-plus" />
</button>
) : null}
</div>
);
})}