1
0
forked from wrenn/wrenn
Co-authored-by: Tasnim Kabir Sadik <tksadik@omukk.dev>

Reviewed-on: wrenn/wrenn#55
Co-authored-by: pptx704 <rafeed@omukk.dev>
Co-committed-by: pptx704 <rafeed@omukk.dev>
This commit is contained in:
2026-06-20 22:45:08 +00:00
committed by Rafeed M. Bhuiyan
parent cfc0c52010
commit a08e755e53
53 changed files with 1675 additions and 577 deletions

View File

@ -53,14 +53,15 @@
let byocPageCount = $derived(Math.max(1, Math.ceil(flatByocHosts.length / PAGE_SIZE)));
let byocPageHosts = $derived(flatByocHosts.slice(byocPage * PAGE_SIZE, (byocPage + 1) * PAGE_SIZE));
// Stats across all hosts
let onlineCount = $derived(allHosts.filter((h) => h.status === 'online').length);
let pendingCount = $derived(allHosts.filter((h) => h.status === 'pending').length);
let totalCount = $derived(allHosts.length);
let totalCpuCores = $derived(allHosts.reduce((sum, h) => sum + (h.cpu_cores ?? 0), 0));
let totalMemoryMb = $derived(allHosts.reduce((sum, h) => sum + (h.memory_mb ?? 0), 0));
let totalRunningVcpus = $derived(allHosts.reduce((sum, h) => sum + h.running_vcpus, 0));
let totalRunningMemoryMb = $derived(allHosts.reduce((sum, h) => sum + h.running_memory_mb, 0));
// Aggregated stats — platform hosts only (admin needs a heads-up on
// platform capacity; BYOC capacity belongs to individual teams).
let onlineCount = $derived(platformHosts.filter((h) => h.status === 'online').length);
let pendingCount = $derived(platformHosts.filter((h) => h.status === 'pending').length);
let totalCount = $derived(platformHosts.length);
let totalCpuCores = $derived(platformHosts.reduce((sum, h) => sum + (h.cpu_cores ?? 0), 0));
let totalMemoryMb = $derived(platformHosts.reduce((sum, h) => sum + (h.memory_mb ?? 0), 0));
let totalRunningVcpus = $derived(platformHosts.reduce((sum, h) => sum + h.running_vcpus, 0));
let totalRunningMemoryMb = $derived(platformHosts.reduce((sum, h) => sum + h.running_memory_mb, 0));
function formatMem(mb: number): string {
return mb >= 1024 ? `${(mb / 1024).toFixed(0)} GB` : `${mb} MB`;

View File

@ -6,10 +6,6 @@
let { children } = $props();
</script>
<svelte:head>
<title>Wrenn — Capsules</title>
</svelte:head>
<main class="flex flex-1 flex-col overflow-y-auto bg-[var(--color-bg-0)]">
<!-- Header area -->
{#if $page.params.id}

View File

@ -256,6 +256,10 @@
});
</script>
<svelte:head>
<title>Wrenn — Capsules</title>
</svelte:head>
<style>
@keyframes capsule-born {
0%, 25% { background-color: rgba(94, 140, 88, 0.1); }