use a single, shared timestamps array between all pings

This commit is contained in:
Nick Krecklow
2020-05-08 01:22:07 -05:00
parent 3ddb2c9a08
commit c2494af82d
7 changed files with 55 additions and 30 deletions

View File

@ -102,7 +102,7 @@ export class App {
.reduce((sum, current) => sum + current, 0)
}
addServer = (pings) => {
addServer = (pings, timestampPoints) => {
// Even if the backend has never pinged the server, the frontend is promised a placeholder object.
// result = undefined
// error = defined with "Waiting" description
@ -114,14 +114,14 @@ export class App {
// Push the historical data into the graph
// This will trim and format the data so it is ready for the graph to render once init
serverRegistration.addGraphPoints(pings)
serverRegistration.addGraphPoints(pings, timestampPoints)
// Create the plot instance internally with the restructured and cleaned data
serverRegistration.buildPlotInstance()
// Handle the last known state (if any) as an incoming update
// This triggers the main update pipeline and enables centralized update handling
serverRegistration.updateServerStatus(latestPing, latestPing.timestamp, true, this.publicConfig.minecraftVersions)
serverRegistration.updateServerStatus(latestPing, true, this.publicConfig.minecraftVersions)
// Allow the ServerRegistration to bind any DOM events with app instance context
serverRegistration.initEventListeners()