| Type | @@ -126,7 +128,34 @@ @TargetTypeBadgeLabel(t.TargetType) -@t.Name | +
+ @if (_editingNameId == t.Id)
+ {
+
+ TargetNameEditKey(e, t))" autocomplete="off" data-1p-ignore data-lpignore="true" data-bwignore />
+
+ }
+ else
+ {
+
+ @t.Name
+
+
+
+
+ |
@t.Address |
@if (WanContexts.Count > 0)
{
@@ -704,6 +733,47 @@
await MutateAsync(() => TargetService.SetEnabledAsync(targetId, enabled));
}
+ // Inline rename, as the Sites table does it. The service carries the role and the audit
+ // envelope; the gate here only decides whether the pencil is drawn.
+ private int? _editingNameId;
+ private string _editName = "";
+ private ElementReference _nameInput;
+
+ private async Task StartTargetNameEdit(MonitoringTarget t)
+ {
+ _editingNameId = t.Id;
+ _editName = t.Name;
+ StateHasChanged();
+ await Task.Delay(1); // let the input render before it is focused
+ await _nameInput.FocusAsync();
+ }
+
+ private void CancelTargetNameEdit()
+ {
+ _editingNameId = null;
+ _editName = "";
+ }
+
+ private async Task SaveTargetNameAsync(MonitoringTarget t)
+ {
+ var name = _editName?.Trim();
+ if (string.IsNullOrWhiteSpace(name) || name == t.Name)
+ {
+ CancelTargetNameEdit();
+ return;
+ }
+ await MutateAsync(() => TargetService.SetNameAsync(t.Id, name));
+ // Closed only once it took. A refused name - too long, or a role that cannot rename - kept
+ // its reason under the table while the box it was typed into had already gone.
+ if (_targetError == null) CancelTargetNameEdit();
+ }
+
+ private async Task TargetNameEditKey(KeyboardEventArgs e, MonitoringTarget t)
+ {
+ if (e.Key == "Enter") await SaveTargetNameAsync(t);
+ else if (e.Key == "Escape") CancelTargetNameEdit();
+ }
+
private async Task DeleteTargetAsync(int targetId)
{
await MutateAsync(() => TargetService.DeleteAsync(targetId));
diff --git a/src/NetworkOptimizer.Web/Components/Shared/LiveViewPanel.razor b/src/NetworkOptimizer.Web/Components/Shared/LiveViewPanel.razor
index ef03b97539..c1c5a6526e 100644
--- a/src/NetworkOptimizer.Web/Components/Shared/LiveViewPanel.razor
+++ b/src/NetworkOptimizer.Web/Components/Shared/LiveViewPanel.razor
@@ -36,13 +36,9 @@
}
else
{
- var gwFabricTargetId = GetGatewayFabricTargetId();
- var gwFabricUrl = gwFabricTargetId != null
- ? $"/monitoring?tab=performance&category=Fabric&target={Uri.EscapeDataString(gwFabricTargetId)}"
- : "/monitoring?tab=performance&category=Fabric";
- var gwDeviceUrl = _gatewayMac != null
- ? $"/monitoring?tab=devices&device={Uri.EscapeDataString(_gatewayMac)}"
- : "/monitoring?tab=devices";
+ // Always live: these tiles have no parked instant to carry, unlike the Monitoring tab's own.
+ var gwFabricUrl = FabricTarget(GetGatewayFabricTargetId(), LiveAtToken, LiveWan);
+ var gwDeviceUrl = DeviceStats(_gatewayMac, LiveAtToken);
|---|
@wc.Name |
@@ -862,7 +862,7 @@
///
private static string VerifyUrl(WanContext context) =>
context.AgentId is int id
- ? $"/network-tools?from=agent:{id}"
+ ? $"/network-tools?from=agent:{id}:{context.Id}"
: $"/network-tools?from={NetworkOptimizer.Web.Services.Monitoring.ProbeVantages.ServerKey}";
private string AgentLabel(int? agentId)
@@ -1241,4 +1241,17 @@
try { await ProbeSink.PushProbeConfigToSiteAsync(SiteCtx.Slug); }
catch { }
}
+
+ ///