mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* log viewer improvements * playout detail table improvements * schedule items table improvements * remove schedule items pagerpull/273/head
15 changed files with 199 additions and 66 deletions
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
using System.Collections.Generic; |
||||
|
||||
namespace ErsatzTV.Application.Logs |
||||
{ |
||||
public record PagedLogEntriesViewModel(int TotalCount, List<LogEntryViewModel> Page); |
||||
} |
||||
@ -1,7 +1,14 @@
@@ -1,7 +1,14 @@
|
||||
using System.Collections.Generic; |
||||
using System; |
||||
using System.Linq.Expressions; |
||||
using ErsatzTV.Core.Domain; |
||||
using LanguageExt; |
||||
using MediatR; |
||||
|
||||
namespace ErsatzTV.Application.Logs.Queries |
||||
{ |
||||
public record GetRecentLogEntries : IRequest<List<LogEntryViewModel>>; |
||||
public record GetRecentLogEntries(int PageNum, int PageSize) : IRequest<PagedLogEntriesViewModel> |
||||
{ |
||||
public Expression<Func<LogEntry, object>> SortExpression { get; set; } |
||||
public Option<bool> SortDescending { get; set; } |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
using System.Collections.Generic; |
||||
|
||||
namespace ErsatzTV.Application.Playouts |
||||
{ |
||||
public record PagedPlayoutItemsViewModel(int TotalCount, List<PlayoutItemViewModel> Page); |
||||
} |
||||
@ -1,11 +0,0 @@
@@ -1,11 +0,0 @@
|
||||
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
||||
using ErsatzTV.Core.Domain; |
||||
|
||||
namespace ErsatzTV.Core.Interfaces.Repositories |
||||
{ |
||||
public interface ILogRepository |
||||
{ |
||||
Task<List<LogEntry>> GetRecentLogEntries(); |
||||
} |
||||
} |
||||
@ -1,19 +0,0 @@
@@ -1,19 +0,0 @@
|
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Threading.Tasks; |
||||
using ErsatzTV.Core.Domain; |
||||
using ErsatzTV.Core.Interfaces.Repositories; |
||||
using Microsoft.EntityFrameworkCore; |
||||
|
||||
namespace ErsatzTV.Infrastructure.Data.Repositories |
||||
{ |
||||
public class LogRepository : ILogRepository |
||||
{ |
||||
private readonly LogContext _logContext; |
||||
|
||||
public LogRepository(LogContext logContext) => _logContext = logContext; |
||||
|
||||
public Task<List<LogEntry>> GetRecentLogEntries() => |
||||
_logContext.LogEntries.OrderByDescending(e => e.Id).Take(100).ToListAsync(); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue