This commit is contained in:
Mateusz Gruszczyński
2026-09-02 09:27:24 +02:00
parent 87b68187e7
commit 8180d22cef
7 changed files with 16 additions and 16 deletions
+7 -6
View File
@@ -255,11 +255,6 @@ $('#haTest').addEventListener('click', async event => {
finally { button.disabled = false; button.textContent = idle; }
});
$('#simulationRefresh')?.addEventListener('click', async () => {
try { await loadControlPlan(); toast(tr('common.updated')); }
catch (error) { toast(error.message, true); }
});
$('#exportSettings').addEventListener('click', async () => {
try {
const data = await api('/api/settings/export');
@@ -327,7 +322,13 @@ $('#flowSharedInputTest')?.addEventListener('click', async event => {
if (!form || !resultHost) return;
const kind = form.kind.value, config = collectFlowSharedInputConfig(kind);
const entityId = String(config.entity_id || '').trim();
if (!entityId) return toast(tr('flow.sharedInputTestEntityRequired'), true);
if (!entityId) {
resultHost.hidden = false;
resultHost.classList.remove('pass');
resultHost.classList.add('fail');
resultHost.innerHTML = `<strong>${esc(tr('flow.sharedInputTestUnavailable'))}</strong><span>${esc(tr('flow.sharedInputTestEntityRequired'))}</span>`;
return;
}
const button = event.currentTarget, idle = button.textContent;
button.disabled = true; button.textContent = tr('flow.sharedInputTesting');
resultHost.hidden = false; resultHost.innerHTML = `<span>${esc(tr('flow.sharedInputTesting'))}</span>`;