+ {hops.map((hop, index) => {
+ const hasError = hop.latency < 0 || hop.loss > 0;
+ const colorClass = hop.latency < 0 ? "text-danger" : (hop.loss > 0 ? "text-warning" : "text-success");
+ const borderColor = hasError ? "border-danger" : "";
+
+ return (
+
+ {index === 0 && (
+
+ {hop.fromNodeName}
+
+ )}
+
+
+ {hop.latency >= 0 ? `${hop.latency.toFixed(0)}ms` : "超时"}
+
+
+
0 ? "text-warning" : "text-default-400"}`}>
+ {hop.loss.toFixed(0)}% 丢包
+
+
+
+ {hop.toNodeName}
+
+
+ );
+ })}
+
+