mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-10 17:53:36 +02:00
simplify graph
This commit is contained in:
parent
3c05559053
commit
d3ac37433c
@ -32,12 +32,7 @@ interface IEdgeStatus {
|
|||||||
status: statusCode;
|
status: statusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IUnleashStatus {
|
|
||||||
status: statusCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface INetworkStatus {
|
interface INetworkStatus {
|
||||||
unleash: IUnleashStatus;
|
|
||||||
clients: IClientStatus[];
|
clients: IClientStatus[];
|
||||||
edges: IEdgeStatus[];
|
edges: IEdgeStatus[];
|
||||||
}
|
}
|
||||||
@ -51,7 +46,7 @@ const buildGraph = (status: INetworkStatus): string => {
|
|||||||
|
|
||||||
status.clients.forEach(client => {
|
status.clients.forEach(client => {
|
||||||
graph.push(
|
graph.push(
|
||||||
`client${client.id}(("${client.appName}")):::${client.status}`
|
`client${client.id}(("${client.appName}"<br />${client.status})):::${client.status}`
|
||||||
);
|
);
|
||||||
graph.push(`--${client.sdk}-->edge${client.edgeConnection}`);
|
graph.push(`--${client.sdk}-->edge${client.edgeConnection}`);
|
||||||
});
|
});
|
||||||
@ -62,7 +57,7 @@ const buildGraph = (status: INetworkStatus): string => {
|
|||||||
edge.status
|
edge.status
|
||||||
}<br />${getDateString(edge.lastFetch)}):::${edge.status}`
|
}<br />${getDateString(edge.lastFetch)}):::${edge.status}`
|
||||||
);
|
);
|
||||||
graph.push(`-->unleash{{Unleash<br />${status.unleash.status}}}`);
|
graph.push(`-->unleash{{Unleash}}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
graph.push('classDef OK fill:#00bfa5,stroke:#00bfa5,stroke-width:1px');
|
graph.push('classDef OK fill:#00bfa5,stroke:#00bfa5,stroke-width:1px');
|
||||||
@ -77,9 +72,6 @@ export const NetworkDashboard: FC<INetworkDashboardProps> = ({
|
|||||||
}) => {
|
}) => {
|
||||||
// TODO: Grab this from something like instanceStatus?
|
// TODO: Grab this from something like instanceStatus?
|
||||||
const mockNetworkStatus: INetworkStatus = {
|
const mockNetworkStatus: INetworkStatus = {
|
||||||
unleash: {
|
|
||||||
status: 'OK',
|
|
||||||
},
|
|
||||||
clients: [
|
clients: [
|
||||||
{
|
{
|
||||||
id: 'app-1',
|
id: 'app-1',
|
||||||
|
Loading…
Reference in New Issue
Block a user