diff --git a/.changeset/wild-elephants-watch.md b/.changeset/wild-elephants-watch.md new file mode 100644 index 000000000..0ecb85ab5 --- /dev/null +++ b/.changeset/wild-elephants-watch.md @@ -0,0 +1,5 @@ +--- +'renterd': minor +--- + +The hosts table now has a last announcement column instead of the known since column. diff --git a/apps/renterd/contexts/hosts/columns.tsx b/apps/renterd/contexts/hosts/columns.tsx index 70cf3057d..3e47794fb 100644 --- a/apps/renterd/contexts/hosts/columns.tsx +++ b/apps/renterd/contexts/hosts/columns.tsx @@ -331,17 +331,17 @@ export const columns: HostsTableColumn[] = ( ), }, { - id: 'knownSince', - label: 'known since', + id: 'lastAnnouncement', + label: 'last announcement', category: 'general', render: ({ data }) => { return (
- {formatDistance(new Date(), new Date(data.knownSince))} old + {formatDistance(new Date(), new Date(data.lastAnnouncement))} ago - {formatRelative(new Date(data.knownSince), new Date())} + {formatRelative(new Date(data.lastAnnouncement), new Date())}
) diff --git a/apps/renterd/contexts/hosts/dataset.ts b/apps/renterd/contexts/hosts/dataset.ts index 87d8b6917..71cfbad1b 100644 --- a/apps/renterd/contexts/hosts/dataset.ts +++ b/apps/renterd/contexts/hosts/dataset.ts @@ -97,7 +97,12 @@ function getHostFields(host: Host, allContracts: ContractData[]) { host.interactions.LastScan === '0001-01-01T00:00:00Z' ? null : host.interactions.LastScan, - knownSince: host.knownSince, + knownSince: + host.knownSince === '0001-01-01T00:00:00Z' ? null : host.knownSince, + lastAnnouncement: + host.lastAnnouncement === '0001-01-01T00:00:00Z' + ? null + : host.lastAnnouncement, uptime: new BigNumber(host.interactions.Uptime || 0), downtime: new BigNumber(host.interactions.Downtime || 0), successfulInteractions: new BigNumber( diff --git a/apps/renterd/contexts/hosts/types.tsx b/apps/renterd/contexts/hosts/types.tsx index 67d425b84..99471ef78 100644 --- a/apps/renterd/contexts/hosts/types.tsx +++ b/apps/renterd/contexts/hosts/types.tsx @@ -11,6 +11,7 @@ export type HostData = { publicKey: string lastScanSuccess: boolean lastScan: string + lastAnnouncement: string knownSince: string uptime: BigNumber downtime: BigNumber @@ -63,7 +64,7 @@ const generalColumns = [ 'publicKey', 'lastScan', 'totalScans', - 'knownSince', + 'lastAnnouncement', 'uptime', 'downtime', 'successfulInteractions', @@ -165,7 +166,7 @@ export const columnsDefaultVisible: TableColumnId[] = [ 'netAddress', 'publicKey', 'lastScan', - 'knownSince', + 'lastAnnouncement', 'totalScans', 'uptime', 'hasContract', diff --git a/libs/react-renterd/src/siaTypes.ts b/libs/react-renterd/src/siaTypes.ts index bf6aa69cc..e4e38ff42 100644 --- a/libs/react-renterd/src/siaTypes.ts +++ b/libs/react-renterd/src/siaTypes.ts @@ -248,6 +248,7 @@ export interface Host { publicKey: string netAddress: string knownSince: string + lastAnnouncement: string Announcements?: Announcement[] interactions: { Downtime: number