Initial commit: IT Nexus Web-App

This commit is contained in:
2026-06-01 20:49:07 +02:00
commit 8023765e6c
387 changed files with 106900 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
using System.Windows;
using MessageBox = System.Windows.MessageBox;
namespace ITNexusAgent.UI;
public partial class LogWindow : Window
{
private const string LogPath = @"C:\ProgramData\IT Nexus Agent\agent.log";
public LogWindow()
{
InitializeComponent();
LoadLog();
}
private void LoadLog()
{
try
{
if (File.Exists(LogPath))
{
var lines = File.ReadAllLines(LogPath);
LogText.Text = string.Join(Environment.NewLine, lines.TakeLast(500));
LogText.ScrollToEnd();
}
else LogText.Text = "Log-Datei nicht gefunden.";
}
catch (Exception ex) { LogText.Text = $"Fehler: {ex.Message}"; }
}
private void Refresh_Click(object sender, RoutedEventArgs e) => LoadLog();
private void Clear_Click(object sender, RoutedEventArgs e)
{
var r = MessageBox.Show("Log wirklich löschen?", "IT Nexus",
MessageBoxButton.YesNo, MessageBoxImage.Question);
if (r != MessageBoxResult.Yes) return;
try { File.WriteAllText(LogPath, ""); LoadLog(); } catch { }
}
}