Add Remote Desktop screen selector + new-tab button (v2.2.0)

- CaptureModeRunner: screen index param (0=all, 1-N=specific monitor)
- RtcService: reads screen from rdp_start JSON, passes to capture helper
- Program.cs: parses optional screen index arg for --rdp-capture
- RemoteDesktopPanel: screen dropdown (Alle/1-4), new-tab button
- RdpPage: fullscreen standalone page at /rdp/:agentId
- AgentDetailPage: removed dead _RemoteDesktopOld_unused code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-11 10:15:00 +02:00
parent d3bc68d6a5
commit 058f968af1
7 changed files with 231 additions and 144 deletions

View File

@@ -65,9 +65,10 @@ public class RtcService
if (type == "rdp_start" && captureCts == null)
{
var screenIdx = obj["screen"]?.ToObject<int>() ?? 0;
captureCts = CancellationTokenSource.CreateLinkedTokenSource(ct);
_ = CapturePipeLoopAsync(ws, captureCts.Token);
AgentWorker.Log("RDP: Screen-Capture gestartet");
_ = CapturePipeLoopAsync(ws, screenIdx, captureCts.Token);
AgentWorker.Log($"RDP: Screen-Capture gestartet (screen={screenIdx})");
}
else if (type == "rdp_stop" && captureCts != null)
{
@@ -81,7 +82,7 @@ public class RtcService
AgentWorker.Log("RDP: Getrennt");
}
private async Task CapturePipeLoopAsync(ClientWebSocket ws, CancellationToken ct)
private async Task CapturePipeLoopAsync(ClientWebSocket ws, int screenIdx, CancellationToken ct)
{
var exePath = System.Diagnostics.Process.GetCurrentProcess().MainModule!.FileName;
@@ -90,7 +91,7 @@ public class RtcService
listener.Start();
var port = ((IPEndPoint)listener.LocalEndpoint).Port;
if (!SpawnCaptureHelper(exePath, port.ToString()))
if (!SpawnCaptureHelper(exePath, port.ToString(), screenIdx))
{
listener.Stop();
AgentWorker.Log("RDP: Helper-Start fehlgeschlagen");
@@ -160,7 +161,7 @@ public class RtcService
AgentWorker.Log("RDP: Frame-Loop beendet");
}
private static bool SpawnCaptureHelper(string exePath, string portStr)
private static bool SpawnCaptureHelper(string exePath, string portStr, int screenIdx = 0)
{
try
{
@@ -181,7 +182,7 @@ public class RtcService
? "/ru \"INTERACTIVE\""
: $"/ru \"{fullUser}\"";
var args = $"/create /tn \"{taskName}\" /tr \"\\\"{exePath}\\\" --rdp-capture {portStr}\" " +
var args = $"/create /tn \"{taskName}\" /tr \"\\\"{exePath}\\\" --rdp-capture {portStr} {screenIdx}\" " +
$"/sc ONCE /st {triggerTime} {ruArg} /it /f";
var p = Process.Start(new ProcessStartInfo("schtasks.exe", args)