better looking building for mutli OS
This commit is contained in:
@@ -81,16 +81,62 @@ if (rawServerListCheckbox && serverUrlInput) {
|
|||||||
|
|
||||||
const persistenceCheckbox = document.querySelector('input[name="enable-persistence"]');
|
const persistenceCheckbox = document.querySelector('input[name="enable-persistence"]');
|
||||||
const persistenceMethodContainer = document.getElementById("persistence-method-container");
|
const persistenceMethodContainer = document.getElementById("persistence-method-container");
|
||||||
if (persistenceCheckbox && persistenceMethodContainer) {
|
const persistenceEmptyState = document.getElementById("persistence-empty-state");
|
||||||
persistenceCheckbox.addEventListener("change", () => {
|
const persistenceWindowsSettings = document.getElementById("persistence-windows-settings");
|
||||||
if (persistenceCheckbox.checked) {
|
const persistenceLinuxSettings = document.getElementById("persistence-linux-settings");
|
||||||
persistenceMethodContainer.classList.remove("hidden");
|
const persistenceMacSettings = document.getElementById("persistence-macos-settings");
|
||||||
} else {
|
const platformInputs = document.querySelectorAll('input[name="platform"]');
|
||||||
persistenceMethodContainer.classList.add("hidden");
|
|
||||||
}
|
function getSelectedPlatformFamilies() {
|
||||||
});
|
const selectedPlatforms = Array.from(
|
||||||
|
document.querySelectorAll('input[name="platform"]:checked'),
|
||||||
|
).map((el) => el.value);
|
||||||
|
|
||||||
|
return {
|
||||||
|
windows: selectedPlatforms.some((platform) => platform.startsWith("windows-")),
|
||||||
|
linux: selectedPlatforms.some((platform) => platform.startsWith("linux-")),
|
||||||
|
darwin: selectedPlatforms.some((platform) => platform.startsWith("darwin-")),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updatePersistenceSettingsVisibility() {
|
||||||
|
if (!persistenceMethodContainer) return;
|
||||||
|
|
||||||
|
const persistenceEnabled = !!persistenceCheckbox?.checked;
|
||||||
|
if (!persistenceEnabled) {
|
||||||
|
persistenceMethodContainer.classList.add("hidden");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
persistenceMethodContainer.classList.remove("hidden");
|
||||||
|
|
||||||
|
const families = getSelectedPlatformFamilies();
|
||||||
|
const hasSupportedFamily = families.windows || families.linux || families.darwin;
|
||||||
|
|
||||||
|
if (persistenceWindowsSettings) {
|
||||||
|
persistenceWindowsSettings.classList.toggle("hidden", !families.windows);
|
||||||
|
}
|
||||||
|
if (persistenceLinuxSettings) {
|
||||||
|
persistenceLinuxSettings.classList.toggle("hidden", !families.linux);
|
||||||
|
}
|
||||||
|
if (persistenceMacSettings) {
|
||||||
|
persistenceMacSettings.classList.toggle("hidden", !families.darwin);
|
||||||
|
}
|
||||||
|
if (persistenceEmptyState) {
|
||||||
|
persistenceEmptyState.classList.toggle("hidden", hasSupportedFamily);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (persistenceCheckbox && persistenceMethodContainer) {
|
||||||
|
persistenceCheckbox.addEventListener("change", updatePersistenceSettingsVisibility);
|
||||||
|
}
|
||||||
|
|
||||||
|
platformInputs.forEach((input) => {
|
||||||
|
input.addEventListener("change", updatePersistenceSettingsVisibility);
|
||||||
|
});
|
||||||
|
|
||||||
|
updatePersistenceSettingsVisibility();
|
||||||
|
|
||||||
const obfuscateCheckbox = document.querySelector('input[name="obfuscate"]');
|
const obfuscateCheckbox = document.querySelector('input[name="obfuscate"]');
|
||||||
const garbleSettingsContainer = document.getElementById("garble-settings-container");
|
const garbleSettingsContainer = document.getElementById("garble-settings-container");
|
||||||
if (obfuscateCheckbox && garbleSettingsContainer) {
|
if (obfuscateCheckbox && garbleSettingsContainer) {
|
||||||
@@ -265,7 +311,10 @@ form?.addEventListener("submit", async (e) => {
|
|||||||
const enablePersistence = form.querySelector(
|
const enablePersistence = form.querySelector(
|
||||||
'input[name="enable-persistence"]',
|
'input[name="enable-persistence"]',
|
||||||
).checked;
|
).checked;
|
||||||
const persistenceMethod = form.querySelector('#persistence-method')?.value || 'startup';
|
const hasWindowsTarget = platforms.some((platform) => platform.startsWith("windows-"));
|
||||||
|
const persistenceMethod = hasWindowsTarget
|
||||||
|
? form.querySelector("#persistence-method")?.value || "startup"
|
||||||
|
: undefined;
|
||||||
const hideConsole = form.querySelector(
|
const hideConsole = form.querySelector(
|
||||||
'input[name="hide-console"]',
|
'input[name="hide-console"]',
|
||||||
).checked;
|
).checked;
|
||||||
@@ -293,7 +342,7 @@ form?.addEventListener("submit", async (e) => {
|
|||||||
disableCgo,
|
disableCgo,
|
||||||
obfuscate,
|
obfuscate,
|
||||||
enablePersistence,
|
enablePersistence,
|
||||||
persistenceMethod: enablePersistence ? persistenceMethod : undefined,
|
persistenceMethod: enablePersistence && hasWindowsTarget ? persistenceMethod : undefined,
|
||||||
hideConsole,
|
hideConsole,
|
||||||
noPrinting,
|
noPrinting,
|
||||||
outputName: outputNameVal || undefined,
|
outputName: outputNameVal || undefined,
|
||||||
|
|||||||
@@ -339,15 +339,23 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<!-- Persistence method selector – Windows only, shown when persistence is enabled -->
|
|
||||||
<div
|
<div
|
||||||
id="persistence-method-container"
|
id="persistence-method-container"
|
||||||
class="hidden pl-3 border-l-2 border-orange-500/40"
|
class="hidden pl-3 border-l-2 border-orange-500/40 space-y-3"
|
||||||
>
|
>
|
||||||
|
<div id="persistence-empty-state" class="hidden text-xs text-slate-500">
|
||||||
|
No supported persistence targets selected. Select Windows, Linux, or macOS targets to configure persistence.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="persistence-windows-settings" class="hidden" data-persistence-os="windows">
|
||||||
|
<div class="text-xs font-semibold text-slate-300 mb-2 flex items-center gap-2">
|
||||||
|
<i class="fa-brands fa-windows text-blue-400"></i>
|
||||||
|
Windows Persistence Settings
|
||||||
|
</div>
|
||||||
<label
|
<label
|
||||||
class="block text-xs font-medium text-slate-400 mb-1"
|
class="block text-xs font-medium text-slate-400 mb-1"
|
||||||
for="persistence-method"
|
for="persistence-method"
|
||||||
>Windows Persistence Method</label
|
>Persistence Method</label
|
||||||
>
|
>
|
||||||
<select
|
<select
|
||||||
id="persistence-method"
|
id="persistence-method"
|
||||||
@@ -359,10 +367,28 @@
|
|||||||
<option value="taskscheduler">Task Scheduler (ONLOGON, requires admin)</option>
|
<option value="taskscheduler">Task Scheduler (ONLOGON, requires admin)</option>
|
||||||
<option value="wmi">WMI Subscription (requires admin)</option>
|
<option value="wmi">WMI Subscription (requires admin)</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="text-xs text-slate-500 mt-1">
|
</div>
|
||||||
Method used on Windows; other platforms use their native mechanism
|
|
||||||
|
<div id="persistence-linux-settings" class="hidden" data-persistence-os="linux">
|
||||||
|
<div class="text-xs font-semibold text-slate-300 mb-1 flex items-center gap-2">
|
||||||
|
<i class="fa-brands fa-linux text-amber-400"></i>
|
||||||
|
Linux Persistence Settings
|
||||||
|
</div>
|
||||||
|
<p class="text-xs text-slate-500">
|
||||||
|
Uses user-level <code>systemd</code> service when available; falls back to desktop autostart.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="persistence-macos-settings" class="hidden" data-persistence-os="darwin">
|
||||||
|
<div class="text-xs font-semibold text-slate-300 mb-1 flex items-center gap-2">
|
||||||
|
<i class="fa-brands fa-apple text-slate-200"></i>
|
||||||
|
macOS Persistence Settings
|
||||||
|
</div>
|
||||||
|
<p class="text-xs text-slate-500">
|
||||||
|
Uses <code>LaunchAgents</code> (<code>com.overlord.agent.plist</code>) for login persistence.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<label
|
<label
|
||||||
class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-emerald-500 transition-colors"
|
class="flex items-center gap-2 p-3 bg-slate-800/60 border border-slate-700 rounded-lg cursor-pointer hover:border-emerald-500 transition-colors"
|
||||||
title="Windows only: build without a console window"
|
title="Windows only: build without a console window"
|
||||||
|
|||||||
Reference in New Issue
Block a user