3d47fc1439
- Created ResourceHub.cs for SignalR group management. - Developed a modern web dashboard using Tailwind CSS for responsive design. - Implemented real-time updates with SignalR for CPU, Memory, GPU, and Network usage. - Added REST API endpoints for resource information and process management. - Integrated process management features to view and terminate high-usage processes. - Enhanced UI with loading spinners, notifications, and responsive tables. - Included performance charts for historical CPU and Memory usage. - Configured Swagger UI for API documentation. - Established security features including process kill restrictions and API key authentication.
91 lines
3.8 KiB
C#
91 lines
3.8 KiB
C#
namespace ResourceMonitorService.Configuration
|
|
{
|
|
public class MonitoringSettings
|
|
{
|
|
public int UpdateIntervalMs { get; set; } = 15000; // 15 seconds
|
|
public int DataRetentionDays { get; set; } = 7;
|
|
public bool EnableGpuMonitoring { get; set; } = true;
|
|
public bool EnableDiskMonitoring { get; set; } = true;
|
|
public bool EnableNetworkMonitoring { get; set; } = true;
|
|
public bool EnableTemperatureMonitoring { get; set; } = true;
|
|
public bool EnableProcessMonitoring { get; set; } = true;
|
|
public bool EnableGameDetection { get; set; } = true;
|
|
public bool EnableAlerts { get; set; } = true;
|
|
public int MaxProcessesToTrack { get; set; } = 10;
|
|
public int MaxHistoryPoints { get; set; } = 1000;
|
|
|
|
public List<string> GamePlatformPaths { get; set; } = new()
|
|
{
|
|
@"\steamapps\common\",
|
|
@"\Epic Games\",
|
|
@"\GOG Galaxy\Games\",
|
|
@"\Origin Games\",
|
|
@"\Ubisoft Game Launcher\games\"
|
|
};
|
|
|
|
public List<string> GameRootFolders { get; set; } = new()
|
|
{
|
|
@"C:\Games",
|
|
@"D:\Games",
|
|
@"E:\Games"
|
|
};
|
|
|
|
public List<AlertThresholdConfig> AlertThresholds { get; set; } = new()
|
|
{
|
|
new() { Component = "CPU", WarningThreshold = 80, CriticalThreshold = 95, DurationSeconds = 30 },
|
|
new() { Component = "Memory", WarningThreshold = 85, CriticalThreshold = 95, DurationSeconds = 30 },
|
|
new() { Component = "GPU", WarningThreshold = 85, CriticalThreshold = 95, DurationSeconds = 30 },
|
|
new() { Component = "CPUTemp", WarningThreshold = 75, CriticalThreshold = 85, DurationSeconds = 60 },
|
|
new() { Component = "GPUTemp", WarningThreshold = 80, CriticalThreshold = 90, DurationSeconds = 60 }
|
|
};
|
|
|
|
public TelegramSettings Telegram { get; set; } = new();
|
|
}
|
|
|
|
public class AlertThresholdConfig
|
|
{
|
|
public string Component { get; set; } = string.Empty;
|
|
public float WarningThreshold { get; set; }
|
|
public float CriticalThreshold { get; set; }
|
|
public int DurationSeconds { get; set; } = 30;
|
|
public bool IsEnabled { get; set; } = true;
|
|
}
|
|
|
|
public class ApiSettings
|
|
{
|
|
public string ApiKey { get; set; } = string.Empty;
|
|
public bool RequireApiKey { get; set; } = false;
|
|
public List<string> AllowedOrigins { get; set; } = new()
|
|
{
|
|
"http://localhost:4200",
|
|
"http://192.168.50.52:4200",
|
|
"http://vmwin11:4200"
|
|
};
|
|
public bool EnableSwagger { get; set; } = false;
|
|
public string BasePath { get; set; } = "/api";
|
|
}
|
|
|
|
public class LoggingSettings
|
|
{
|
|
public string LogLevel { get; set; } = "Information";
|
|
public string LogPath { get; set; } = "logs";
|
|
public int MaxLogFiles { get; set; } = 30;
|
|
public long MaxLogFileSizeMB { get; set; } = 10;
|
|
public bool EnableFileLogging { get; set; } = true;
|
|
public bool EnableConsoleLogging { get; set; } = true;
|
|
public bool EnablePerformanceLogging { get; set; } = false;
|
|
}
|
|
|
|
public class TelegramSettings
|
|
{
|
|
public bool IsEnabled { get; set; } = false;
|
|
public string BotToken { get; set; } = string.Empty;
|
|
public List<long> ChatIds { get; set; } = new();
|
|
public bool SendWarningAlerts { get; set; } = true;
|
|
public bool SendCriticalAlerts { get; set; } = true;
|
|
public bool SendResolutionNotifications { get; set; } = true;
|
|
public string MessageTemplate { get; set; } = "🚨 *{Level} Alert*\n\n📊 *{Component}*\n💬 {Message}\n⏰ {Timestamp:yyyy-MM-dd HH:mm:ss}";
|
|
public string ResolutionTemplate { get; set; } = "✅ *Alert Resolved*\n\n📊 *{Component}*\n💬 {Message}\n⏰ Resolved at {ResolvedAt:yyyy-MM-dd HH:mm:ss}";
|
|
}
|
|
}
|