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 persistenceMethodContainer = document.getElementById("persistence-method-container");
|
||||
if (persistenceCheckbox && persistenceMethodContainer) {
|
||||
persistenceCheckbox.addEventListener("change", () => {
|
||||
if (persistenceCheckbox.checked) {
|
||||
persistenceMethodContainer.classList.remove("hidden");
|
||||
} else {
|
||||
persistenceMethodContainer.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
const persistenceEmptyState = document.getElementById("persistence-empty-state");
|
||||
const persistenceWindowsSettings = document.getElementById("persistence-windows-settings");
|
||||
const persistenceLinuxSettings = document.getElementById("persistence-linux-settings");
|
||||
const persistenceMacSettings = document.getElementById("persistence-macos-settings");
|
||||
const platformInputs = document.querySelectorAll('input[name="platform"]');
|
||||
|
||||
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 garbleSettingsContainer = document.getElementById("garble-settings-container");
|
||||
if (obfuscateCheckbox && garbleSettingsContainer) {
|
||||
@@ -265,7 +311,10 @@ form?.addEventListener("submit", async (e) => {
|
||||
const enablePersistence = form.querySelector(
|
||||
'input[name="enable-persistence"]',
|
||||
).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(
|
||||
'input[name="hide-console"]',
|
||||
).checked;
|
||||
@@ -293,7 +342,7 @@ form?.addEventListener("submit", async (e) => {
|
||||
disableCgo,
|
||||
obfuscate,
|
||||
enablePersistence,
|
||||
persistenceMethod: enablePersistence ? persistenceMethod : undefined,
|
||||
persistenceMethod: enablePersistence && hasWindowsTarget ? persistenceMethod : undefined,
|
||||
hideConsole,
|
||||
noPrinting,
|
||||
outputName: outputNameVal || undefined,
|
||||
|
||||
@@ -339,15 +339,23 @@
|
||||
>
|
||||
</div>
|
||||
</label>
|
||||
<!-- Persistence method selector – Windows only, shown when persistence is enabled -->
|
||||
<div
|
||||
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
|
||||
class="block text-xs font-medium text-slate-400 mb-1"
|
||||
for="persistence-method"
|
||||
>Windows Persistence Method</label
|
||||
>Persistence Method</label
|
||||
>
|
||||
<select
|
||||
id="persistence-method"
|
||||
@@ -359,10 +367,28 @@
|
||||
<option value="taskscheduler">Task Scheduler (ONLOGON, requires admin)</option>
|
||||
<option value="wmi">WMI Subscription (requires admin)</option>
|
||||
</select>
|
||||
<p class="text-xs text-slate-500 mt-1">
|
||||
Method used on Windows; other platforms use their native mechanism
|
||||
</div>
|
||||
|
||||
<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>
|
||||
</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
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user