diff --git a/.changeset/happy-ads-matter.md b/.changeset/happy-ads-matter.md new file mode 100644 index 000000000..65f978251 --- /dev/null +++ b/.changeset/happy-ads-matter.md @@ -0,0 +1,5 @@ +--- +'renterd': minor +--- + +The host context menu now has an option to reset the lost sector count. diff --git a/.changeset/red-vans-relate.md b/.changeset/red-vans-relate.md new file mode 100644 index 000000000..b70a62a86 --- /dev/null +++ b/.changeset/red-vans-relate.md @@ -0,0 +1,5 @@ +--- +'@siafoundation/react-renterd': minor +--- + +Add useHostResetLostSectorCount. diff --git a/apps/renterd/components/Hosts/HostContextMenu.tsx b/apps/renterd/components/Hosts/HostContextMenu.tsx index 4495141e5..df5357ffe 100644 --- a/apps/renterd/components/Hosts/HostContextMenu.tsx +++ b/apps/renterd/components/Hosts/HostContextMenu.tsx @@ -15,8 +15,10 @@ import { ListChecked16, Filter16, Copy16, + ResetAlt16, } from '@siafoundation/react-icons' import { + useHostResetLostSectorCount, useHostsAllowlist, useHostsBlocklist, useRhpScan, @@ -54,6 +56,7 @@ export function HostContextMenu({ const blocklistUpdate = useBlocklistUpdate() const allowlistUpdate = useAllowlistUpdate() const rescan = useRhpScan() + const resetLostSectors = useHostResetLostSectorCount() return ( )} + + resetLostSectors.post({ + params: { + publicKey, + }, + }) + } + > + + + + Reset lost sector count + Copy copyToClipboard(publicKey, 'host public key')} diff --git a/libs/react-renterd/src/bus.ts b/libs/react-renterd/src/bus.ts index df98b9432..500bdb382 100644 --- a/libs/react-renterd/src/bus.ts +++ b/libs/react-renterd/src/bus.ts @@ -406,6 +406,15 @@ export function useHostsBlocklistUpdate( ) } +export function useHostResetLostSectorCount( + args?: HookArgsCallback<{ publicKey: string }, void, void> +) { + return usePostFunc({ + ...args, + route: '/bus/host/:publicKey/resetlostsectors', + }) +} + // contracts const contractsActiveRoute = '/bus/contracts'