d.root_folder_id === id) ?? null;
}
+
+ /** Drive whose own UUID matches `id`, or null. */
+ findById(id: string | null | undefined): Drive | null {
+ if (!id) return null;
+ return this.drives.find((d) => d.id === id) ?? null;
+ }
}
export const drives = new DrivesStore();
diff --git a/frontend/src/routes/config/drive/[uuid]/+page.svelte b/frontend/src/routes/config/drive/[uuid]/+page.svelte
new file mode 100644
index 00000000..9bdc00fe
--- /dev/null
+++ b/frontend/src/routes/config/drive/[uuid]/+page.svelte
@@ -0,0 +1,247 @@
+
+
+
+ {#if !drivesStore.loaded}
+
{t('common.loading', 'Loading…')}
+ {:else if !drive}
+
+ {:else}
+
+
+ {drive.name}
+
+
+
+
{t('drive.info', 'Drive info')}
+
+ - {t('drive.field.kind', 'Kind')}
+ - {kindLabel}
+
+ {#if drive.default_for_user}
+ - {t('drive.field.default', 'Default')}
+ - {t('drive.field.default_yes', 'This is your home drive')}
+ {/if}
+
+ - {t('drive.field.created', 'Created')}
+ - {formatDate(drive.created_at)}
+
+ - {t('drive.field.updated', 'Last updated')}
+ - {formatDate(drive.updated_at)}
+
+ - {t('drive.field.id', 'Identifier')}
+ - {drive.id}
+
+
+
+
+
{t('drive.storage', 'Storage')}
+
+
+
{formatBytes(drive.used_bytes)}
+
{t('drive.used', 'Used')}
+
+
+
+ {drive.quota_bytes && drive.quota_bytes > 0 ? formatBytes(drive.quota_bytes) : '∞'}
+
+
{t('drive.quota', 'Quota')}
+
+
+
+ {drive.quota_bytes && drive.quota_bytes > 0 ? `${Math.round(storagePct)}%` : '—'}
+
+
{t('drive.usage', 'Usage')}
+
+
+ {#if drive.quota_bytes && drive.quota_bytes > 0}
+
+ {/if}
+
+
+ {#if policyEntries.length > 0}
+
+
{t('drive.policies', 'Policies')}
+
+ {#each policyEntries as p (p.key)}
+ - {policyLabel(p.key)}
+ - {policyValueDisplay(p.value)}
+ {/each}
+
+
+ {/if}
+ {/if}
+
+
+