46 writes to Id
Aspire.Dashboard (40)
Components\Dialogs\FilterDialog.razor.cs (5)
18new SelectViewModel<FilterCondition> { Id = condition, Name = FieldTelemetryFilter.ConditionToString(condition, FilterLoc) }; 54var knownFields = Content.KnownKeys.Select(p => new SelectViewModel<string> { Id = p, Name = FieldTelemetryFilter.ResolveFieldName(p) }).ToList(); 55var customFields = Content.PropertyKeys.Select(p => new SelectViewModel<string> { Id = p, Name = FieldTelemetryFilter.ResolveFieldName(p) }).ToList(); 62new SelectViewModel<string> { Id = null, Name = "-" }, 97.Select(v => new SelectViewModel<FieldValue> { Id = v, Name = v.Value })
Components\Dialogs\TextVisualizerDialog.razor.cs (3)
53new SelectViewModel<string> { Id = DashboardUIHelpers.PlaintextFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogPlaintextFormat)] }, 54new SelectViewModel<string> { Id = DashboardUIHelpers.JsonFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogJsonFormat)] }, 55new SelectViewModel<string> { Id = DashboardUIHelpers.XmlFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogXmlFormat)] }
Components\Pages\ConsoleLogs.razor.cs (3)
160_allResource = new() { Id = null, Name = ControlsStringsLoc[nameof(ControlsStrings.LabelAll)] }; 606Id = ResourceTypeDetails.CreateResourceGrouping(resourceName, true), 644Id = id,
Components\Pages\Metrics.razor.cs (9)
86new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastOneMinute)], Id = TimeSpan.FromMinutes(1) }, 87new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFiveMinutes)], Id = TimeSpan.FromMinutes(5) }, 88new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFifteenMinutes)], Id = TimeSpan.FromMinutes(15) }, 89new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThirtyMinutes)], Id = TimeSpan.FromMinutes(30) }, 90new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastHour)], Id = TimeSpan.FromHours(1) }, 91new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThreeHours)], Id = TimeSpan.FromHours(3) }, 92new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastSixHours)], Id = TimeSpan.FromHours(6) }, 93new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastTwelveHours)], Id = TimeSpan.FromHours(12) }, 98Id = null,
Components\Pages\StructuredLogs.razor.cs (8)
181Id = null, 187new SelectViewModel<LogLevel?> { Id = null, Name = ControlsStringsLoc[nameof(Dashboard.Resources.ControlsStrings.LabelAll)] }, 188new SelectViewModel<LogLevel?> { Id = LogLevel.Trace, Name = "Trace" }, 189new SelectViewModel<LogLevel?> { Id = LogLevel.Debug, Name = "Debug" }, 190new SelectViewModel<LogLevel?> { Id = LogLevel.Information, Name = "Information" }, 191new SelectViewModel<LogLevel?> { Id = LogLevel.Warning, Name = "Warning" }, 192new SelectViewModel<LogLevel?> { Id = LogLevel.Error, Name = "Error" }, 193new SelectViewModel<LogLevel?> { Id = LogLevel.Critical, Name = "Critical" },
Components\Pages\Traces.razor.cs (1)
169_allResource = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = ControlsStringsLoc[name: nameof(ControlsStrings.LabelAll)] };
Model\Interaction\InputViewModel.cs (1)
25.Select(option => new SelectViewModel<string> { Id = option.Key, Name = option.Value, })
Model\Otlp\ResourcesSelectHelpers.cs (3)
95Id = ResourceTypeDetails.CreateSingleton(resource.ResourceKey.ToString(), resourceName), 105Id = ResourceTypeDetails.CreateResourceGrouping(resourceName, isReplicaSet: true), 113Id = ResourceTypeDetails.CreateReplicaInstance(replica.ResourceKey.ToString(), resourceName),
Model\SpanType.cs (7)
64new() { Id = null, Name = loc[nameof(ControlsStrings.LabelAll)] }, 65new() { Id = Http, Name = loc[nameof(ControlsStrings.SpanTypeHttp)] }, 66new() { Id = Database, Name = loc[nameof(ControlsStrings.SpanTypeDatabase)] }, 67new() { Id = Messaging, Name = loc[nameof(ControlsStrings.SpanTypeMessaging)] }, 68new() { Id = Rpc, Name = loc[nameof(ControlsStrings.SpanTypeRpc)] }, 69new() { Id = GenAI, Name = loc[nameof(ControlsStrings.SpanTypeGenAI)] }, 70new() { Id = Other, Name = loc[nameof(ControlsStrings.LabelOther)] },
Aspire.Dashboard.Tests (6)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (4)
28var allResourceViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = allResourceText }; 71var allResourceViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = allResourceText }; 152var allResourceViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = allResourceText }; 185var allResourceViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = allResourceText };
Model\ApplicationsSelectHelpersTests.cs (2)
177new SelectViewModel<ResourceTypeDetails>() { Name = "test", Id = ResourceTypeDetails.CreateSingleton("test-abc", "test") }, 178new SelectViewModel<ResourceTypeDetails>() { Name = "test", Id = ResourceTypeDetails.CreateSingleton("test-def", "test") }
131 references to Id
Aspire.Dashboard (52)
Components\Controls\ClearSignalsButton.razor.cs (3)
48OnClick = () => HandleClearSignal(SelectedResource.Id?.GetResourceKey()), 49IsDisabled = SelectedResource.Id == null, 50Text = SelectedResource.Id == null
Components\Dialogs\FilterDialog.razor.cs (8)
73_formModel.Parameter = _parameters.SingleOrDefault(c => c.Id == filter.Field); 74_formModel.Condition = _filterConditions.Single(c => c.Id == filter.Condition); 80_formModel.Condition = _filterConditions.Single(c => c.Id == FilterCondition.Contains); 90if (_formModel.Parameter?.Id is { } parameterName) 165filter.Field = _formModel.Parameter!.Id!; 166filter.Condition = _formModel.Condition!.Id; 175Field = _formModel.Parameter!.Id!, 176Condition = _formModel.Condition!.Id,
Components\Pages\ConsoleLogs.razor.cs (6)
308var selectedResourceName = PageViewModel.SelectedResource.Id?.InstanceId; 458var name = PageViewModel.SelectedResource.Id?.InstanceId; 798if (PageViewModel.SelectedResource.Id is not null && 800PageViewModel.SelectedResource.Id.GetResourceKey().ToString(), 853if (string.Equals(PageViewModel.SelectedResource.Id?.InstanceId, resource.Name, StringComparisons.ResourceName)) 902: string.Join("_", PageViewModel.SelectedResource.Id!.InstanceId!.Split(Path.GetInvalidFileNameChars()));
Components\Pages\Metrics.razor.cs (9)
105SelectedDuration = _durations.Single(d => d.Id == s_defaultDuration), 132ResourceName = PageViewModel.SelectedResource.Id is not null ? PageViewModel.SelectedResource.Name : null, 135DurationMinutes = (int)PageViewModel.SelectedDuration.Id.TotalMinutes, 150viewModel.SelectedDuration = _durations.SingleOrDefault(d => (int)d.Id.TotalMinutes == DurationMinutes) ?? _durations.Single(d => d.Id == s_defaultDuration); 178var selectedInstance = viewModel.SelectedResource.Id?.GetResourceKey(); 322var selectedResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 358new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsResourceIsReplica, new AspireTelemetryProperty(PageViewModel.SelectedResource.Id?.ReplicaSetName is not null)), 360new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsSelectedDuration, new AspireTelemetryProperty(PageViewModel.SelectedDuration.Id.ToString(), AspireTelemetryPropertyType.UserSetting)),
Components\Pages\StructuredLogs.razor.cs (9)
246if (_logsSubscription is null || _logsSubscription.ResourceKey != PageViewModel.SelectedResource.Id?.GetResourceKey()) 249_logsSubscription = TelemetryRepository.OnNewLogs(PageViewModel.SelectedResource.Id?.GetResourceKey(), SubscriptionType.Read, async () => 309PropertyKeys = TelemetryRepository.GetLogPropertyKeys(PageViewModel.SelectedResource.Id?.GetResourceKey()), 442LogLevelText = PageViewModel.SelectedLogLevel.Id?.ToString().ToLowerInvariant(), 443SelectedResource = PageViewModel.SelectedResource.Id is not null ? PageViewModel.SelectedResource.Name : null, 451ViewModel.ResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 455PageViewModel.SelectedLogLevel = _logLevels.SingleOrDefault(e => e.Id == logLevel) ?? _logLevels[0]; 462ViewModel.LogLevel = PageViewModel.SelectedLogLevel.Id; 556new ComponentTelemetryProperty(TelemetryPropertyKeys.StructuredLogsSelectedLogLevel, new AspireTelemetryProperty(PageViewModel.SelectedLogLevel.Id?.ToString() ?? string.Empty, AspireTelemetryPropertyType.UserSetting)),
Components\Pages\TraceDetail.razor.cs (1)
193if (viewModel.MatchesFilter(_filter, _selectedSpanType.Id?.Filter, GetResourceName, out var matchedDescendents))
Components\Pages\Traces.razor.cs (8)
188TracesViewModel.ResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 216var selectedResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 296TracesViewModel.ResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 298viewModel.SelectedSpanType = _spanTypes.SingleOrDefault(t => t.Id?.Name == SpanTypeText) ?? _spanTypes[0]; 299TracesViewModel.SpanType = viewModel.SelectedSpanType.Id; 332SelectedResource = PageViewModel.SelectedResource.Id is not null ? PageViewModel.SelectedResource.Name : null, 333SelectedSpanType = PageViewModel.SelectedSpanType.Id?.Name, 359PropertyKeys = TelemetryRepository.GetTracePropertyKeys(PageViewModel.SelectedResource.Id?.GetResourceKey()),
Model\Otlp\ResourcesSelectHelpers.cs (4)
17var allowedMatches = resources.Where(e => SupportType(e.Id?.Type, canSelectGrouping)).ToList(); 20var instanceIdMatches = allowedMatches.Where(e => string.Equals(name, e.Id?.InstanceId, StringComparisons.ResourceName)).ToList(); 28var replicaSetMatches = allowedMatches.Where(e => e.Id?.Type != OtlpResourceType.Instance && string.Equals(name, e.Id?.ReplicaSetName, StringComparisons.ResourceName)).ToList();
Model\Otlp\SelectViewModel.cs (4)
29return EqualityComparer<T>.Default.Equals(Id, other.Id); 43return HashCode.Combine(Name, Id); 48return $"Name = {Name}, Id = {{{Id}}}";
Aspire.Dashboard.Components.Tests (12)
Pages\ConsoleLogsTests.cs (11)
134cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 166cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource2.Name); 280cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == regularResource.Name); 320cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 368cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 417cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 464cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 524cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 583cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 650cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 705cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name);
Pages\MetricsTests.cs (1)
360Assert.Equal(TimeSpan.FromMinutes(720), viewModel.SelectedDuration.Id);
Aspire.Dashboard.Tests (67)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (24)
39Assert.NotNull(entry.Id); 40Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 41Assert.Equal("App1", entry.Id.InstanceId); 86Assert.NotNull(entry.Id); 87Assert.Equal(OtlpResourceType.ResourceGrouping, entry.Id.Type); 88Assert.Null(entry.Id.InstanceId); 89Assert.Equal("App1", entry.Id.ReplicaSetName); 95Assert.NotNull(entry.Id); 96Assert.Equal(OtlpResourceType.Instance, entry.Id.Type); 97Assert.Equal("App1-r1", entry.Id.InstanceId); 98Assert.Equal("App1", entry.Id.ReplicaSetName); 104Assert.NotNull(entry.Id); 105Assert.Equal(OtlpResourceType.Instance, entry.Id.Type); 106Assert.Equal("App1-r2", entry.Id.InstanceId); 107Assert.Equal("App1", entry.Id.ReplicaSetName); 113Assert.NotNull(entry.Id); 114Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 115Assert.Equal("App2", entry.Id.InstanceId); 121Assert.NotNull(entry.Id); 122Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 123Assert.Equal("App3", entry.Id.InstanceId); 129Assert.NotNull(entry.Id); 130Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 131Assert.Equal("App4", entry.Id.InstanceId);
Model\ApplicationsSelectHelpersTests.cs (39)
34Assert.Equal(OtlpResourceType.ResourceGrouping, app.Id!.Type); 35Assert.Null(app.Id!.InstanceId); 40Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 41Assert.Equal("multiple-instance", app.Id!.InstanceId); 46Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 47Assert.Equal("multiple-instanceabc", app.Id!.InstanceId); 52Assert.Equal(OtlpResourceType.Singleton, app.Id!.Type); 53Assert.Equal("singleton-instanceabc", app.Id!.InstanceId); 60Assert.Equal("multiple-instanceabc", app.Id!.InstanceId); 61Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 77Assert.Equal("singleton", app.Id!.InstanceId); 78Assert.Equal(OtlpResourceType.Singleton, app.Id!.Type); 94Assert.Equal("singleton-", app.Id!.InstanceId); 95Assert.Equal(OtlpResourceType.Singleton, app.Id!.Type); 132Assert.Equal(OtlpResourceType.ResourceGrouping, app.Id!.Type); 133Assert.Null(app.Id!.InstanceId); 138Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 139Assert.Equal("name-instance", app.Id!.InstanceId); 144Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 145Assert.Equal("NAME-instanceabc", app.Id!.InstanceId); 156Assert.Equal("name-instance", app1.Id!.InstanceId); 157Assert.Equal(OtlpResourceType.Instance, app1.Id!.Type); 164Assert.Equal("NAME-instanceabc", app2.Id!.InstanceId); 165Assert.Equal(OtlpResourceType.Instance, app2.Id!.Type); 188Assert.Equal("test-abc", app.Id!.InstanceId); 189Assert.Equal(OtlpResourceType.Singleton, app.Id!.Type); 207Assert.Equal(OtlpResourceType.ResourceGrouping, app.Id!.Type); 208Assert.Null(app.Id!.InstanceId); 213Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 214Assert.Equal("app-123", app.Id!.InstanceId); 219Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 220Assert.Equal("app-456", app.Id!.InstanceId); 244Assert.Equal(OtlpResourceType.ResourceGrouping, app.Id!.Type); 245Assert.Null(app.Id!.InstanceId); 250Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 251Assert.Equal("app-123", app.Id!.InstanceId); 256Assert.Equal(OtlpResourceType.Instance, app.Id!.Type); 257Assert.Equal("app-456", app.Id!.InstanceId); 265Assert.Equal(OtlpResourceType.ResourceGrouping, app.Id!.Type);
Model\SpanWaterfallViewModelTests.cs (4)
176var spanType = SpanType.CreateKnownSpanTypes(new TestStringLocalizer<ControlsStrings>()).Single(t => t.Id?.Name == spanTypeName); 177var otherSpanType = SpanType.CreateKnownSpanTypes(new TestStringLocalizer<ControlsStrings>()).Single(t => t.Id?.Name == "other"); 202var result1 = vm.MatchesFilter(string.Empty, typeFilter: spanType.Id?.Filter, a => a.Resource.ResourceName, out _); 211var result2 = vm.MatchesFilter(string.Empty, typeFilter: otherSpanType.Id?.Filter, a => a.Resource.ResourceName, out _);