Add: Dauerhaftes Bildschirm-Übertragung-Overlay während RDP-Session (v2.6.0)
- RdpActiveIndicatorWindow: TeamViewer-Style Overlay unten rechts, solange RDP-Capture läuft. Zeigt Dauer der Sitzung + pulsierenden roten Punkt - User kann per "Trennen"-Button selbst die Sitzung beenden (TCP-Signal an Service, cancelt Capture-Loop sofort — auch nach Screen-Wechsel) - Overlay läuft als separater User-Prozess via SessionSpawner, wird vom Service direkt gekillt wenn Sitzung endet (rdp_stop oder Disconnect) - Version: 2.5.0 → 2.6.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
57
agent-cs/UI/RdpActiveIndicatorWindow.xaml
Normal file
57
agent-cs/UI/RdpActiveIndicatorWindow.xaml
Normal file
@@ -0,0 +1,57 @@
|
||||
<Window x:Class="ITNexusAgent.UI.RdpActiveIndicatorWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="IT Nexus – Bildschirmübertragung aktiv"
|
||||
Width="300" Height="64"
|
||||
WindowStartupLocation="Manual"
|
||||
ResizeMode="NoResize"
|
||||
WindowStyle="None"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
Topmost="True"
|
||||
ShowInTaskbar="False"
|
||||
FontFamily="Segoe UI">
|
||||
|
||||
<Border Background="#1A1D2E" BorderBrush="#E67E22" BorderThickness="1.5" CornerRadius="10">
|
||||
<Grid Margin="14,10,14,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Pulsierender roter Punkt -->
|
||||
<Ellipse x:Name="PulseDot" Grid.Column="0" Width="10" Height="10" Fill="#E74C3C"
|
||||
VerticalAlignment="Center" Margin="0,0,12,0">
|
||||
<Ellipse.Triggers>
|
||||
</Ellipse.Triggers>
|
||||
</Ellipse>
|
||||
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
<TextBlock Text="Bildschirm wird übertragen" FontSize="12" FontWeight="Bold" Foreground="White"/>
|
||||
<TextBlock x:Name="DurationText" Text="IT-Abteilung sieht zu · 00:00" FontSize="10.5" Foreground="#9099B5" Margin="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
|
||||
<Button x:Name="DisconnectButton" Grid.Column="2" Click="DisconnectButton_Click"
|
||||
Background="#3D1414" Foreground="#FF8A80" BorderThickness="1" BorderBrush="#6B2020"
|
||||
Padding="10,6" Cursor="Hand" VerticalAlignment="Center" FontSize="11" FontWeight="Bold">
|
||||
<Button.Template>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="6" Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
<TextBlock Text="Trennen"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Window.Resources>
|
||||
<Storyboard x:Key="PulseAnim" RepeatBehavior="Forever">
|
||||
<DoubleAnimation Storyboard.TargetName="PulseDot" Storyboard.TargetProperty="Opacity"
|
||||
From="1.0" To="0.25" Duration="0:0:0.9" AutoReverse="True"/>
|
||||
</Storyboard>
|
||||
</Window.Resources>
|
||||
</Window>
|
||||
55
agent-cs/UI/RdpActiveIndicatorWindow.xaml.cs
Normal file
55
agent-cs/UI/RdpActiveIndicatorWindow.xaml.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System.Net.Sockets;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Animation;
|
||||
|
||||
namespace ITNexusAgent.UI;
|
||||
|
||||
public partial class RdpActiveIndicatorWindow : Window
|
||||
{
|
||||
private readonly int _port;
|
||||
private readonly DateTime _startedAt = DateTime.Now;
|
||||
private readonly System.Windows.Threading.DispatcherTimer _timer = new();
|
||||
private bool _signaled = false;
|
||||
|
||||
public RdpActiveIndicatorWindow(int port)
|
||||
{
|
||||
InitializeComponent();
|
||||
_port = port;
|
||||
|
||||
Loaded += (s, e) =>
|
||||
{
|
||||
var area = SystemParameters.WorkArea;
|
||||
Left = area.Right - Width - 16;
|
||||
Top = area.Bottom - Height - 16;
|
||||
((Storyboard)Resources["PulseAnim"]).Begin(PulseDot);
|
||||
};
|
||||
|
||||
_timer.Interval = TimeSpan.FromSeconds(1);
|
||||
_timer.Tick += (s, e) =>
|
||||
{
|
||||
var elapsed = DateTime.Now - _startedAt;
|
||||
DurationText.Text = $"IT-Abteilung sieht zu · {elapsed:mm\\:ss}";
|
||||
};
|
||||
_timer.Start();
|
||||
}
|
||||
|
||||
private void DisconnectButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SendDisconnectSignal();
|
||||
Close();
|
||||
}
|
||||
|
||||
private void SendDisconnectSignal()
|
||||
{
|
||||
if (_signaled) return;
|
||||
_signaled = true;
|
||||
try
|
||||
{
|
||||
using var tcp = new TcpClient();
|
||||
tcp.Connect("127.0.0.1", _port);
|
||||
tcp.GetStream().WriteByte(1);
|
||||
tcp.GetStream().Flush();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user