From 72a7c7c7cc5dfd13db5961bfe8cc6e1d67dcea96 Mon Sep 17 00:00:00 2001 From: th Date: Fri, 17 Apr 2026 18:38:17 +0200 Subject: [PATCH] =?UTF-8?q?v2.0.1=20=E2=80=94=20collab-attachments=20size?= =?UTF-8?q?=20cap=20+=20oumta=20overview=20tiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - relay: raise /api/collab-attachments + /api/attachments/upload POST size limit from 256KB to 15MB, matching /api/attachments. Previous limit silently dropped any collab image >~100KB as 413 (envelope overhead pushes even modest JPEGs past the cap), leaving puller clients with broken references. - oumta-dashboard: centre overview tiles, bump value font to 56px, introduce .oumta-fail alarm state that paints the full tile red with white text. Toggled from JS for cluster state=down, workloads down >0, and open incidents >0. Fail colour uses --t-danger so it stays in sync with the "unavailable" workload labels. Co-Authored-By: Claude Opus 4.7 (1M context) --- config.php | 2 +- electron/package.json | 2 +- .../oumta-dashboard/oumta-dashboard.css | 27 ++++++++++++++++--- .../oumta-dashboard/oumta-dashboard.html | 2 +- .../oumta-dashboard/oumta-dashboard.js | 13 +++++++-- relay/index.php | 6 ++++- 6 files changed, 43 insertions(+), 9 deletions(-) diff --git a/config.php b/config.php index 5a8f05e..20f7176 100644 --- a/config.php +++ b/config.php @@ -1,7 +1,7 @@
Workloads down
-
—
+
—
Open incidents
diff --git a/public/plugins/oumta-dashboard/oumta-dashboard.js b/public/plugins/oumta-dashboard/oumta-dashboard.js index 0a6ae8e..478ff69 100644 --- a/public/plugins/oumta-dashboard/oumta-dashboard.js +++ b/public/plugins/oumta-dashboard/oumta-dashboard.js @@ -269,19 +269,28 @@ function renderOverview() { if (!o) return; // Values that come directly from the Go overview endpoint [REAL]. - $('oumta-cluster-card').dataset.state = o.clusterState || 'unknown'; - $('oumta-cluster-state').textContent = o.clusterState || 'unknown'; + const clusterCard = $('oumta-cluster-card'); + const clusterState = o.clusterState || 'unknown'; + clusterCard.dataset.state = clusterState; + clusterCard.classList.toggle('oumta-fail', clusterState === 'down'); + $('oumta-cluster-state').textContent = clusterState; $('oumta-cluster-updated').textContent = o.updatedAtUtc ? 'as of ' + formatTime(o.updatedAtUtc) : 'no data'; $('oumta-workloads-up').textContent = o.workloadsUp ?? '—'; $('oumta-workloads-down').textContent = o.workloadsDown ?? '—'; $('oumta-last-import').textContent = o.updatedAtUtc ? formatTime(o.updatedAtUtc) : '—'; + // Any workload down → the "workloads down" tile becomes an alarm tile. + const downCard = $('oumta-workloads-down').closest('.oumta-card'); + if (downCard) downCard.classList.toggle('oumta-fail', (o.workloadsDown ?? 0) > 0); + // Values derived client-side from the workloads list — the overview // endpoint doesn't carry these today. If the backend later adds // `incidents` / `attention` fields, prefer those over the derivation. const attention = wl.filter(w => w.state !== 'healthy') .sort((a, b) => rankState(a.state) - rankState(b.state)); $('oumta-incidents').textContent = attention.length || '—'; + const incCard = $('oumta-incidents').closest('.oumta-card'); + if (incCard) incCard.classList.toggle('oumta-fail', attention.length > 0); const list = $('oumta-attention-list'); if (!attention.length) { diff --git a/relay/index.php b/relay/index.php index dd92dd8..ecf2f8f 100644 --- a/relay/index.php +++ b/relay/index.php @@ -66,7 +66,11 @@ if (str_starts_with($route, '/api/')) { if ($method === 'OPTIONS') exit; $contentLength = (int)($_SERVER['CONTENT_LENGTH'] ?? 0); - $sizeLimit = ($route === '/api/attachments') ? 15728640 : 262144; + // Attachment routes handle binary blobs; everything else is JSON metadata. + // A ~150KB image becomes a ~275KB envelope after base64 + GCM framing, + // so 256KB would silently drop any non-trivial image on collab pushes. + $isAttachmentRoute = in_array($route, ['/api/attachments', '/api/attachments/upload', '/api/collab-attachments'], true); + $sizeLimit = $isAttachmentRoute ? 15728640 : 262144; if ($contentLength > $sizeLimit) jsonResponse(['error' => 'payload too large'], 413); // Each route file contains its handlers as if-blocks that exit on