Add ResourceHub for real-time updates and implement web dashboard with REST API

- 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.
This commit is contained in:
Phoenix
2025-08-07 23:02:03 +08:00
parent aa30c9f034
commit 3d47fc1439
23 changed files with 1405 additions and 547 deletions
+36 -5
View File
@@ -249,22 +249,39 @@ namespace ResourceMonitorService.Services
"setup", "installer", "update", "vshost", "devenv"
};
// Skip if it's a known system process
if (systemExclusions.Any(exclusion => fileName.Contains(exclusion)))
// Exclude gaming platform clients (they are not games themselves)
var platformClientExclusions = new[]
{
"steam", "steamwebhelper", "steamservice", "steamerrorreporter",
"epicgameslauncher", "epic games launcher", "epiconlineservices",
"origin", "originwebhelperservice", "originweb", "originthinsetup",
"uplay", "upc", "ubisoftgamelauncher", "ubisoftconnect",
"battle.net", "battlenet", "blizzardlauncher", "blizzard update agent",
"gog galaxy", "goggalaxy", "gogcom",
"rockstar games launcher", "rockstargameslauncher",
"riotclientservices", "riot client", "valorant-win64-shipping",
"ea app", "ea desktop", "eadesktop", "eabackground",
"xbox", "xboxapp", "xboxgamebar", "microsoftstore"
};
// Skip if it's a known system process or platform client
if (systemExclusions.Any(exclusion => fileName.Contains(exclusion)) ||
platformClientExclusions.Any(exclusion => fileName.Contains(exclusion)))
{
return null;
}
var knownGameExecutables = new[]
{
"game", "launcher", "client"
// Removed generic terms like "main", "start", "run" that match too many system processes
"game"
// Removed "launcher" and "client" as they often refer to platform clients, not games
};
var gameIndicators = new[]
{
"unreal", "unity", "godot", "gamemaker", "rpgmaker",
"steam", "epic", "origin", "uplay", "battle.net"
"\\steamapps\\common\\", "\\epic games\\", "\\gog galaxy\\games\\",
"\\origin games\\", "\\ubisoft game launcher\\games\\"
};
// Check if it's likely a game based on executable name or path
@@ -398,6 +415,20 @@ namespace ResourceMonitorService.Services
if (!string.IsNullOrEmpty(versionInfo.ProductName) &&
!versionInfo.ProductName.Equals(versionInfo.FileName, StringComparison.OrdinalIgnoreCase))
{
// Check if this is a platform client by product name
var platformClientNames = new[]
{
"steam", "epic games launcher", "origin", "uplay", "ubisoft connect",
"battle.net", "blizzard launcher", "gog galaxy", "riot client",
"ea app", "ea desktop", "xbox", "microsoft store", "rockstar games launcher"
};
if (platformClientNames.Any(client =>
versionInfo.ProductName.Contains(client, StringComparison.OrdinalIgnoreCase)))
{
return string.Empty; // Return empty to indicate this should not be treated as a game
}
return versionInfo.ProductName;
}