diff --git a/.changeset/cyan-dots-cover.md b/.changeset/cyan-dots-cover.md new file mode 100644 index 000000000..84fe4a0b4 --- /dev/null +++ b/.changeset/cyan-dots-cover.md @@ -0,0 +1,5 @@ +--- +'@siafoundation/react-renterd': minor +--- + +useObject now includes partialSlab. diff --git a/.changeset/wise-phones-bathe.md b/.changeset/wise-phones-bathe.md new file mode 100644 index 000000000..d396231bc --- /dev/null +++ b/.changeset/wise-phones-bathe.md @@ -0,0 +1,5 @@ +--- +'renterd': minor +--- + +File health tooltip now includes redundancy info and supports partial slabs. diff --git a/apps/renterd/components/Files/Columns/FilesHealthColumn/FilesHealthColumnContents.tsx b/apps/renterd/components/Files/Columns/FilesHealthColumn/FilesHealthColumnContents.tsx index d9610ef6e..48bc84a46 100644 --- a/apps/renterd/components/Files/Columns/FilesHealthColumn/FilesHealthColumnContents.tsx +++ b/apps/renterd/components/Files/Columns/FilesHealthColumn/FilesHealthColumnContents.tsx @@ -66,27 +66,44 @@ export function FilesHealthColumnContents({ 'contractSetShards' ) + const { partialSlab } = obj.data.object + return ( 15 ? 'h-[300px]' : ''} displayHealth={displayHealth} label={label} + minShards={partialSlab ? partialSlab.minShards : slabs[0]?.minShards} + totalShards={ + partialSlab ? partialSlab.totalShards : slabs[0]?.shards.length + } > - {slabs.map((slab) => ( -
- - Slab {slab.key.replace('key:', '').slice(0, 4)}: - - - {slab.contractSetShards}/{slab.shards.length} - -
- ))} + {partialSlab ? ( + + partial slab + + ) : ( + slabs.map((slab) => ( +
+ + Slab {slab.key.replace('key:', '').slice(0, 4)}: + + + {slab.contractSetShards}/{slab.shards.length} + +
+ )) + )}
) } @@ -96,11 +113,15 @@ function Layout({ displayHealth, label, children, + minShards, + totalShards, }: { className?: string children: React.ReactNode displayHealth: number label: string + minShards?: number + totalShards?: number }) { return (
{label} {(displayHealth * 100).toFixed(0)}%
+ {minShards && totalShards ? ( +
+ + redundancy + + + {minShards} of {totalShards} + +
+ ) : null}
diff --git a/libs/react-renterd/src/siaTypes.ts b/libs/react-renterd/src/siaTypes.ts index 12118b972..bf6aa69cc 100644 --- a/libs/react-renterd/src/siaTypes.ts +++ b/libs/react-renterd/src/siaTypes.ts @@ -147,6 +147,11 @@ export interface Obj { health: number key: EncryptionKey slabs?: SlabSlice[] + partialSlab?: { + minShards: number + totalShards: number + data?: string + } } export interface AddObjectRequest {