feat(api): add traffic log details filtering and enhance traffic log structures
This commit is contained in:
@@ -352,6 +352,7 @@ type ServerTraffic struct {
|
||||
ServerId int64 `json:"server_id"` // Server ID
|
||||
Upload int64 `json:"upload"` // Upload traffic in bytes
|
||||
Download int64 `json:"download"` // Download traffic in bytes
|
||||
Total int64 `json:"total"` // Total traffic in bytes (Upload + Download)
|
||||
}
|
||||
|
||||
// Marshal implements the json.Marshaler interface for ServerTraffic.
|
||||
|
||||
@@ -26,7 +26,7 @@ type customSystemLogLogicModel interface {
|
||||
}
|
||||
|
||||
func (m *customSystemLogModel) FilterSystemLog(ctx context.Context, filter *FilterParams) ([]*SystemLog, int64, error) {
|
||||
tx := m.WithContext(ctx).Model(&SystemLog{})
|
||||
tx := m.WithContext(ctx).Model(&SystemLog{}).Order("id DESC")
|
||||
if filter == nil {
|
||||
filter = &FilterParams{
|
||||
Page: 1,
|
||||
|
||||
Reference in New Issue
Block a user