diff --git a/Backend/MonitorPanel/MonitorPanel.Core/Models/Server.cs b/Backend/MonitorPanel/MonitorPanel.Core/Models/Server.cs index 5fbb7d2..90084f3 100644 --- a/Backend/MonitorPanel/MonitorPanel.Core/Models/Server.cs +++ b/Backend/MonitorPanel/MonitorPanel.Core/Models/Server.cs @@ -3,10 +3,10 @@ namespace MonitorPanel.Core.Models; public class Server( Guid id, string name, - bool isHttps, string address, - string? path, - int port) + string? path = null, + bool isHttps = true, + int port = 443) { public readonly Guid Id = id; public string Name { get; set; } = name; diff --git a/Backend/MonitorPanel/MonitorPanel.DataAccess/Repositories/ServersRepository.cs b/Backend/MonitorPanel/MonitorPanel.DataAccess/Repositories/ServersRepository.cs index e7e1a64..7cf9ec2 100644 --- a/Backend/MonitorPanel/MonitorPanel.DataAccess/Repositories/ServersRepository.cs +++ b/Backend/MonitorPanel/MonitorPanel.DataAccess/Repositories/ServersRepository.cs @@ -33,14 +33,14 @@ public class ServersRepository(MonitorPanelDbContext db) : IServersRepository public async Task> GetAllServersAsync() { return await db.Servers.AsNoTracking() - .Select(s => new Server(s.Id, s.Name, s.IsHttps, s.Address, s.Path, s.Port)) + .Select(s => new Server(s.Id, s.Name, s.Address, s.Path, s.IsHttps, s.Port)) .ToListAsync(); } public async Task GetServerByIdAsync(Guid id) { var entity = await db.Servers.FirstOrDefaultAsync(s => s.Id == id); - return entity == null ? null : new Server(entity.Id, entity.Name, entity.IsHttps, entity.Address, entity.Path, entity.Port); + return entity == null ? null : new Server(entity.Id, entity.Name, entity.Address, entity.Path, entity.IsHttps, entity.Port); } public async Task UpdateServerAsync(Guid id, string name, bool isHttps, string address, string? path, int port)