Explorar o código

feat(ui): draw the fleet sparkline as a curve

Each fleet card sparkline switches from steps to the smooth line used by the WAN chart.

Part of #1975
Nacho hai 3 semanas
pai
achega
29d826bf3e
Modificáronse 2 ficheiros con 6 adicións e 3 borrados
  1. 2 0
      CHANGELOG.md
  2. 4 3
      app/src/components/routers/FleetCard.tsx

+ 2 - 0
CHANGELOG.md

@@ -11,6 +11,8 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 
 - The WAN traffic chart alternates Curve and Bars, with Curve as the default (#1975). Curve is the smooth monotone line the chart had before #1790; the stepped variant is gone and the choice is remembered per browser.
 
+- The fleet traffic sparkline is a smooth curve too, matching the WAN chart (#1975). The stepped shape made every hourly bucket look like a stair without adding information.
+
 - A Send test button next to the push switch (#1973). Turning notifications on could not be checked: a push only leaves when a real urgent alert fires, so a broken setup stayed silent until an alert was missed. The button sends one notification to this device through the same path as real alerts and reports what the push service answered, including the reason on a rejection. An expired subscription is removed and the switch turns off. One test per user every ten seconds.
 
 - The WAN traffic chart can draw bars instead of the line (#1975). A switch next to the range selector picks Linear or Bars and remembers the choice in the browser. Nothing changes on the server.

+ 4 - 3
app/src/components/routers/FleetCard.tsx

@@ -307,9 +307,10 @@ export function FleetCard({ router, index = 0, refreshKey = 0 }: FleetCardProps)
                 </defs>
                 <Tooltip content={<TrafficTooltip unit={trafficUnit} />} cursor={{ stroke: 'rgb(var(--border-strong))', strokeWidth: 1 }} />
                 <Area
-                  // #1901: sparkline horario (MAX del bucket), no muestras
-                  // instantáneas: el escalón no inventa minutos de rampa.
-                  type="stepAfter"
+                  // Curva suave, como la del tráfico WAN: el sparkline se lee
+                  // de un vistazo y el escalón marcaba cada bucket como un
+                  // peldaño sin aportar nada.
+                  type="monotone"
                   dataKey="v"
                   stroke="#22D3EE"
                   strokeWidth={1.75}