47 writes to Id
Aspire.Dashboard (41)
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)
61new SelectViewModel<string> { Id = DashboardUIHelpers.PlaintextFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogPlaintextFormat)] }, 62new SelectViewModel<string> { Id = DashboardUIHelpers.JsonFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogJsonFormat)] }, 63new SelectViewModel<string> { Id = DashboardUIHelpers.XmlFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogXmlFormat)] }
Components\Pages\ConsoleLogs.razor.cs (3)
186_allResource = new() { Id = null, Name = ControlsStringsLoc[nameof(ControlsStrings.LabelAll)] }; 672Id = ResourceTypeDetails.CreateResourceGrouping(resourceName, true), 710Id = 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)
201Id = null, 207new SelectViewModel<LogLevel?> { Id = null, Name = ControlsStringsLoc[nameof(Dashboard.Resources.ControlsStrings.LabelAll)] }, 208new SelectViewModel<LogLevel?> { Id = LogLevel.Trace, Name = "Trace" }, 209new SelectViewModel<LogLevel?> { Id = LogLevel.Debug, Name = "Debug" }, 210new SelectViewModel<LogLevel?> { Id = LogLevel.Information, Name = "Information" }, 211new SelectViewModel<LogLevel?> { Id = LogLevel.Warning, Name = "Warning" }, 212new SelectViewModel<LogLevel?> { Id = LogLevel.Error, Name = "Error" }, 213new SelectViewModel<LogLevel?> { Id = LogLevel.Critical, Name = "Critical" },
Components\Pages\Traces.razor.cs (1)
182_allResource = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = ControlsStringsLoc[name: nameof(ControlsStrings.LabelAll)] };
Model\Interaction\InputViewModel.cs (1)
44.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 (8)
68new() { Id = null, Name = loc[nameof(ControlsStrings.LabelAll)] }, 69new() { Id = Http, Name = loc[nameof(ControlsStrings.SpanTypeHttp)] }, 70new() { Id = Database, Name = loc[nameof(ControlsStrings.SpanTypeDatabase)] }, 71new() { Id = Messaging, Name = loc[nameof(ControlsStrings.SpanTypeMessaging)] }, 72new() { Id = Rpc, Name = loc[nameof(ControlsStrings.SpanTypeRpc)] }, 73new() { Id = GenAI, Name = loc[nameof(ControlsStrings.SpanTypeGenAI)] }, 74new() { Id = Cloud, Name = loc[nameof(ControlsStrings.SpanTypeCloud)] }, 75new() { Id = Other, Name = loc[nameof(ControlsStrings.LabelOther)] },
Aspire.Dashboard.Tests (6)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (4)
27var allResourceViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = allResourceText }; 70var allResourceViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = allResourceText }; 151var allResourceViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = allResourceText }; 184var 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") }
133 references to Id
Aspire.Dashboard (54)
Components\Controls\ClearSignalsButton.razor.cs (3)
47OnClick = () => HandleClearSignal(SelectedResource.Id?.GetResourceKey()), 48IsDisabled = SelectedResource.Id == null, 49Text = 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) 168filter.Field = _formModel.Parameter!.Id!; 169filter.Condition = _formModel.Condition!.Id; 178Field = _formModel.Parameter!.Id!, 179Condition = _formModel.Condition!.Id,
Components\Pages\ConsoleLogs.razor.cs (5)
194var selectedResourceName = PageViewModel.SelectedResource.Id?.InstanceId; 369var selectedResourceName = PageViewModel.SelectedResource.Id?.InstanceId; 524var name = PageViewModel?.SelectedResource.Id?.InstanceId; 876if (string.Equals(PageViewModel.SelectedResource.Id?.InstanceId, resource.Name, StringComparisons.ResourceName)) 904: 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 (10)
236var application = _resources?.SingleOrDefault(a => a.ResourceKey == PageViewModel.SelectedResource.Id?.GetResourceKey()); 299if (_logsSubscription is null || _logsSubscription.ResourceKey != PageViewModel.SelectedResource.Id?.GetResourceKey()) 302_logsSubscription = TelemetryRepository.OnNewLogs(PageViewModel.SelectedResource.Id?.GetResourceKey(), SubscriptionType.Read, async () => 370PropertyKeys = TelemetryRepository.GetLogPropertyKeys(PageViewModel.SelectedResource.Id?.GetResourceKey()), 504LogLevelText = PageViewModel.SelectedLogLevel.Id?.ToString().ToLowerInvariant(), 505SelectedResource = PageViewModel.SelectedResource.Id is not null ? PageViewModel.SelectedResource.Name : null, 513ViewModel.ResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 517PageViewModel.SelectedLogLevel = _logLevels.SingleOrDefault(e => e.Id == logLevel) ?? _logLevels[0]; 524ViewModel.LogLevel = PageViewModel.SelectedLogLevel.Id; 651new ComponentTelemetryProperty(TelemetryPropertyKeys.StructuredLogsSelectedLogLevel, new AspireTelemetryProperty(PageViewModel.SelectedLogLevel.Id?.ToString() ?? string.Empty, AspireTelemetryPropertyType.UserSetting)),
Components\Pages\TraceDetail.razor.cs (1)
198if (viewModel.MatchesFilter(_filter, _selectedSpanType.Id?.Filter, GetResourceName, out var matchedDescendents))
Components\Pages\Traces.razor.cs (9)
201TracesViewModel.ResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 231var selectedResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 312TracesViewModel.ResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 314viewModel.SelectedSpanType = _spanTypes.SingleOrDefault(t => t.Id?.Name == SpanTypeText) ?? _spanTypes[0]; 315TracesViewModel.SpanType = viewModel.SelectedSpanType.Id; 348SelectedResource = PageViewModel.SelectedResource.Id is not null ? PageViewModel.SelectedResource.Name : null, 349SelectedSpanType = PageViewModel.SelectedSpanType.Id?.Name, 374PropertyKeys = TelemetryRepository.GetTracePropertyKeys(PageViewModel.SelectedResource.Id?.GetResourceKey()), 438var resource = _resources?.SingleOrDefault(a => a.ResourceKey == PageViewModel.SelectedResource.Id?.GetResourceKey());
Model\Interaction\InputViewModel.cs (1)
53input.Value = optionsVM[0].Id;
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\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)
128cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 160cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource2.Name); 303cut.WaitForState(() => instance.PageViewModel.SelectedResource?.Id?.InstanceId == "test-resource"); 362cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 410cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 459cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 506cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 566cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 625cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 692cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name); 747cut.WaitForState(() => instance.PageViewModel.SelectedResource.Id?.InstanceId == testResource.Name);
Pages\MetricsTests.cs (1)
361Assert.Equal(TimeSpan.FromMinutes(720), viewModel.SelectedDuration.Id);
Aspire.Dashboard.Tests (67)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (24)
38Assert.NotNull(entry.Id); 39Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 40Assert.Equal("App1", entry.Id.InstanceId); 85Assert.NotNull(entry.Id); 86Assert.Equal(OtlpResourceType.ResourceGrouping, entry.Id.Type); 87Assert.Null(entry.Id.InstanceId); 88Assert.Equal("App1", entry.Id.ReplicaSetName); 94Assert.NotNull(entry.Id); 95Assert.Equal(OtlpResourceType.Instance, entry.Id.Type); 96Assert.Equal("App1-r1", entry.Id.InstanceId); 97Assert.Equal("App1", entry.Id.ReplicaSetName); 103Assert.NotNull(entry.Id); 104Assert.Equal(OtlpResourceType.Instance, entry.Id.Type); 105Assert.Equal("App1-r2", entry.Id.InstanceId); 106Assert.Equal("App1", entry.Id.ReplicaSetName); 112Assert.NotNull(entry.Id); 113Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 114Assert.Equal("App2", entry.Id.InstanceId); 120Assert.NotNull(entry.Id); 121Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 122Assert.Equal("App3", entry.Id.InstanceId); 128Assert.NotNull(entry.Id); 129Assert.Equal(OtlpResourceType.Singleton, entry.Id.Type); 130Assert.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)
182var spanType = SpanType.CreateKnownSpanTypes(new TestStringLocalizer<ControlsStrings>()).Single(t => t.Id?.Name == spanTypeName); 183var otherSpanType = SpanType.CreateKnownSpanTypes(new TestStringLocalizer<ControlsStrings>()).Single(t => t.Id?.Name == "other"); 208var result1 = vm.MatchesFilter(string.Empty, typeFilter: spanType.Id?.Filter, a => a.Resource.ResourceName, out _); 217var result2 = vm.MatchesFilter(string.Empty, typeFilter: otherSpanType.Id?.Filter, a => a.Resource.ResourceName, out _);