upgrade UI for process manager + logs.

This commit is contained in:
KingKDot
2026-07-14 00:14:41 -05:00
parent 4042d4f768
commit a9bf923e7a
4 changed files with 237 additions and 250 deletions
+53 -20
View File
@@ -8,26 +8,28 @@ const refreshBtn = document.getElementById("refresh-btn");
const prevPageBtn = document.getElementById("prev-page");
const nextPageBtn = document.getElementById("next-page");
const pageInfo = document.getElementById("page-info");
const logsCount = document.getElementById("logs-count");
const clearFiltersBtn = document.getElementById("clear-filters-btn");
const actionLabels = {
client_first_connect: {
label: "First Connect",
className: "bg-emerald-900/40 text-emerald-200 border border-emerald-800",
className: "bg-emerald-500/10 text-emerald-300 border-emerald-500/30",
icon: "fa-plug-circle-bolt",
},
client_reconnect: {
label: "Reconnect",
className: "bg-blue-900/40 text-blue-200 border border-blue-800",
className: "bg-blue-500/10 text-blue-300 border-blue-500/30",
icon: "fa-rotate",
},
client_disconnect: {
label: "Disconnect",
className: "bg-orange-900/40 text-orange-200 border border-orange-800",
className: "bg-orange-500/10 text-orange-300 border-orange-500/30",
icon: "fa-plug-circle-xmark",
},
uninstall: {
label: "Uninstall",
className: "bg-rose-900/40 text-rose-200 border border-rose-800",
className: "bg-rose-500/10 text-rose-300 border-rose-500/30",
icon: "fa-trash",
},
};
@@ -98,15 +100,21 @@ function renderLogs(logs) {
logsContainer.innerHTML = "";
if (!logs || logs.length === 0) {
logsEmpty.classList.remove("hidden");
if (logsCount) logsCount.textContent = "0 matching events";
return;
}
logsEmpty.classList.add("hidden");
if (logsCount) {
const first = (page - 1) * pageSize + 1;
const last = Math.min(first + logs.length - 1, total);
logsCount.textContent = `${total.toLocaleString()} events · showing ${first}–${last}`;
}
logsContainer.innerHTML = logs
.map((log) => {
const meta = actionLabels[log.action] || {
label: log.action,
className: "bg-slate-800/60 text-slate-200 border border-slate-700",
className: "bg-slate-800 text-slate-300 border-slate-700",
icon: "fa-circle-info",
};
const clientId = log.targetClientId || "-";
@@ -114,25 +122,26 @@ function renderLogs(logs) {
const detailText = parseDetails(log.details);
return `
<div class="bg-slate-950/60 border border-slate-800 rounded-lg p-4 flex flex-col gap-2">
<div class="flex items-center justify-between gap-3 flex-wrap">
<div class="flex items-center gap-3">
<span class="inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs ${meta.className}">
<article class="px-4 sm:px-5 py-4 flex gap-3 sm:gap-4 hover:bg-slate-800/20 transition-colors">
<div class="inline-flex items-center justify-center w-9 h-9 shrink-0 rounded-lg border ${meta.className}">
<i class="fa-solid ${meta.icon}"></i>
${meta.label}
</span>
<span class="text-sm text-slate-300" title="${escapeHtml(clientId)}">
Client: <span class="font-mono">${escapeHtml(shortId)}</span>
</span>
</div>
<div class="text-xs text-slate-400">${formatTimestamp(log.timestamp)}</div>
<div class="flex-1 min-w-0">
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-1 sm:gap-3">
<div class="flex items-center gap-2 min-w-0">
<span class="text-sm font-semibold text-slate-200">${escapeHtml(meta.label || "Event")}</span>
<span class="text-xs text-slate-500">Client</span>
<span class="font-mono text-xs text-sky-300 truncate" title="${escapeHtml(clientId)}">${escapeHtml(shortId)}</span>
</div>
<div class="text-xs text-slate-500 flex flex-wrap gap-3">
<span>IP: ${escapeHtml(log.ip || "-")}</span>
<span>User: ${escapeHtml(log.username || "-")}</span>
<time class="text-xs text-slate-500 shrink-0">${formatTimestamp(log.timestamp)}</time>
</div>
${detailText ? `<div class="text-xs text-slate-400">Details: ${detailText}</div>` : ""}
<div class="mt-1.5 text-xs text-slate-500 flex flex-wrap gap-x-4 gap-y-1">
<span><i class="fa-solid fa-globe mr-1 text-slate-600"></i>${escapeHtml(log.ip || "-")}</span>
<span><i class="fa-solid fa-user mr-1 text-slate-600"></i>${escapeHtml(log.username || "-")}</span>
</div>
${detailText ? `<div class="mt-2 rounded-md bg-slate-950/60 border border-slate-800 px-2.5 py-2 text-xs font-mono text-slate-400 break-all">${detailText}</div>` : ""}
</div>
</article>
`;
})
.join("");
@@ -140,6 +149,18 @@ function renderLogs(logs) {
async function loadLogs() {
try {
if (refreshBtn) refreshBtn.disabled = true;
if (logsCount) logsCount.textContent = "Loading events…";
if (getSelectedActions().length === 0) {
total = 0;
page = 1;
renderLogs([]);
pageInfo.textContent = "Page 1 of 1";
prevPageBtn.disabled = true;
nextPageBtn.disabled = true;
lastUpdate.textContent = new Date().toLocaleTimeString();
return;
}
const params = buildQuery();
const res = await fetch(`/api/audit-logs?${params.toString()}`);
if (!res.ok) {
@@ -160,9 +181,12 @@ async function loadLogs() {
console.error("Failed to load logs", err);
if (logsContainer) {
logsContainer.innerHTML = `
<div class="text-rose-300 text-sm">Failed to load logs. Please try again.</div>
<div class="px-5 py-12 text-center text-rose-300 text-sm"><i class="fa-solid fa-circle-exclamation mr-2"></i>Failed to load logs. Please try again.</div>
`;
}
if (logsCount) logsCount.textContent = "Unable to load events";
} finally {
if (refreshBtn) refreshBtn.disabled = false;
}
}
@@ -181,6 +205,15 @@ clientFilter?.addEventListener("input", debounceLoad);
startDateInput?.addEventListener("change", resetAndLoad);
endDateInput?.addEventListener("change", resetAndLoad);
refreshBtn?.addEventListener("click", resetAndLoad);
clearFiltersBtn?.addEventListener("click", () => {
if (clientFilter) clientFilter.value = "";
if (startDateInput) startDateInput.value = "";
if (endDateInput) endDateInput.value = "";
document.querySelectorAll(".action-checkbox").forEach((checkbox) => {
checkbox.checked = true;
});
resetAndLoad();
});
Array.from(document.querySelectorAll(".action-checkbox")).forEach((cb) => {
cb.addEventListener("change", resetAndLoad);
+14 -11
View File
@@ -28,7 +28,7 @@ const searchInput = document.getElementById("search-input");
const clientIdHeader = document.getElementById("client-id-header");
if (clientIdHeader) {
clientIdHeader.textContent = `${clientId} - Process Manager`;
clientIdHeader.innerHTML = `<i class="fa-solid fa-microchip mr-1.5 text-sky-400"></i>${escapeHtml(clientId)}`;
}
function connect() {
@@ -76,10 +76,13 @@ function updateStatus(state, text) {
};
statusEl.innerHTML = `${icons[state] || icons.disconnected} ${text}`;
statusEl.className =
state === "connected"
? "inline-flex items-center gap-2 px-3 py-2 rounded-full bg-green-900/40 text-green-100 border border-green-700/60"
: "inline-flex items-center gap-2 px-3 py-2 rounded-full bg-slate-800 text-slate-300";
const stateClasses = {
connected: "bg-emerald-500/10 text-emerald-300 border-emerald-500/30",
error: "bg-red-500/10 text-red-300 border-red-500/30",
disconnected: "bg-slate-800 text-slate-300 border-slate-700",
connecting: "bg-sky-500/10 text-sky-300 border-sky-500/30",
};
statusEl.className = `inline-flex self-start sm:self-auto items-center gap-2 px-3 py-1.5 rounded-full border text-xs font-medium ${stateClasses[state] || stateClasses.disconnected}`;
}
function enableControls(enabled) {
@@ -280,7 +283,7 @@ function renderProcesses() {
function rowClassName(proc) {
let cls =
"process-row grid grid-cols-12 gap-3 px-4 py-3 border border-transparent cursor-pointer transition-colors";
"process-row grid grid-cols-12 gap-3 px-4 py-3 border-l-2 border-transparent cursor-pointer transition-colors";
if (selectedPid === proc.pid) cls += " selected";
if (proc.self) cls += " self-process";
return cls;
@@ -356,14 +359,14 @@ function rowInnerHtml(proc, depth) {
: "";
return `
<div class="col-span-1 text-sm font-mono text-slate-400">${proc.pid}</div>
<div class="col-span-4 flex items-center gap-1 truncate">
<div class="process-cell process-pid col-span-1 text-sm font-mono text-slate-400" data-label="PID">${proc.pid}</div>
<div class="process-cell process-name col-span-4 flex items-center gap-1 truncate">
${indent}${treeIcon}${procIcon}
<span class="truncate ${nameColor}">${escapeHtml(proc.name)}</span>${selfBadge}
</div>
<div class="col-span-2 text-sm ${cpuColor} font-semibold">${displayCpu.toFixed(1)}%</div>
<div class="col-span-2 text-sm ${memColor}">${memoryStr}</div>
<div class="col-span-3 text-sm text-slate-500 truncate">${escapeHtml(proc.username || "-")}</div>
<div class="process-cell process-cpu col-span-2 text-sm ${cpuColor} font-semibold" data-label="CPU">${displayCpu.toFixed(1)}%</div>
<div class="process-cell process-memory col-span-2 text-sm ${memColor}" data-label="Memory">${memoryStr}</div>
<div class="process-cell process-user col-span-3 text-sm text-slate-500 truncate" data-label="User">${escapeHtml(proc.username || "-")}</div>
`;
}
+88 -85
View File
@@ -9,7 +9,7 @@
<link rel="stylesheet" href="/vendor/inter/400.css" />
<link rel="stylesheet" href="/vendor/inter/600.css" />
<link rel="stylesheet" href="/vendor/inter/700.css" />
<link rel="stylesheet" href="/assets/tailwind.css" />
<link rel="stylesheet" href="/assets/tailwind.css" />
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" />
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<link rel="stylesheet" href="/assets/main.css" />
@@ -20,109 +20,112 @@
<body class="min-h-screen bg-slate-950 text-slate-100">
<header id="top-nav"></header>
<main class="px-5 py-6">
<div class="max-w-7xl mx-auto flex flex-col gap-6">
<div class="flex items-center justify-between gap-3 flex-wrap">
<main class="max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="mb-6 flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3">
<div>
<h1 class="text-2xl font-semibold">Client Connection Logs</h1>
<p class="text-slate-400">
Track first connects, reconnects, uninstalls, and disconnects.
</p>
<h1 class="text-2xl font-bold text-slate-100">Client Connection Logs</h1>
<p class="text-slate-400 text-sm mt-1">Review connection lifecycle activity across enrolled clients.</p>
</div>
<div class="text-sm text-slate-400">
Updated: <span id="last-update">Never</span>
<div class="inline-flex self-start sm:self-auto items-center gap-2 px-3 py-1.5 rounded-full border border-slate-700 bg-slate-900/60 text-xs text-slate-400">
<i class="fa-solid fa-clock-rotate-left text-indigo-400"></i>
Updated <span id="last-update" class="text-slate-200">Never</span>
</div>
</div>
<section class="bg-slate-900/70 border border-slate-800 rounded-lg p-4">
<div class="grid grid-cols-1 md:grid-cols-4 gap-4">
<div class="flex flex-col gap-2">
<label class="text-xs text-slate-400" for="client-filter">
Client ID
</label>
<input
id="client-filter"
type="text"
placeholder="Search client id"
class="w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-800 text-slate-100"
/>
<section class="bg-slate-900/60 border border-slate-800 rounded-xl p-4 sm:p-5 mb-6 space-y-4">
<div class="flex items-center gap-3">
<div class="flex items-center justify-center w-9 h-9 rounded-lg bg-indigo-500/10 border border-indigo-500/30">
<i class="fa-solid fa-filter text-indigo-400"></i>
</div>
<div class="flex flex-col gap-2">
<label class="text-xs text-slate-400" for="start-date">
Start
</label>
<input
id="start-date"
type="datetime-local"
class="w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-800 text-slate-100"
/>
<div>
<h2 class="text-base font-semibold">Filter activity</h2>
<p class="text-xs text-slate-400">Narrow results by client, time range, or event type.</p>
</div>
<div class="flex flex-col gap-2">
<label class="text-xs text-slate-400" for="end-date">
End
</label>
<input
id="end-date"
type="datetime-local"
class="w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-800 text-slate-100"
/>
</div>
<div class="flex items-end gap-2">
<button
id="refresh-btn"
class="px-4 py-2 rounded-lg bg-indigo-600/70 hover:bg-indigo-600 border border-indigo-500 text-indigo-100"
>
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-3">
<div class="xl:col-span-2">
<label class="block text-xs font-medium text-slate-400 mb-1.5" for="client-filter">Client ID</label>
<div class="relative">
<i class="fa-solid fa-magnifying-glass absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"></i>
<input id="client-filter" type="search" placeholder="Search by client ID"
class="w-full pl-10 pr-3 py-2.5 rounded-lg bg-slate-950/70 border border-slate-700 text-slate-100 placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/60 focus:border-indigo-500" />
</div>
</div>
<div>
<label class="block text-xs font-medium text-slate-400 mb-1.5" for="start-date">From</label>
<input id="start-date" type="datetime-local"
class="w-full px-3 py-2.5 rounded-lg bg-slate-950/70 border border-slate-700 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/60 focus:border-indigo-500" />
</div>
<div>
<label class="block text-xs font-medium text-slate-400 mb-1.5" for="end-date">To</label>
<input id="end-date" type="datetime-local"
class="w-full px-3 py-2.5 rounded-lg bg-slate-950/70 border border-slate-700 text-slate-100 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/60 focus:border-indigo-500" />
</div>
</div>
<div class="pt-4 border-t border-slate-800 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-3">
<div id="action-filters" class="flex flex-wrap gap-2">
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-emerald-500/5 border border-emerald-500/20 text-sm cursor-pointer hover:bg-emerald-500/10">
<input type="checkbox" class="action-checkbox accent-emerald-500" value="client_first_connect" checked />
<i class="fa-solid fa-plug-circle-bolt text-emerald-400"></i><span class="text-emerald-200">First connect</span>
</label>
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-blue-500/5 border border-blue-500/20 text-sm cursor-pointer hover:bg-blue-500/10">
<input type="checkbox" class="action-checkbox accent-blue-500" value="client_reconnect" checked />
<i class="fa-solid fa-rotate text-blue-400"></i><span class="text-blue-200">Reconnect</span>
</label>
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-orange-500/5 border border-orange-500/20 text-sm cursor-pointer hover:bg-orange-500/10">
<input type="checkbox" class="action-checkbox accent-orange-500" value="client_disconnect" checked />
<i class="fa-solid fa-plug-circle-xmark text-orange-400"></i><span class="text-orange-200">Disconnect</span>
</label>
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-rose-500/5 border border-rose-500/20 text-sm cursor-pointer hover:bg-rose-500/10">
<input type="checkbox" class="action-checkbox accent-rose-500" value="uninstall" checked />
<i class="fa-solid fa-trash text-rose-400"></i><span class="text-rose-200">Uninstall</span>
</label>
</div>
<div class="flex gap-2">
<button id="clear-filters-btn" class="flex-1 lg:flex-none inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg border border-slate-700 bg-slate-800 hover:bg-slate-700 text-slate-300 text-sm">
<i class="fa-solid fa-filter-circle-xmark"></i> Reset
</button>
<button id="refresh-btn" class="flex-1 lg:flex-none inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-indigo-600 hover:bg-indigo-500 border border-indigo-500 text-white font-medium text-sm">
<i class="fa-solid fa-rotate"></i> Refresh
</button>
</div>
</div>
<div class="mt-4 flex flex-wrap gap-2" id="action-filters">
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-slate-950/70 border border-slate-800 text-sm">
<input type="checkbox" class="action-checkbox" value="client_first_connect" checked />
<span class="text-emerald-300">First Connect</span>
</label>
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-slate-950/70 border border-slate-800 text-sm">
<input type="checkbox" class="action-checkbox" value="client_reconnect" checked />
<span class="text-blue-300">Reconnect</span>
</label>
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-slate-950/70 border border-slate-800 text-sm">
<input type="checkbox" class="action-checkbox" value="client_disconnect" checked />
<span class="text-orange-300">Disconnect</span>
</label>
<label class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-slate-950/70 border border-slate-800 text-sm">
<input type="checkbox" class="action-checkbox" value="uninstall" checked />
<span class="text-rose-300">Uninstall</span>
</label>
</div>
</section>
<section class="bg-slate-900/70 border border-slate-800 rounded-lg p-4">
<div id="logs-container" class="space-y-3"></div>
<div
id="logs-empty"
class="hidden text-center text-slate-500 py-10"
>
<i class="fa-solid fa-inbox text-4xl mb-3"></i>
<p>No log entries found.</p>
<section class="bg-slate-900/60 border border-slate-800 rounded-xl overflow-hidden">
<div class="px-4 sm:px-5 py-4 border-b border-slate-800 flex items-center justify-between gap-3">
<div class="flex items-center gap-3">
<div class="flex items-center justify-center w-9 h-9 rounded-lg bg-sky-500/10 border border-sky-500/30">
<i class="fa-solid fa-timeline text-sky-400"></i>
</div>
<div class="mt-4 flex items-center justify-between text-sm">
<button
id="prev-page"
class="px-3 py-2 rounded-lg bg-slate-800/70 border border-slate-700 text-slate-200 disabled:opacity-40"
>
<i class="fa-solid fa-arrow-left"></i> Previous
<div>
<h2 class="text-base font-semibold">Activity timeline</h2>
<p id="logs-count" class="text-xs text-slate-400">Loading events…</p>
</div>
</div>
</div>
<div id="logs-container" class="divide-y divide-slate-800/80"></div>
<div id="logs-empty" class="hidden text-center px-4 py-16">
<div class="mx-auto mb-3 flex items-center justify-center w-11 h-11 rounded-full bg-slate-800/70 text-slate-500">
<i class="fa-solid fa-inbox text-xl"></i>
</div>
<p class="text-sm font-medium text-slate-300">No matching activity</p>
<p class="text-xs text-slate-500 mt-1">Try widening the date range or resetting filters.</p>
</div>
<div class="px-4 sm:px-5 py-3 border-t border-slate-800 bg-slate-950/30 flex items-center justify-between gap-3 text-sm">
<button id="prev-page" class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 border border-slate-700 text-slate-200 disabled:opacity-40 disabled:cursor-not-allowed">
<i class="fa-solid fa-arrow-left"></i><span class="hidden sm:inline">Previous</span>
</button>
<div id="page-info" class="text-slate-400">Page 1</div>
<button
id="next-page"
class="px-3 py-2 rounded-lg bg-slate-800/70 border border-slate-700 text-slate-200 disabled:opacity-40"
>
Next <i class="fa-solid fa-arrow-right"></i>
<div id="page-info" class="text-xs text-slate-400">Page 1</div>
<button id="next-page" class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 border border-slate-700 text-slate-200 disabled:opacity-40 disabled:cursor-not-allowed">
<span class="hidden sm:inline">Next</span><i class="fa-solid fa-arrow-right"></i>
</button>
</div>
</section>
</div>
</main>
<script type="module" src="/assets/nav.js"></script>
+66 -118
View File
@@ -9,22 +9,19 @@
<link rel="stylesheet" href="/vendor/inter/400.css" />
<link rel="stylesheet" href="/vendor/inter/600.css" />
<link rel="stylesheet" href="/vendor/inter/700.css" />
<link rel="stylesheet" href="/assets/tailwind.css" />
<link rel="stylesheet" href="/assets/tailwind.css" />
<link rel="stylesheet" href="/assets/main.css" />
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" />
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<link rel="stylesheet" href="/assets/custom.css" />
<script defer src="/vendor/msgpackr/msgpackr.js"></script>
<style>
body {
font-family: "Inter", sans-serif;
}
.process-row:hover {
background-color: rgba(51, 65, 85, 0.5);
background-color: rgba(30, 41, 59, 0.62);
}
.process-row.selected {
background-color: rgba(59, 130, 246, 0.3);
border-color: rgba(59, 130, 246, 0.6);
background-color: rgba(14, 165, 233, 0.12);
box-shadow: inset 3px 0 0 rgb(56 189 248);
}
.process-row.self-process {
background-color: rgba(234, 179, 8, 0.12);
@@ -36,15 +33,15 @@
}
/* Dark scrollbar styling */
#process-list::-webkit-scrollbar {
width: 12px;
width: 8px;
}
#process-list::-webkit-scrollbar-track {
background: #1e293b;
border-radius: 0 0 0.5rem 0;
border-radius: 999px;
}
#process-list::-webkit-scrollbar-thumb {
background: #475569;
border-radius: 6px;
border-radius: 999px;
border: 2px solid #1e293b;
}
#process-list::-webkit-scrollbar-thumb:hover {
@@ -99,146 +96,97 @@
display: none;
}
/* Mobile responsive styles */
@media (max-width: 768px) {
header {
padding: 0.75rem;
}
header .flex {
flex-wrap: nowrap;
gap: 0.5rem;
}
header span,
header a {
font-size: 0.875rem;
}
#client-id-header {
display: none;
}
main {
padding: 1rem 0.5rem;
}
.process-header {
display: none !important;
}
#process-list {
max-height: calc(100vh - 300px) !important;
max-height: none !important;
}
#process-list .process-row {
display: flex;
flex-direction: column;
gap: 0.5rem;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.75rem 1rem;
padding: 0.75rem !important;
font-size: 0.875rem;
}
#process-list .process-row > div {
width: 100% !important;
display: flex;
justify-content: space-between;
#process-list .process-name {
grid-column: 1 / -1;
order: -1;
min-width: 0;
}
#process-list .process-cell:not(.process-name)::before {
content: attr(data-label);
display: block;
margin-bottom: 0.125rem;
color: rgb(100 116 139);
font-size: 0.625rem;
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.process-row .tree-indent {
width: 10px;
}
.color-legend {
flex-wrap: wrap;
font-size: 0.65rem;
gap: 0.5rem !important;
}
}
</style>
</head>
<body class="min-h-screen bg-slate-950 text-slate-100">
<header id="top-nav"></header>
<main class="px-5 py-6">
<div class="max-w-7xl mx-auto flex flex-col gap-5">
<!-- Status Bar -->
<div class="flex items-center justify-between gap-3 flex-wrap">
<div class="flex items-center gap-2 flex-wrap">
<span
id="status-indicator"
class="inline-flex items-center gap-2 px-3 py-2 rounded-full bg-slate-800 text-slate-300"
>
<main class="max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="mb-6 flex flex-col sm:flex-row sm:items-end sm:justify-between gap-3">
<div>
<h1 class="text-2xl font-bold text-slate-100">Process Manager</h1>
<p id="client-id-header" class="text-slate-400 text-sm mt-1 font-mono">Loading client...</p>
</div>
<span id="status-indicator" class="inline-flex self-start sm:self-auto items-center gap-2 px-3 py-1.5 rounded-full bg-slate-800 text-slate-300 border border-slate-700 text-xs font-medium">
<i class="fa-solid fa-circle-notch fa-spin"></i> Connecting...
</span>
<span
id="client-id-header"
class="inline-flex items-center gap-2 px-3 py-2 rounded-full bg-slate-900/60 text-slate-200 border border-slate-800"
>
<i class="fa-solid fa-microchip"></i>
<span>Loading client...</span>
</span>
<span
id="process-count"
class="inline-flex items-center gap-2 px-3 py-2 rounded-full bg-slate-800 text-slate-400"
>
<i class="fa-solid fa-list"></i> 0 processes
</span>
</div>
<div class="flex items-center gap-2">
<button
id="refresh-btn"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-blue-600 hover:bg-blue-700 text-white"
disabled
>
<i class="fa-solid fa-refresh"></i> Refresh
<section class="bg-slate-900/60 border border-slate-800 rounded-xl overflow-hidden">
<div class="p-4 sm:p-5 border-b border-slate-800 space-y-4">
<div class="flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4">
<div class="flex items-center gap-3">
<div class="flex items-center justify-center w-9 h-9 rounded-lg bg-sky-500/10 border border-sky-500/30">
<i class="fa-solid fa-list-check text-sky-400"></i>
</div>
<div>
<h2 class="text-base font-semibold">Running processes</h2>
<p id="process-count" class="text-xs text-slate-400"><i class="fa-solid fa-list mr-1"></i>0 processes</p>
</div>
</div>
<div class="flex gap-2">
<button id="refresh-btn" class="flex-1 lg:flex-none inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 border border-slate-700 text-slate-200 text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed" disabled>
<i class="fa-solid fa-rotate"></i> Refresh
</button>
<button
id="kill-btn"
class="inline-flex items-center gap-2 px-3 py-2 rounded-lg bg-red-600 hover:bg-red-700 text-white"
disabled
>
<i class="fa-solid fa-skull-crossbones"></i> Kill Process
<button id="kill-btn" class="flex-1 lg:flex-none inline-flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-red-600/90 hover:bg-red-500 border border-red-500 text-white text-sm font-semibold disabled:opacity-40 disabled:cursor-not-allowed" disabled>
<i class="fa-solid fa-skull-crossbones"></i> Kill selected
</button>
</div>
</div>
<!-- Search Bar -->
<div
class="flex items-center gap-2 px-4 py-3 bg-slate-900/70 border border-slate-800 rounded-lg"
>
<i class="fa-solid fa-magnifying-glass text-slate-500"></i>
<input
id="search-input"
type="text"
placeholder="Search by process name or PID..."
class="bg-transparent outline-none w-full text-slate-100 placeholder:text-slate-500"
/>
<div class="flex flex-col xl:flex-row xl:items-center gap-3">
<div class="relative flex-1 min-w-0">
<i class="fa-solid fa-magnifying-glass absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"></i>
<input id="search-input" type="search" placeholder="Search by process name, PID, or user..."
class="w-full pl-10 pr-4 py-2.5 rounded-lg border border-slate-700 bg-slate-950/70 text-slate-100 placeholder-slate-500 text-sm focus:outline-none focus:ring-2 focus:ring-sky-500/60 focus:border-sky-500" />
</div>
<!-- Color Legend -->
<div
class="color-legend flex items-center gap-4 px-4 py-2 bg-slate-900/50 border border-slate-800 rounded-lg text-xs"
>
<span class="text-slate-500 font-semibold">Process Types:</span>
<div class="flex items-center gap-1.5">
<i class="fa-solid fa-circle text-purple-400"></i>
<span class="text-slate-400">System</span>
<div class="color-legend flex items-center gap-x-3 gap-y-2 flex-wrap text-xs text-slate-400">
<span class="text-slate-500 font-semibold">Types</span>
<span class="inline-flex items-center gap-1.5"><i class="fa-solid fa-circle text-[7px] text-purple-400"></i>System</span>
<span class="inline-flex items-center gap-1.5"><i class="fa-solid fa-circle text-[7px] text-cyan-400"></i>Service</span>
<span class="inline-flex items-center gap-1.5"><i class="fa-solid fa-circle text-[7px] text-green-300"></i>Own</span>
<span class="inline-flex items-center gap-1.5"><i class="fa-solid fa-circle text-[7px] text-slate-200"></i>Other</span>
<span class="inline-flex items-center gap-1.5"><i class="fa-solid fa-crosshairs text-yellow-400"></i>Agent</span>
</div>
<div class="flex items-center gap-1.5">
<i class="fa-solid fa-circle text-cyan-400"></i>
<span class="text-slate-400">Service</span>
</div>
<div class="flex items-center gap-1.5">
<i class="fa-solid fa-circle text-green-300"></i>
<span class="text-slate-400">Own</span>
</div>
<div class="flex items-center gap-1.5">
<i class="fa-solid fa-circle text-slate-200"></i>
<span class="text-slate-400">Other</span>
</div>
<div class="flex items-center gap-1.5">
<i class="fa-solid fa-crosshairs text-yellow-400"></i>
<span class="text-slate-400">Overlord Agent</span>
</div>
</div>
<!-- Process List -->
<div class="overflow-hidden">
<div
class="bg-slate-900/70 border border-slate-800 rounded-lg overflow-hidden"
>
<div
class="process-header grid grid-cols-12 gap-3 px-4 py-3 bg-slate-800 border-b border-slate-700 text-xs font-semibold uppercase text-slate-400"
class="process-header grid grid-cols-12 gap-3 px-4 py-3 bg-slate-950/60 border-b border-slate-800 text-[11px] font-semibold uppercase tracking-wider text-slate-500"
>
<div
class="col-span-1 cursor-pointer hover:text-slate-200"
@@ -268,12 +216,12 @@
</div>
<div
id="process-list"
class="divide-y divide-slate-800 max-h-[calc(100vh-400px)] overflow-y-auto"
class="divide-y divide-slate-800/80 min-h-80 max-h-[calc(100vh-22rem)] overflow-y-auto"
>
<!-- Processes will be inserted here -->
</div>
</div>
</div>
</section>
</main>
<script type="module" src="/assets/nav.js"></script>