Wake On Lan Used Time Feature Improvements

This commit is contained in:
ned3y2k 2022-03-06 22:13:41 +09:00
parent cc70b68cf8
commit 154127e631
2 changed files with 13 additions and 3 deletions

View file

@ -124,7 +124,7 @@ func WakeOnHost(db store.IStore) echo.HandlerFunc {
macAddress := c.Param("mac_address")
host, err := db.GetWakeOnLanHost(macAddress)
now := time.Now()
now := time.Now().UTC()
host.LatestUsed = &now
err = db.SaveWakeOnLanHost(*host)
if err != nil {
@ -166,6 +166,6 @@ func WakeOnHost(db store.IStore) echo.HandlerFunc {
return createError(c, err, fmt.Sprintf("Network Send Error: %s", macAddress))
}
return c.JSON(http.StatusOK, nil)
return c.JSON(http.StatusOK, host.LatestUsed)
}
}