feat: add timestamps to computer graph data

This commit is contained in:
trafficlunar 2024-11-30 00:01:01 +00:00
parent e97b271bd7
commit 43628a1a66
4 changed files with 52 additions and 20 deletions

View file

@ -1,12 +1,19 @@
package model
import "time"
type ComputerWebSocketMessage struct {
Cpu uint8 `json:"cpu"`
Ram uint8 `json:"ram"`
}
type ComputerGraphData struct {
Online bool `json:"online"`
Cpu []int `json:"cpu"`
Ram []int `json:"ram"`
type ComputerData struct {
Online bool `json:"online"`
Graph []ComputerGraphData `json:"graph"`
}
type ComputerGraphData struct {
Timestamp time.Time `json:"timestamp"`
Cpu int `json:"cpu"`
Ram int `json:"ram"`
}