diff --git a/src/@types/index.ts b/src/@types/index.ts index 1b17bd7..72e1c52 100644 --- a/src/@types/index.ts +++ b/src/@types/index.ts @@ -11,19 +11,21 @@ export enum State { export interface Status { network: string currentBlock: number - market: State - faucet: FaucetStatus | Record - aquarius: AquariusStatus - provider: ProviderStatus - subgraph: SubgraphStatus - operator: OperatorStatus - dataFarming: State lastUpdatedOn: number + components: { + market: ComponentStatusBase + faucet: FaucetStatus | Record + aquarius: AquariusStatus + provider: ProviderStatus + subgraph: SubgraphStatus + operator: OperatorStatus + dataFarming: ComponentStatusBase + } } export interface ComponentStatusBase { status: State - statusMessages: string + statusMessages: string[] response: number version: string } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 8d38775..5842a57 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -66,86 +66,61 @@ export default function HomePage(): ReactElement { {isLoading ? (
Loading...
) : ( - Object.entries(data || {}).map(([key, value]) => { - const networkKey = key + Object.entries(data || {}).map(([networkName, value]) => ( + +

{networkName}

+
+ {Object.entries(value.components).map( + ([componentName, value]) => ( +
+

+ {statusIcon(value.status)} {componentName} + + {value.version} + +

- return ( - -

{networkKey}

-
- {Object.entries(value) - .filter( - // TODO: Remove this filter if we fix this on API level - // Needs a new `components` key under Status response - ([key]) => - key !== 'currentBlock' && - key !== 'lastUpdatedOn' && - key !== 'network' && - key !== '_id' && - key !== '__v' - ) - .map(([key, value]) => ( -
-

- {statusIcon( - key === 'market' || key === 'dataFarming' - ? value - : value.status - )}{' '} - {key} - - {value.version} - -

+ {value.statusMessages?.length ? ( +
    + {value.statusMessages.map( + (message: string, i: number) => ( +
  • + {message} +
  • + ) + )} +
+ ) : null} +
+ ) + )} +
- {value.statusMessages && value.statusMessages !== '' && ( -
    - {value.statusMessages - .split(',') - .map((message: string, i: number) => ( -
  • - {message} -
  • - ))} -
- )} -
- ))} -
- -
- -

- Deployed Contracts -

-
-
    - {Object.entries((addresses as any)[networkKey]).map( - ([key, value]) => - key !== 'chainId' && - key !== 'startBlock' && ( -
  • - {key}:{' '} - {JSON.stringify(value)} -
  • - ) - )} -
-
-
- ) - }) +
+ +

Deployed Contracts

+
+
    + {Object.entries((addresses as any)[networkName]).map( + ([key, value]) => + key !== 'chainId' && + key !== 'startBlock' && ( +
  • + {key}:{' '} + {JSON.stringify(value)} +
  • + ) + )} +
+
+ + )) )} diff --git a/src/styles/Home.module.css b/src/styles/Home.module.css index 02f9bc4..f535d06 100644 --- a/src/styles/Home.module.css +++ b/src/styles/Home.module.css @@ -92,12 +92,17 @@ list-style-type: square; margin-left: 1rem; margin-top: calc(var(--spacer) / 4); + color: var(--color-secondary); + font-size: var(--font-size-small); } .messages li { display: list-item; margin-top: calc(var(--spacer) / 8); list-style-position: outside; +} + +.warning .messages { color: var(--brand-alert-orange); }