add deadmans key, fix downloading randomly stopping halfway through, add scripts to context menu.

This commit is contained in:
KingKDot
2026-05-16 16:33:40 -05:00
parent 089cf20bed
commit e2ef4a375f
6 changed files with 337 additions and 40 deletions
+35 -2
View File
@@ -746,9 +746,42 @@ function renderTemplatePalette() {
}
}
function applyContextMenuParams() {
const params = new URLSearchParams(window.location.search);
const clientId = params.get("clientId");
const scriptId = params.get("scriptId");
if (!clientId && !scriptId) return;
if (clientId) {
const found = allClients.find((c) => c.id === clientId);
if (found) {
selectedClients.clear();
selectedClients.add(clientId);
renderClients();
} else {
showToast(`Client ${clientId.substring(0, 8)} is not online`, "warning", 4000);
}
}
if (scriptId) {
const script = cachedSavedScripts.find((s) => s.id === scriptId);
if (script) {
setEditorValue(script.content);
scriptType.value = script.scriptType;
scriptSaveName.value = script.name;
setEditorMode(script.scriptType);
showToast(`Loaded "${script.name}" — ready to run`, "success", 3000);
} else {
showToast("Saved script not found", "error", 4000);
}
}
}
checkAuth();
loadClients();
loadSavedScripts().then(() => renderSavedScripts());
Promise.all([
loadClients(),
loadSavedScripts().then(() => renderSavedScripts()),
]).then(applyContextMenuParams);
loadAutoTasks();
renderTemplatePalette();