+
+
+ pending
+
+
+ Contract has been added.
+
+
+
+
+
+ active
+
+
+ Contract has appeared on chain.
+
+
+
+
+
+ complete
+
+
+ Storage proof has appeared on chain.
+
+
+
+
+
+ failed
+
+
+ Storage proof was not submitted before the end of proof
+ window.
+
+
+
+ }
+ >
+ {state}
+
+ )
+ },
+ },
{
id: 'timeline',
label: 'timeline',
@@ -207,3 +263,18 @@ export const columns: ContractsTableColumn[] = [
),
},
]
+
+function getContractStateColor(state: ContractState) {
+ if (state === 'active') {
+ return 'amber'
+ }
+ if (state === 'failed') {
+ return 'red'
+ }
+ if (state === 'pending') {
+ return 'amber'
+ }
+ if (state === 'complete') {
+ return 'green'
+ }
+}
diff --git a/apps/renterd/contexts/contracts/index.tsx b/apps/renterd/contexts/contracts/index.tsx
index 428a39198..1eab64ee9 100644
--- a/apps/renterd/contexts/contracts/index.tsx
+++ b/apps/renterd/contexts/contracts/index.tsx
@@ -57,6 +57,7 @@ function useContractsMain() {
return {
id: c.id,
contractId: c.id,
+ state: c.state,
hostIp: c.hostIP,
hostKey: c.hostKey,
location: geoHosts.find((h) => h.public_key === c.hostKey)?.location,
diff --git a/apps/renterd/contexts/contracts/types.ts b/apps/renterd/contexts/contracts/types.ts
index 653fd80fb..9d604cdc0 100644
--- a/apps/renterd/contexts/contracts/types.ts
+++ b/apps/renterd/contexts/contracts/types.ts
@@ -1,9 +1,11 @@
+import { ContractState } from '@siafoundation/react-renterd'
import BigNumber from 'bignumber.js'
export type ContractData = {
id: string
hostIp: string
hostKey: string
+ state: ContractState
location?: [number, number]
isRenewed: boolean
renewedFrom: string
@@ -28,6 +30,7 @@ export type TableColumnId =
| 'contractId'
| 'hostIp'
| 'hostKey'
+ | 'state'
| 'timeline'
| 'startTime'
| 'endTime'
@@ -41,6 +44,7 @@ export const columnsDefaultVisible: TableColumnId[] = [
'contractId',
'hostIp',
'hostKey',
+ 'state',
'timeline',
'size',
'totalCost',
@@ -53,6 +57,7 @@ export type SortField =
| 'contractId'
| 'hostIp'
| 'hostKey'
+ | 'state'
| 'timeline'
| 'startTime'
| 'endTime'
@@ -84,6 +89,11 @@ export const sortOptions: {
label: 'host public key',
category: 'general',
},
+ {
+ id: 'state',
+ label: 'state',
+ category: 'general',
+ },
{
id: 'timeline',
label: 'timeline',
diff --git a/apps/renterd/contexts/dialog.tsx b/apps/renterd/contexts/dialog.tsx
index c2c482e5e..e954fe524 100644
--- a/apps/renterd/contexts/dialog.tsx
+++ b/apps/renterd/contexts/dialog.tsx
@@ -137,6 +137,7 @@ export function Dialogs() {