reduce status styles, output deployed versions

This commit is contained in:
Matthias Kretschmann 2022-10-18 16:10:40 +01:00
parent 1afa254316
commit 8e82fff4aa
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 46 additions and 27 deletions

View File

@ -74,6 +74,7 @@ export interface Network {
export interface Summary { export interface Summary {
component: string component: string
status: State status: State
version?: string
} }
export interface NetworkSummary { export interface NetworkSummary {

View File

@ -70,8 +70,10 @@ export default function HomePage(): ReactElement {
key={value.component} key={value.component}
className={`${styles.card} ${statusStyle(value.status)}`} className={`${styles.card} ${statusStyle(value.status)}`}
> >
<h2>{value?.component}</h2> <h2>
<p>{value?.status}</p> {statusIcon(value.status)} {value.component}
</h2>
<code className={styles.version}>{value.version}</code>
</div> </div>
))} ))}
</div> </div>

View File

@ -40,19 +40,25 @@
text-align: left; text-align: left;
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
border-radius: 10px; border-radius: var(--border-radius);
transition: color 0.15s ease, border-color 0.15s ease; border: 2px solid var(--border-color);
} }
.card h2 { .card h2 {
margin: 0 0 1rem 0; margin: 0 0 1rem 0;
font-size: 1.5rem; font-size: var(--font-size-large);
} }
.card p { .warning {
margin: 0; border-color: var(--brand-alert-yellow);
font-size: 1.25rem; }
line-height: 1.5;
.down {
border-color: var(--brand-alert-red);
}
.version {
color: var(--color-secondary);
} }
.logo { .logo {
@ -61,15 +67,3 @@
width: 4rem; width: 4rem;
margin: 0 auto; margin: 0 auto;
} }
.up {
border: 2px solid #5fb359;
}
.warning {
border: 2px solid #eac146;
}
.down {
border: 2px solid #d80606;
}

View File

@ -28,19 +28,40 @@ export function getSummary(network: string, data: Status[][]): Summary[] {
if (element[0].network === network) return (status = element[0]) if (element[0].network === network) return (status = element[0])
}) })
// TODO: this is not fun. Needs a smart iteration over response instead of
// aall this hardcoding
const summary: Summary[] = [ const summary: Summary[] = [
{ component: 'Aquarius', status: status?.aquarius?.status }, {
{ component: 'Provider', status: status?.provider?.status }, component: 'Aquarius',
{ component: 'Subgraph', status: status?.subgraph?.status }, status: status?.aquarius?.status,
{ component: 'Market', status: status?.market }, version: status?.aquarius?.version
{ component: 'Port', status: status?.port }, },
{
component: 'Provider',
status: status?.provider?.status,
version: status?.provider?.version
},
{
component: 'Subgraph',
status: status?.subgraph?.status,
version: status?.subgraph?.version
},
{
component: 'Market',
status: status?.market
},
{
component: 'Port',
status: status?.port
},
{ {
component: 'Data Farming', component: 'Data Farming',
status: status?.dataFarming status: status?.dataFarming
}, },
{ {
component: 'Operator Service', component: 'Operator Service',
status: status?.operator?.status status: status?.operator?.status,
version: status?.operator?.version
}, },
{ {
component: 'DAO Grants', component: 'DAO Grants',
@ -63,6 +84,7 @@ export function getSummary(network: string, data: Status[][]): Summary[] {
export function getNetworkSUmmary(data: Status[][]): NetworkSummary[] { export function getNetworkSUmmary(data: Status[][]): NetworkSummary[] {
const networks: string[] = JSON.parse(availableNetworks) const networks: string[] = JSON.parse(availableNetworks)
const networkSummary: NetworkSummary[] = [] const networkSummary: NetworkSummary[] = []
networks.forEach((network) => { networks.forEach((network) => {
const summary = getSummary(network, data) const summary = getSummary(network, data)
let status = State.Up let status = State.Up