From acd38c2235d0b19f0e88abde81851ade431550a9 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 4 Feb 2026 17:27:56 +0000 Subject: [PATCH] Punch a hole in the pie to make a donut. --- frontend/src/components/DiskSpace.vue | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/DiskSpace.vue b/frontend/src/components/DiskSpace.vue index c4835d2..429aa8a 100644 --- a/frontend/src/components/DiskSpace.vue +++ b/frontend/src/components/DiskSpace.vue @@ -26,11 +26,11 @@ - - - - - + + + + + GB @@ -100,10 +100,15 @@ const truncateLabel = (name: string, maxLen = 10): string => { const storageName = computed(() => truncateLabel(store.server.name || 'stored')) +const TAU = 2 * Math.PI + const pieCx = 75 const pieCy = 75 const pieRadius = 55 -const CIRC = Math.PI * pieRadius +const holeRadius = pieRadius * 0.38 +const ringWidth = pieRadius - holeRadius +const midRadius = (pieRadius + holeRadius) / 2 +const CIRC = TAU * midRadius const pieStorageDash = computed(() => { const s = store.space @@ -136,7 +141,7 @@ const PIE_RADIUS = 55 const LABEL_RADIUS = 62 const getPoint = (angle: number, radius: number) => { - const rad = (angle - 90) * Math.PI / 180 + const rad = TAU * (angle - 90) / 360 return { x: pieCx + radius * Math.cos(rad), y: pieCy + radius * Math.sin(rad) } }