37 writes to Id
Aspire.Dashboard (33)
Components\Dialogs\FilterDialog.razor.cs (5)
18new SelectViewModel<FilterCondition> { Id = condition, Name = TelemetryFilter.ConditionToString(condition, FilterLoc) }; 54var knownFields = Content.KnownKeys.Select(p => new SelectViewModel<string> { Id = p, Name = TelemetryFilter.ResolveFieldName(p) }).ToList(); 55var customFields = Content.PropertyKeys.Select(p => new SelectViewModel<string> { Id = p, Name = TelemetryFilter.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)
107new SelectViewModel<string> { Id = PlaintextFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogPlaintextFormat)] }, 108new SelectViewModel<string> { Id = JsonFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogJsonFormat)] }, 109new SelectViewModel<string> { Id = XmlFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogXmlFormat)] }
Components\Pages\ConsoleLogs.razor.cs (3)
134_noSelection = new() { Id = null, Name = ControlsStringsLoc[nameof(ControlsStrings.LabelNone)] }; 462Id = ResourceTypeDetails.CreateApplicationGrouping(applicationName, true), 499Id = 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)
180Id = null, 186new SelectViewModel<LogLevel?> { Id = null, Name = ControlsStringsLoc[nameof(Dashboard.Resources.ControlsStrings.LabelAll)] }, 187new SelectViewModel<LogLevel?> { Id = LogLevel.Trace, Name = "Trace" }, 188new SelectViewModel<LogLevel?> { Id = LogLevel.Debug, Name = "Debug" }, 189new SelectViewModel<LogLevel?> { Id = LogLevel.Information, Name = "Information" }, 190new SelectViewModel<LogLevel?> { Id = LogLevel.Warning, Name = "Warning" }, 191new SelectViewModel<LogLevel?> { Id = LogLevel.Error, Name = "Error" }, 192new SelectViewModel<LogLevel?> { Id = LogLevel.Critical, Name = "Critical" },
Components\Pages\Traces.razor.cs (1)
164_allApplication = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = ControlsStringsLoc[name: nameof(ControlsStrings.LabelAll)] };
Model\InputViewModel.cs (1)
25.Select(option => new SelectViewModel<string> { Id = option.Key, Name = option.Value, })
Model\Otlp\ApplicationsSelectHelpers.cs (3)
80Id = ResourceTypeDetails.CreateSingleton($"{applicationName}-{app.InstanceId}", applicationName), 90Id = ResourceTypeDetails.CreateApplicationGrouping(applicationName, isReplicaSet: true), 98Id = ResourceTypeDetails.CreateReplicaInstance($"{applicationName}-{replica.InstanceId}", applicationName),
Aspire.Dashboard.Tests (4)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (2)
28var noSelectionViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = selectAResourceText }; 71var noSelectionViewModel = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = selectAResourceText };
Model\ApplicationsSelectHelpersTests.cs (2)
114new SelectViewModel<ResourceTypeDetails>() { Name = "test", Id = ResourceTypeDetails.CreateSingleton("test-abc", "test") }, 115new SelectViewModel<ResourceTypeDetails>() { Name = "test", Id = ResourceTypeDetails.CreateSingleton("test-def", "test") }
108 references to Id
Aspire.Dashboard (50)
Components\Controls\ClearSignalsButton.razor.cs (3)
48OnClick = () => HandleClearSignal(SelectedResource.Id?.GetApplicationKey()), 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 (8)
528Debug.Assert(optionToSelect.Id?.InstanceId is not null); 530PageViewModel.SelectedResource = _resourceByName[optionToSelect.Id.InstanceId]; 632if (PageViewModel.SelectedOption.Id is not null && 634PageViewModel.SelectedOption.Id.GetApplicationKey().ToString(), 651PageViewModel.SelectedResource = PageViewModel.SelectedOption?.Id?.InstanceId is null ? null : _resourceByName[PageViewModel.SelectedOption.Id.InstanceId]; 805viewModel.SelectedResource = viewModel.SelectedOption.Id?.InstanceId is null ? null : _resourceByName[viewModel.SelectedOption.Id.InstanceId];
Components\Pages\Metrics.razor.cs (9)
105SelectedDuration = _durations.Single(d => d.Id == s_defaultDuration), 132ApplicationName = PageViewModel.SelectedApplication.Id is not null ? PageViewModel.SelectedApplication.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.SelectedApplication.Id?.GetApplicationKey(); 322var selectedApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 358new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsApplicationIsReplica, new AspireTelemetryProperty(PageViewModel.SelectedApplication.Id?.ReplicaSetName is not null)), 360new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsSelectedDuration, new AspireTelemetryProperty(PageViewModel.SelectedDuration.Id.ToString(), AspireTelemetryPropertyType.UserSetting)),
Components\Pages\StructuredLogs.razor.cs (9)
245if (_logsSubscription is null || _logsSubscription.ApplicationKey != PageViewModel.SelectedApplication.Id?.GetApplicationKey()) 248_logsSubscription = TelemetryRepository.OnNewLogs(PageViewModel.SelectedApplication.Id?.GetApplicationKey(), SubscriptionType.Read, async () => 308PropertyKeys = TelemetryRepository.GetLogPropertyKeys(PageViewModel.SelectedApplication.Id?.GetApplicationKey()), 434LogLevelText = PageViewModel.SelectedLogLevel.Id?.ToString().ToLowerInvariant(), 435SelectedApplication = PageViewModel.SelectedApplication.Id is not null ? PageViewModel.SelectedApplication.Name : null, 443ViewModel.ApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 447PageViewModel.SelectedLogLevel = _logLevels.SingleOrDefault(e => e.Id == logLevel) ?? _logLevels[0]; 454ViewModel.LogLevel = PageViewModel.SelectedLogLevel.Id; 498new ComponentTelemetryProperty(TelemetryPropertyKeys.StructuredLogsSelectedLogLevel, new AspireTelemetryProperty(PageViewModel.SelectedLogLevel.Id?.ToString() ?? string.Empty, AspireTelemetryPropertyType.UserSetting)),
Components\Pages\Traces.razor.cs (5)
182TracesViewModel.ApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 204var selectedApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 277TracesViewModel.ApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 309SelectedApplication = PageViewModel.SelectedApplication.Id is not null ? PageViewModel.SelectedApplication.Name : null, 335PropertyKeys = TelemetryRepository.GetTracePropertyKeys(PageViewModel.SelectedApplication.Id?.GetApplicationKey()),
Model\Otlp\ApplicationsSelectHelpers.cs (4)
17var allowedMatches = applications.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 != OtlpApplicationType.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 (1)
Pages\MetricsTests.cs (1)
360Assert.Equal(TimeSpan.FromMinutes(720), viewModel.SelectedDuration.Id);
Aspire.Dashboard.Tests (57)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (24)
39Assert.NotNull(entry.Id); 40Assert.Equal(OtlpApplicationType.Singleton, entry.Id.Type); 41Assert.Equal("App1", entry.Id.InstanceId); 87Assert.NotNull(entry.Id); 88Assert.Equal(OtlpApplicationType.ResourceGrouping, entry.Id.Type); 89Assert.Null(entry.Id.InstanceId); 90Assert.Equal("App1", entry.Id.ReplicaSetName); 96Assert.NotNull(entry.Id); 97Assert.Equal(OtlpApplicationType.Instance, entry.Id.Type); 98Assert.Equal("App1-r1", entry.Id.InstanceId); 99Assert.Equal("App1", entry.Id.ReplicaSetName); 105Assert.NotNull(entry.Id); 106Assert.Equal(OtlpApplicationType.Instance, entry.Id.Type); 107Assert.Equal("App1-r2", entry.Id.InstanceId); 108Assert.Equal("App1", entry.Id.ReplicaSetName); 114Assert.NotNull(entry.Id); 115Assert.Equal(OtlpApplicationType.Singleton, entry.Id.Type); 116Assert.Equal("App2", entry.Id.InstanceId); 122Assert.NotNull(entry.Id); 123Assert.Equal(OtlpApplicationType.Singleton, entry.Id.Type); 124Assert.Equal("App3", entry.Id.InstanceId); 130Assert.NotNull(entry.Id); 131Assert.Equal(OtlpApplicationType.Singleton, entry.Id.Type); 132Assert.Equal("App4", entry.Id.InstanceId);
Model\ApplicationsSelectHelpersTests.cs (33)
34Assert.Equal(OtlpApplicationType.ResourceGrouping, app.Id!.Type); 35Assert.Null(app.Id!.InstanceId); 40Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 41Assert.Equal("multiple-instance", app.Id!.InstanceId); 46Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 47Assert.Equal("multiple-instanceabc", app.Id!.InstanceId); 52Assert.Equal(OtlpApplicationType.Singleton, app.Id!.Type); 53Assert.Equal("singleton-instanceabc", app.Id!.InstanceId); 60Assert.Equal("multiple-instanceabc", app.Id!.InstanceId); 61Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 78Assert.Equal(OtlpApplicationType.ResourceGrouping, app.Id!.Type); 79Assert.Null(app.Id!.InstanceId); 84Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 85Assert.Equal("name-instance", app.Id!.InstanceId); 90Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 91Assert.Equal("name-instanceabc", app.Id!.InstanceId); 101Assert.Equal("name-instance", app.Id!.InstanceId); 102Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 125Assert.Equal("test-abc", app.Id!.InstanceId); 126Assert.Equal(OtlpApplicationType.Singleton, app.Id!.Type); 144Assert.Equal(OtlpApplicationType.ResourceGrouping, app.Id!.Type); 145Assert.Null(app.Id!.InstanceId); 150Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 151Assert.Equal("app-123", app.Id!.InstanceId); 156Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 157Assert.Equal("app-456", app.Id!.InstanceId); 181Assert.Equal(OtlpApplicationType.ResourceGrouping, app.Id!.Type); 182Assert.Null(app.Id!.InstanceId); 187Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 188Assert.Equal("app-123", app.Id!.InstanceId); 193Assert.Equal(OtlpApplicationType.Instance, app.Id!.Type); 194Assert.Equal("app-456", app.Id!.InstanceId); 202Assert.Equal(OtlpApplicationType.ResourceGrouping, app.Id!.Type);