Skip to content

Commit

Permalink
feat(dashboard): CLI instructions for healing a subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
sasa-tomic committed Sep 18, 2023
1 parent ad33c2c commit 6e1574a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions dashboard/packages/app/src/components/subnets/SubnetsBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,19 @@ function ActionDialog({ subnet, action }: { subnet: Subnet, action: Action }) {
<DialogTitle id="max-width-dialog-title">{action.type[0].toUpperCase() + action.type.substring(1)} {subnet.metadata.name} Subnet ({subnet.principal.split("-")[0]})</DialogTitle>
<DialogContent>
<DialogContentText>
{action.description}
$ {action.description}
</DialogContentText>
</DialogContent>
<DialogActions>
<IconButton
color="default"
aria-label="copy"
component="span"
size="small"
onClick={() => { navigator.clipboard.writeText(action.description) }}
>
<FileCopyOutlinedIcon fontSize="inherit" />
</IconButton>
<Button onClick={handleClose} color="secondary">
Close
</Button>
Expand Down Expand Up @@ -141,7 +150,7 @@ function generateSubnetActions(subnet: Subnet, healths: { [principal: string]: N
actions.push({
type: "heal",
urgency: deadNodes.length / subnet.nodes.length > 0.1 ? "critical" : "warning",
description: `Guests ${deadNodes.map(dn => dn.hostname)}`,
description: `release_cli subnet --id ${subnet.principal} replace # dead nodes: ${deadNodes.map(dn => dn.principal.split('-')[0]+"/"+dn.hostname)}`,
message: <>There {deadNodes.length === 1 ? "is" : "are"} <b>{deadNodes.length}</b> dead node{deadNodes.length > 1 && "s"} that need{deadNodes.length === 1 && "s"} to be replaced.</>,
})
}
Expand All @@ -150,7 +159,7 @@ function generateSubnetActions(subnet: Subnet, healths: { [principal: string]: N
actions.push({
type: "heal",
urgency: degraded.length / subnet.nodes.length > 0.2 ? "critical" : "warning",
description: `Guests ${degraded.map(dn => dn.hostname)}`,
description: `release_cli subnet --id ${subnet.principal} replace # degraded nodes: ${degraded.map(dn => dn.principal.split('-')[0]+"/"+dn.hostname)}`,
message: <>There {degraded.length === 1 ? "is" : "are"} <b>{degraded.length}</b> degraded node{degraded.length > 1 && "s"} that might need to be replaced.</>,
})
}
Expand Down

0 comments on commit 6e1574a

Please sign in to comment.