diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..65b6f43
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,14 @@
+
+
+
+ 0.1.0
+ Justin Paul
+ Justin Paul
+ Webhook Server
+ Copyright (c) Justin Paul
+ https://jpaul.me
+ https://github.com/recklessop/webhook-server
+ git
+
+
+
diff --git a/src/WebhookServer.Gui/MainWindow.xaml b/src/WebhookServer.Gui/MainWindow.xaml
index 121535b..17ea76f 100644
--- a/src/WebhookServer.Gui/MainWindow.xaml
+++ b/src/WebhookServer.Gui/MainWindow.xaml
@@ -8,6 +8,9 @@
mc:Ignorable="d"
Title="Webhook Server" Height="600" Width="1000"
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}">
+
+
+
@@ -19,21 +22,25 @@
-
-
-
-
-
-
-
-
-
-
-
+
@@ -53,6 +60,20 @@
diff --git a/src/WebhookServer.Gui/ViewModels/MainViewModel.cs b/src/WebhookServer.Gui/ViewModels/MainViewModel.cs
index fe5eda9..297fd91 100644
--- a/src/WebhookServer.Gui/ViewModels/MainViewModel.cs
+++ b/src/WebhookServer.Gui/ViewModels/MainViewModel.cs
@@ -175,6 +175,41 @@ public sealed partial class MainViewModel : ObservableObject
}
}
+ [RelayCommand]
+ private async Task RestartServiceAsync()
+ {
+ var ok = MessageBox.Show(
+ "Restart the WebhookServer service? In-flight requests will be aborted.",
+ "Restart service",
+ MessageBoxButton.OKCancel,
+ MessageBoxImage.Warning);
+ if (ok != MessageBoxResult.OK) return;
+
+ try
+ {
+ await _client.RestartListenerAsync().ConfigureAwait(false);
+ await Task.Delay(2000).ConfigureAwait(false);
+ await RefreshAsync().ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ ShowError("Restart failed", ex);
+ }
+ }
+
+ [RelayCommand]
+ private void ShowAbout()
+ {
+ var dlg = new Views.AboutDialog { Owner = Application.Current.MainWindow };
+ dlg.ShowDialog();
+ }
+
+ [RelayCommand]
+ private void Exit()
+ {
+ Application.Current.Shutdown();
+ }
+
[RelayCommand]
private void CopyEndpointUrl()
{
diff --git a/src/WebhookServer.Gui/Views/AboutDialog.xaml b/src/WebhookServer.Gui/Views/AboutDialog.xaml
new file mode 100644
index 0000000..8612b27
--- /dev/null
+++ b/src/WebhookServer.Gui/Views/AboutDialog.xaml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A Windows-native webhook server that runs PowerShell, cmd, or arbitrary
+ executables in response to incoming HTTP requests.
+
+
+
+
+
+
+
+
+ https://jpaul.me
+
+
+ github.com/recklessop/webhook-server
+
+
+
+
+
+
diff --git a/src/WebhookServer.Gui/Views/AboutDialog.xaml.cs b/src/WebhookServer.Gui/Views/AboutDialog.xaml.cs
new file mode 100644
index 0000000..5a66ed5
--- /dev/null
+++ b/src/WebhookServer.Gui/Views/AboutDialog.xaml.cs
@@ -0,0 +1,28 @@
+using System.Diagnostics;
+using System.Reflection;
+using System.Windows;
+using System.Windows.Navigation;
+
+namespace WebhookServer.Gui.Views;
+
+public partial class AboutDialog : Window
+{
+ public AboutDialog()
+ {
+ InitializeComponent();
+
+ var asm = Assembly.GetExecutingAssembly();
+ var info = asm.GetCustomAttribute()?.InformationalVersion
+ ?? asm.GetName().Version?.ToString()
+ ?? "0.0.0";
+ VersionText.Text = $"Version {info}";
+ }
+
+ private void OnHyperlink(object sender, RequestNavigateEventArgs e)
+ {
+ Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
+ e.Handled = true;
+ }
+
+ private void OnOk(object sender, RoutedEventArgs e) => Close();
+}