Skip to content

Commit 5f535ab

Browse files
authored
Feature: Add start & pause button per group in ping monitor (#3575)
* Feature: Add start & pause button per group in ping monitor * Docs: update docs #3575 * Fix: Touch / keyboard behaviour - auto close after 20 seconds * Fix: Claude review * Fix: Use context menu instead of buttons
1 parent 94da8ea commit 5f535ab

7 files changed

Lines changed: 203 additions & 50 deletions

File tree

‎Source/NETworkManager.Localization/Resources/Strings.Designer.cs‎

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Source/NETworkManager.Localization/Resources/Strings.resx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3892,6 +3892,15 @@ Try again in a few seconds.</value>
38923892
<data name="CloseGroup" xml:space="preserve">
38933893
<value>Close group</value>
38943894
</data>
3895+
<data name="StartGroup" xml:space="preserve">
3896+
<value>Start group</value>
3897+
</data>
3898+
<data name="GroupActions" xml:space="preserve">
3899+
<value>Group actions</value>
3900+
</data>
3901+
<data name="PauseGroup" xml:space="preserve">
3902+
<value>Pause group</value>
3903+
</data>
38953904
<data name="RunCommandDotsWithHotKey" xml:space="preserve">
38963905
<value>Run command... (Ctrl+Shift+P)</value>
38973906
</data>

‎Source/NETworkManager/ViewModels/PingMonitorHostViewModel.cs‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,28 @@ private void CloseGroupAction(object group)
239239
RemoveGroup(group.ToString());
240240
}
241241

242+
/// <summary>
243+
/// Gets the command to start every host in a group that is not currently running.
244+
/// </summary>
245+
public ICommand StartGroupCommand => new RelayCommand(StartGroupAction);
246+
247+
private void StartGroupAction(object group)
248+
{
249+
foreach (var host in Hosts.Where(host => host.Group.Equals(group.ToString()) && !host.IsRunning))
250+
host.Start();
251+
}
252+
253+
/// <summary>
254+
/// Gets the command to pause every host in a group that is currently running.
255+
/// </summary>
256+
public ICommand PauseGroupCommand => new RelayCommand(PauseGroupAction);
257+
258+
private void PauseGroupAction(object group)
259+
{
260+
foreach (var host in Hosts.Where(host => host.Group.Equals(group.ToString()) && host.IsRunning))
261+
host.Stop();
262+
}
263+
242264
#endregion
243265

244266
#region Methods

‎Source/NETworkManager/Views/PingMonitorHostView.xaml‎

Lines changed: 115 additions & 48 deletions
Large diffs are not rendered by default.

‎Source/NETworkManager/Views/PingMonitorHostView.xaml.cs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Windows;
2+
using System.Windows.Controls;
13
using NETworkManager.ViewModels;
24

35
namespace NETworkManager.Views;
@@ -27,4 +29,17 @@ public void OnViewVisible()
2729
{
2830
_viewModel.OnViewVisible();
2931
}
32+
33+
/// <summary>
34+
/// Opens the group actions context menu on a normal click (not just right-click), so it
35+
/// works the same way for mouse, touch and keyboard activation. PlacementTarget is set
36+
/// explicitly since it isn't populated automatically when opening the menu this way, and
37+
/// the menu items rely on it to reach the group name (see Button.Tag in the XAML).
38+
/// </summary>
39+
private void GroupActionsButton_Click(object sender, RoutedEventArgs e)
40+
{
41+
var button = (Button)sender;
42+
button.ContextMenu.PlacementTarget = button;
43+
button.ContextMenu.IsOpen = true;
44+
}
3045
}

‎Website/docs/application/ping-monitor.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ You can interact with the chart to inspect past results:
5252

5353
When you zoom or pan, the chart leaves live mode and stops scrolling. A **Live** button then appears in the top-right corner of the chart — click it to return to live mode and resume auto-scrolling.
5454

55+
### Groups
56+
57+
Hosts are grouped by their profile group (or **Hosts** if none is set). Each group header shows a live count of hosts that are up, down and paused (**Paused** is only shown while at least one host in the group is paused).
58+
59+
Click/tap the **⋮** icon on the right of a group header to open its action menu:
60+
61+
| Action | Description |
62+
|--------|-------------|
63+
| **Start** | Starts every host in the group that isn't currently running |
64+
| **Pause** | Pauses every host in the group that's currently running |
65+
| **Close** | Stops and removes every host in the group |
66+
5567
### Context menu
5668

5769
Right-click a monitored host (anywhere except the chart) to open the context menu:

‎Website/docs/changelog/next-release.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ Release date: **xx.xx.2026**
5454

5555
**Ping Monitor**
5656

57-
- Added a live count of hosts up/down (and paused, if any) per group, next to the group's close button. [#3572](https://github.com/BornToBeRoot/NETworkManager/pull/3572)
57+
- Added a live count of hosts up/down (and paused, if any) to each group header. [#3572](https://github.com/BornToBeRoot/NETworkManager/pull/3572)
58+
- Added **Start** and **Pause** actions to each group header (next to the existing **Close**), to start every paused host in the group or pause every running one at once. Click/tap the **⋮** icon to open the group's action menu. [#3575](https://github.com/BornToBeRoot/NETworkManager/pull/3575)
5859
- Reworked each monitored host's card: the collapsed quick info now shows labeled values (`Received: X · Lost: Y · Packet loss: Z%`) instead of unlabeled numbers, the expanded view shows only the latency chart (with more room, since Hostname/IP address are already visible in the header) and the last status change time moved to a tooltip on the connectivity icon. The **Status change** field was also renamed to **Last status change**. [#3572](https://github.com/BornToBeRoot/NETworkManager/pull/3572)
5960
- Host input now accepts newline-separated hosts (one per line, e.g. a column pasted from Excel), converted automatically to the semicolon-separated form. [#3568](https://github.com/BornToBeRoot/NETworkManager/pull/3568)
6061
- Host input now supports shorthand IPv4 ranges like `192.168.0.1-100`, in addition to the existing `192.168.0.0-192.168.0.100` and `192.168.[0-100].1` range formats. [#3568](https://github.com/BornToBeRoot/NETworkManager/pull/3568)

0 commit comments

Comments
 (0)