Status card
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Service, Node } from "../../types";
|
import { Service, Node, StatusPerTenant } from "../../types";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import Card from "@mui/material/Card";
|
import Card from "@mui/material/Card";
|
||||||
import CardContent from "@mui/material/CardContent";
|
import CardContent from "@mui/material/CardContent";
|
||||||
@ -9,6 +9,7 @@ import LaunchIcon from "@mui/icons-material/Launch";
|
|||||||
import Tooltip from "@mui/material/Tooltip";
|
import Tooltip from "@mui/material/Tooltip";
|
||||||
import Chip from "@mui/material/Chip";
|
import Chip from "@mui/material/Chip";
|
||||||
import Grid from "@mui/material/Unstable_Grid2";
|
import Grid from "@mui/material/Unstable_Grid2";
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
|
|
||||||
interface ServiceCardProps {
|
interface ServiceCardProps {
|
||||||
service: Service;
|
service: Service;
|
||||||
@ -22,6 +23,8 @@ function normalizeServiceName(name: string): string {
|
|||||||
.replace(/\b\w/g, (s) => s.toUpperCase());
|
.replace(/\b\w/g, (s) => s.toUpperCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TenantsStatusTooltip(tenantsStatus: StatusPerTenant) {}
|
||||||
|
|
||||||
interface ServiceNodePropps {
|
interface ServiceNodePropps {
|
||||||
node: Node;
|
node: Node;
|
||||||
}
|
}
|
||||||
@ -48,7 +51,19 @@ function ServiceNode({ node }: ServiceNodePropps) {
|
|||||||
|
|
||||||
switch (okValues.length) {
|
switch (okValues.length) {
|
||||||
case 0:
|
case 0:
|
||||||
tenantsStatus = <Chip label="tenants" color="error" className="node-name" />;
|
tenantsStatus = (
|
||||||
|
<Tooltip
|
||||||
|
title={
|
||||||
|
<Box className="tenants-status-tooltip">
|
||||||
|
<Typography color="inherit">Tooltip with HTML</Typography>
|
||||||
|
<em>{"And here's"}</em> <b>{"some"}</b> <u>{"amazing content"}</u>.{" "}
|
||||||
|
{"It's very engaging. Right?"}
|
||||||
|
</Box>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Chip label="tenants" color="error" className="node-name" />
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case tenantsHealth.length:
|
case tenantsHealth.length:
|
||||||
tenantsStatus = <Chip label="tenants" color="success" className="node-name" />;
|
tenantsStatus = <Chip label="tenants" color="success" className="node-name" />;
|
||||||
|
|||||||
@ -2,3 +2,8 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
background-color: whitesmoke;
|
background-color: whitesmoke;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.MuiTooltip-tooltip {
|
||||||
|
font-size: 1rem !important;
|
||||||
|
max-width: 500px !important;
|
||||||
|
}
|
||||||
|
|||||||
@ -44,3 +44,6 @@ $color-danger: #d32f2f;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.MuiTooltip-tooltip .tenants-status-tooltip {
|
||||||
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ export type EnvTab = {
|
|||||||
dashboardEndpoint: string;
|
dashboardEndpoint: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type StatusPerTenant = { [tenantId: string]: boolean };
|
export type StatusPerTenant = { [tenantId: string]: boolean };
|
||||||
|
|
||||||
type HealthCheckStatus = {
|
type HealthCheckStatus = {
|
||||||
status_ok: boolean;
|
status_ok: boolean;
|
||||||
|
|||||||
Reference in New Issue
Block a user