add serverGraphDuration config option
This commit is contained in:
@ -15,7 +15,7 @@ class App {
|
||||
this.mojangUpdater = new MojangUpdater(this)
|
||||
this.pingController = new PingController(this)
|
||||
this.server = new Server(this.handleClientConnection)
|
||||
this.timeTracker = new TimeTracker()
|
||||
this.timeTracker = new TimeTracker(this)
|
||||
}
|
||||
|
||||
loadDatabase (callback) {
|
||||
@ -24,7 +24,7 @@ class App {
|
||||
// Setup database instance
|
||||
this.database.ensureIndexes()
|
||||
|
||||
this.database.loadGraphPoints(config.graphDuration, () => {
|
||||
this.database.loadGraphPoints(this.pingController.getMaxGraphDataLength(), () => {
|
||||
this.database.loadRecords(callback)
|
||||
})
|
||||
}
|
||||
@ -68,7 +68,9 @@ class App {
|
||||
|
||||
// Send configuration data for rendering the page
|
||||
return {
|
||||
graphDuration: config.graphDuration,
|
||||
graphDurationLabel: config.graphDurationLabel || (Math.floor(config.graphDuration / (60 * 60 * 1000)) + 'h'),
|
||||
graphMaxLength: this.pingController.getMaxGraphDataLength(),
|
||||
serverGraphMaxLength: this.pingController.getMaxServerGraphDataLength(),
|
||||
servers: this.serverRegistrations.map(serverRegistration => serverRegistration.data),
|
||||
minecraftVersions: minecraftVersionNames,
|
||||
isGraphVisible: config.logToDatabase
|
||||
|
Reference in New Issue
Block a user