mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-05 23:34:09 +02:00
feat: add server logs functionality with role-based access and system channel management
- Introduced a new migration to add the IsSystem column to the Channels table. - Updated the DbContext model snapshot to reflect the new IsSystem property. - Enhanced the ChannelService to manage system channels, including creation, visibility control, and protection against deletion. - Implemented ServerLogsService to handle live server logging, including reading from log files and managing access based on user roles. - Created ServerLogsSink to queue log events for streaming to the live log room. - Developed ServerLogsStreamService to stream log events to clients in real-time. - Added configuration options for server logs in appsettings. - Implemented comprehensive unit tests for channel service system channel behavior and server logs functionality.
This commit is contained in:
@@ -24,6 +24,11 @@ public interface IChannelService
|
||||
|
||||
// Membership
|
||||
Task<(bool Success, string? Error, bool PasswordRequired)> EnsureChannelMembershipAsync(Guid userId, string channelName, string? password = null);
|
||||
|
||||
// System channels (server-managed, e.g. the live server-log room). Creates the channel
|
||||
// if missing and reclaims a same-named regular channel so server content never lands in
|
||||
// a user-owned room.
|
||||
Task<ChannelDto> EnsureSystemChannelAsync(string channelName, string? topic = null);
|
||||
}
|
||||
|
||||
public record ChannelListItem(string Name, string? Topic, int OnlineCount, bool IsPublic = true, bool IsProtected = false);
|
||||
|
||||
Reference in New Issue
Block a user