Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
balazskreith committed Nov 14, 2024
1 parent 20aa808 commit 92362e2
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions webapp/src/components/Charts/IceConnectionsGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,44 @@ export function IceConnectionsGraph(props: IceConnectionsGraphProps) {
// eslint-disable-next-line solid/reactivity
const mediaServerNodes = [...new Set<string>(props.connections.map(c => c.mediaServerIp))].map((ip, i) => ({
name: ip,
x: 400,
x: 600,
y: 150 + i * 100
}));
const clientNodes = props.connections.map((c, i) => ({
name: c.userId ?? c.clientId,
x: 200,
y: 100 + i * 100
}));
const links = props.connections.map((c) => ({
source: c.userId ?? c.clientId,
target: c.mediaServerIp,
symbolSize: [5, 20],
// label: {
// show: true
// },
lineStyle: {
width: 5,
curveness: 0.2
}
}));
const turnNodes = [{
name: 'STUNner',
x: 400,
y: 250,
}];
const links = [
...props.connections.map((c) => ({
source: c.userId ?? c.clientId,
target: c.mediaServerIp,
symbolSize: [5, 20],
// label: {
// show: true
// },
lineStyle: {
width: 5,
curveness: 0.2,
type: 'dashed',
}
})),
...props.connections.map((c) => ({
source: c.userId ?? c.clientId,
target: 'STUNner',
symbolSize: [5, 20],
})),
...props.connections.map((c) => ({
source: 'STUNner',
target: c.mediaServerIp,
symbolSize: [5, 20],
})),
];
// console.warn('mediaServerNodes', mediaServerNodes, clientNodes);
return (
<div class='h-64'>
Expand Down Expand Up @@ -56,15 +74,18 @@ export function IceConnectionsGraph(props: IceConnectionsGraphProps) {
data: [
...mediaServerNodes,
...clientNodes,
...turnNodes,
],
links,
// links: [
// {
// source: 'Node 0',
// target: 'Node 1',

// lineStyle: {
// type: 'dashed',
// }
// }
// ]
// ],
// links: [
// {
// source: 0,
Expand Down

0 comments on commit 92362e2

Please sign in to comment.