1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-24 20:06:55 +01:00

chore: show hosting in connected edges (#10995)

https://linear.app/unleash/issue/2-4037/show-hosting-in-connected-edges-edge-observability

Show "hosting" in Connected Edges.

This can be one of:
 - Cloud
 - Self-hosted
 - Unknown

<img width="326" height="691" alt="image"
src="https://github.com/user-attachments/assets/baba1fbb-6f22-46f5-8271-4f4a0c3fcc8a"
/>
This commit is contained in:
Nuno Góis 2025-11-19 10:41:46 +00:00 committed by GitHub
parent 35680f87eb
commit 416bd27859
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 0 deletions

View File

@ -82,6 +82,19 @@ const StyledBadge = styled(Badge)(({ theme }) => ({
padding: theme.spacing(0, 1),
}));
const getHosting = ({
hosting,
}: ConnectedEdge): 'Cloud' | 'Self-hosted' | 'Unknown' => {
switch (hosting) {
case 'hosted':
return 'Cloud';
case 'enterprise-self-hosted':
return 'Self-hosted';
default:
return hosting ? `Unknown: ${hosting}` : 'Unknown';
}
};
const getConnectionStatus = ({
reportedAt,
}: ConnectedEdge): InstanceConnectionStatus => {
@ -178,6 +191,10 @@ export const NetworkConnectedEdgeInstance = ({
<strong>Region</strong>
<span>{instance.region || 'Unknown'}</span>
</StyledDetailRow>
<StyledDetailRow>
<strong>Hosting</strong>
<span>{getHosting(instance)}</span>
</StyledDetailRow>
<StyledDetailRow>
<strong>Version</strong>
<span>{instance.edgeVersion}</span>

View File

@ -5,6 +5,7 @@ export type ConnectedEdge = {
edgeVersion: string;
instanceId: string;
region: string | null;
hosting?: 'hosted' | 'enterprise-self-hosted';
reportedAt: string;
started: string;
connectedVia?: string;

View File

@ -0,0 +1,19 @@
exports.up = function(db, cb) {
db.runSql(
`
ALTER TABLE stat_edge_observability
ADD COLUMN hosting TEXT;
`,
cb,
);
};
exports.down = function(db, cb) {
db.runSql(
`
ALTER TABLE stat_edge_observability
DROP COLUMN IF EXISTS hosting;
`,
cb,
);
};