@@ -171,8 +171,7 @@ export function TopologyChart({
171
171
id : edgeId ,
172
172
to : targetCDP ,
173
173
label : "" ,
174
- title : portCDP ,
175
- color : "#BBBBBB" ,
174
+ title : htmlTitle ( escapeHtml ( String ( portCDP ?? "" ) ) ) ,
176
175
} as Edge ) ;
177
176
} else if ( targetLLDP ) {
178
177
const edgeId = `e_${ sysName } __${ targetLLDP } __${
@@ -186,8 +185,7 @@ export function TopologyChart({
186
185
from : sysName ,
187
186
to : targetLLDP ,
188
187
label : "" ,
189
- title : portLLDP ,
190
- color : "#BBBBBB" ,
188
+ title : htmlTitle ( escapeHtml ( String ( portLLDP ?? "" ) ) ) ,
191
189
} as Edge ) ;
192
190
}
193
191
}
@@ -231,7 +229,11 @@ export function TopologyChart({
231
229
</div>
232
230
</div>
233
231
<div style="margin-top: 0.5rem; font-size: 1.2em; font-weight: bold; color: white;">
234
- ${ formatUptime ( device . sysUptime ) ?? "N/A" }
232
+ ${
233
+ typeof device . sysUptime === "number"
234
+ ? formatUptime ( device . sysUptime )
235
+ : "N/A"
236
+ }
235
237
<span style="font-size: 0.4em; font-weight: normal;">Uptime</span>
236
238
</div>
237
239
` . trim ( )
@@ -347,8 +349,8 @@ export function TopologyChart({
347
349
// Reset edges color
348
350
initialGraph . current . edges . forEach ( ( originalEdge ) => {
349
351
edgesData . current ! . update ( {
350
- id : originalEdge . id ,
351
- color : originalEdge . color || ( isDark ? "#444" : "#BBBBBB" ) ,
352
+ id : originalEdge . id ! ,
353
+ color : isDark ? "#444" : "#BBBBBB" ,
352
354
} ) ;
353
355
} ) ;
354
356
} ) ;
@@ -389,8 +391,8 @@ export function TopologyChart({
389
391
390
392
initialGraph . current . edges . forEach ( ( originalEdge ) => {
391
393
edgesData . current ! . update ( {
392
- id : originalEdge . id ,
393
- color : originalEdge . color || ( isDark ? "#444" : "#BBBBBB" ) ,
394
+ id : originalEdge . id ! ,
395
+ color : isDark ? "#444" : "#BBBBBB" ,
394
396
arrows : { to : false } ,
395
397
} ) ;
396
398
} ) ;
@@ -546,9 +548,9 @@ export function TopologyChart({
546
548
547
549
{ suggestions . length > 0 && (
548
550
< ul className = "absolute bg-bg shadow-md mt-1 rounded border w-full z-50 topology-suggestions-list" >
549
- { suggestions . map ( ( suggestion , index ) => (
551
+ { suggestions . map ( ( suggestion ) => (
550
552
< li
551
- key = { index }
553
+ key = { suggestion }
552
554
onClick = { ( ) => {
553
555
setSearchTerm ( suggestion ) ;
554
556
setInputTerm ( "" ) ;
0 commit comments