Switch to gorm for activity logging

This commit is contained in:
DaneEveritt
2022-07-24 11:43:48 -04:00
parent 61baccb1a3
commit 8a867ccc44
17 changed files with 514 additions and 421 deletions

View File

@@ -3,6 +3,7 @@ package websocket
import (
"context"
"fmt"
"github.com/pterodactyl/wings/internal/models"
"net/http"
"strings"
"sync"
@@ -369,7 +370,7 @@ func (h *Handler) HandleInbound(ctx context.Context, m Message) error {
}
if err == nil {
_ = h.ra.Save(h.server, server.Event(server.ActivityPowerPrefix+action), nil)
_ = h.ra.Save(h.server, models.Event(server.ActivityPowerPrefix+action), nil)
}
return err
@@ -428,7 +429,7 @@ func (h *Handler) HandleInbound(ctx context.Context, m Message) error {
}
}
_ = h.ra.Save(h.server, server.ActivityConsoleCommand, server.ActivityMeta{
_ = h.ra.Save(h.server, server.ActivityConsoleCommand, models.ActivityMeta{
"command": strings.Join(m.Args, ""),
})