пофиксил отправку запросов для превью vMix

This commit is contained in:
2026-04-21 13:56:24 +03:00
parent 90c39957a1
commit de7c798837

View File

@@ -1192,7 +1192,7 @@
if (!inputName) return; if (!inputName) return;
try { try {
await fetch("/api/vmix/publish-command", { const response = await fetch("/api/vmix/publish-command", {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
@@ -1212,16 +1212,20 @@
} }
}) })
}); });
if (!response.ok) {
console.error("Ошибка отправки команды в vMix:", response.status);
}
} catch (error) { } catch (error) {
console.error("Не удалось отправить команду в vMix:", error); console.error("Не удалось отправить команду в vMix:", error);
} }
} }
document.addEventListener("click", function (event) { document.addEventListener("click", function (event) {
const link = event.target.closest(".tab-link[data-vmix-preview-input]"); const link = event.target.closest(".tab-link[data-vmix-title]");
if (!link) return; if (!link) return;
const inputName = link.dataset.vmixPreviewInput; const inputName = link.dataset.vmixTitle;
sendVmixPreviewInput(inputName); sendVmixPreviewInput(inputName);
}); });
})(); })();