remove sample plugin from being default installed

This commit is contained in:
KingKDot
2026-03-20 20:04:57 -05:00
parent b4dab0c8fc
commit 265321dce2
4 changed files with 0 additions and 254 deletions
@@ -1,89 +0,0 @@
:root {
color-scheme: dark;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: "Segoe UI", system-ui, sans-serif;
background: #0f1115;
color: #e8ecf1;
}
.container {
max-width: 820px;
margin: 40px auto;
padding: 0 20px;
}
.header h1 {
margin: 0 0 4px 0;
font-size: 28px;
}
.sub {
margin: 0 0 24px 0;
color: #9aa4b2;
}
.card {
background: #161a22;
border: 1px solid #222938;
border-radius: 12px;
padding: 18px;
margin-bottom: 18px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.row {
display: grid;
grid-template-columns: 120px 1fr;
gap: 12px;
align-items: center;
margin-bottom: 12px;
}
.label {
color: #9aa4b2;
font-size: 14px;
}
.input {
padding: 10px 12px;
border-radius: 8px;
border: 1px solid #2a3346;
background: #0f131b;
color: #e8ecf1;
}
.actions {
display: flex;
gap: 10px;
margin-top: 10px;
}
.btn {
background: #3b82f6;
color: #fff;
border: none;
padding: 10px 14px;
border-radius: 8px;
cursor: pointer;
font-weight: 600;
}
.btn:hover {
background: #2563eb;
}
.log {
min-height: 120px;
background: #0f131b;
border-radius: 8px;
border: 1px solid #2a3346;
padding: 12px;
white-space: pre-wrap;
}
@@ -1,48 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sample Plugin</title>
<link rel="stylesheet" href="/plugins/sample/assets/sample.css" />
</head>
<body>
<main class="container">
<header class="header">
<h1>Sample Plugin</h1>
<p class="sub">Go Native + UI plugin</p>
</header>
<section class="card">
<div class="row">
<label class="label">Client ID</label>
<input id="client-id" class="input" placeholder="clientId" />
</div>
<div class="row">
<label class="label">Message</label>
<input id="message" class="input" placeholder="hello from UI" />
</div>
<div class="row">
<label class="label">Message Box</label>
<input id="msgbox" class="input" placeholder="Windows only" />
</div>
<div class="actions">
<button id="send-btn" class="btn">Send event to client</button>
<button id="ping-btn" class="btn">Ping Test x100</button>
<button id="msgbox-btn" class="btn">Show Message Box</button>
<button id="run-cmd-btn" class="btn">Run Command (example)</button>
</div>
</section>
<section class="card">
<h2>Log</h2>
<pre id="log" class="log"></pre>
</section>
</main>
<script src="/plugins/sample/assets/sample.js"></script>
</body>
</html>
@@ -1,103 +0,0 @@
const params = new URLSearchParams(window.location.search);
const clientIdInput = document.getElementById("client-id");
const messageInput = document.getElementById("message");
const msgBoxInput = document.getElementById("msgbox");
const logEl = document.getElementById("log");
const sendBtn = document.getElementById("send-btn");
const pingBtn = document.getElementById("ping-btn");
const msgBoxBtn = document.getElementById("msgbox-btn");
const runCmdBtn = document.getElementById("run-cmd-btn");
const pluginId = "sample";
const clientIdFromUrl = params.get("clientId") || "";
clientIdInput.value = clientIdFromUrl;
messageInput.value = "hello from sample UI";
msgBoxInput.value = "Hello from Overlord";
function log(line) {
const ts = new Date().toISOString();
logEl.textContent = `${ts} ${line}\n` + logEl.textContent;
}
async function sendEvent(event, payload) {
const clientId = clientIdInput.value.trim();
if (!clientId) {
log("Missing clientId");
return;
}
const res = await fetch(`/api/clients/${encodeURIComponent(clientId)}/plugins/${pluginId}/event`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ event, payload }),
});
if (!res.ok) {
const text = await res.text();
log(`Send failed: ${res.status} ${text}`);
return;
}
log(`Sent event: ${event}`);
}
sendBtn.addEventListener("click", () => {
const message = messageInput.value.trim();
sendEvent("ui_message", { message });
});
pingBtn?.addEventListener("click", async () => {
const clientId = clientIdInput.value.trim();
if (!clientId) {
log("Missing clientId");
return;
}
const res = await fetch(`/api/clients/${encodeURIComponent(clientId)}/command`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "ping_bulk", count: 100 }),
});
if (!res.ok) {
const msg = await res.text();
log(`Ping test failed: ${msg}`);
return;
}
log("Ping test x100 dispatched (single request)");
});
msgBoxBtn?.addEventListener("click", async () => {
const clientId = clientIdInput.value.trim();
if (!clientId) {
log("Missing clientId");
return;
}
const text = msgBoxInput.value.trim() || "Hello from Overlord";
const script = `$os = $env:OS; if ($os -ne 'Windows_NT') { exit } ; Add-Type -AssemblyName PresentationFramework; [System.Windows.MessageBox]::Show('${text.replace(/'/g, "''")}') | Out-Null`;
const res = await fetch(`/api/clients/${encodeURIComponent(clientId)}/command`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "script_exec", script, scriptType: "powershell" }),
});
if (!res.ok) {
const msg = await res.text();
log(`Message box failed: ${msg}`);
return;
}
log("Message box command sent (Windows only)");
});
runCmdBtn?.addEventListener("click", async () => {
const clientId = clientIdInput.value.trim();
if (!clientId) {
log("Missing clientId");
return;
}
const res = await fetch(`/api/clients/${encodeURIComponent(clientId)}/command`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "screenshot" }),
});
if (!res.ok) {
const msg = await res.text();
log(`Command failed: ${msg}`);
return;
}
log("Command sent: screenshot");
});
@@ -1,14 +0,0 @@
{
"id": "sample",
"name": "sample",
"version": "1.0.0",
"binaries": {
"windows-amd64": "sample-windows-amd64.dll"
},
"entry": "sample.html",
"assets": {
"html": "sample.html",
"css": "sample.css",
"js": "sample.js"
}
}