35 writes to Id
Aspire.Dashboard (32)
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)
99new SelectViewModel<string> { Id = PlaintextFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogPlaintextFormat)] }, 100new SelectViewModel<string> { Id = JsonFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogJsonFormat)] }, 101new SelectViewModel<string> { Id = XmlFormat, Name = Loc[nameof(Resources.Dialogs.TextVisualizerDialogXmlFormat)] }
Components\Pages\ConsoleLogs.razor.cs (3)
131_noSelection = new() { Id = null, Name = ControlsStringsLoc[nameof(ControlsStrings.LabelNone)] }; 411Id = ResourceTypeDetails.CreateApplicationGrouping(applicationName, true), 437Id = id,
Components\Pages\Metrics.razor.cs (9)
83new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastOneMinute)], Id = TimeSpan.FromMinutes(1) }, 84new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFiveMinutes)], Id = TimeSpan.FromMinutes(5) }, 85new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastFifteenMinutes)], Id = TimeSpan.FromMinutes(15) }, 86new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThirtyMinutes)], Id = TimeSpan.FromMinutes(30) }, 87new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastHour)], Id = TimeSpan.FromHours(1) }, 88new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastThreeHours)], Id = TimeSpan.FromHours(3) }, 89new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastSixHours)], Id = TimeSpan.FromHours(6) }, 90new() { Name = Loc[nameof(Dashboard.Resources.Metrics.MetricsLastTwelveHours)], Id = TimeSpan.FromHours(12) }, 95Id = null,
Components\Pages\StructuredLogs.razor.cs (8)
179Id = null, 185new SelectViewModel<LogLevel?> { Id = null, Name = ControlsStringsLoc[nameof(Dashboard.Resources.ControlsStrings.LabelAll)] }, 186new SelectViewModel<LogLevel?> { Id = LogLevel.Trace, Name = "Trace" }, 187new SelectViewModel<LogLevel?> { Id = LogLevel.Debug, Name = "Debug" }, 188new SelectViewModel<LogLevel?> { Id = LogLevel.Information, Name = "Information" }, 189new SelectViewModel<LogLevel?> { Id = LogLevel.Warning, Name = "Warning" }, 190new SelectViewModel<LogLevel?> { Id = LogLevel.Error, Name = "Error" }, 191new SelectViewModel<LogLevel?> { Id = LogLevel.Critical, Name = "Critical" },
Components\Pages\Traces.razor.cs (1)
162_allApplication = new SelectViewModel<ResourceTypeDetails> { Id = null, Name = ControlsStringsLoc[name: nameof(ControlsStrings.LabelAll)] };
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 (3)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (1)
39var 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") }
102 references to Id
Aspire.Dashboard (47)
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 (6)
549if (PageViewModel.SelectedOption.Id is not null && 551PageViewModel.SelectedOption.Id.GetApplicationKey().ToString(), 568PageViewModel.SelectedResource = PageViewModel.SelectedOption?.Id?.InstanceId is null ? null : _resourceByName[PageViewModel.SelectedOption.Id.InstanceId]; 720viewModel.SelectedResource = viewModel.SelectedOption.Id?.InstanceId is null ? null : _resourceByName[viewModel.SelectedOption.Id.InstanceId];
Components\Pages\Metrics.razor.cs (9)
102SelectedDuration = _durations.Single(d => d.Id == s_defaultDuration), 131ApplicationName = PageViewModel.SelectedApplication.Id is not null ? PageViewModel.SelectedApplication.Name : null, 134DurationMinutes = (int)PageViewModel.SelectedDuration.Id.TotalMinutes, 141viewModel.SelectedDuration = _durations.SingleOrDefault(d => (int)d.Id.TotalMinutes == DurationMinutes) ?? _durations.Single(d => d.Id == s_defaultDuration); 163var selectedInstance = viewModel.SelectedApplication.Id?.GetApplicationKey(); 298var selectedApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 334new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsApplicationIsReplica, new AspireTelemetryProperty(PageViewModel.SelectedApplication.Id?.ReplicaSetName is not null)), 336new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsSelectedDuration, new AspireTelemetryProperty(PageViewModel.SelectedDuration.Id.ToString(), AspireTelemetryPropertyType.UserSetting)),
Components\Pages\StructuredLogs.razor.cs (9)
246if (_logsSubscription is null || _logsSubscription.ApplicationKey != PageViewModel.SelectedApplication.Id?.GetApplicationKey()) 249_logsSubscription = TelemetryRepository.OnNewLogs(PageViewModel.SelectedApplication.Id?.GetApplicationKey(), SubscriptionType.Read, async () => 309PropertyKeys = 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(); 203var selectedApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 266TracesViewModel.ApplicationKey = PageViewModel.SelectedApplication.Id?.GetApplicationKey(); 298SelectedApplication = PageViewModel.SelectedApplication.Id is not null ? PageViewModel.SelectedApplication.Name : null, 324PropertyKeys = 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 (3)
29return EqualityComparer<T>.Default.Equals(Id, other.Id); 34return $"Name = {Name}, Id = {{{Id}}}";
Aspire.Dashboard.Components.Tests (1)
Pages\MetricsTests.cs (1)
298Assert.Equal(TimeSpan.FromMinutes(720), viewModel.SelectedDuration.Id);
Aspire.Dashboard.Tests (54)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (21)
52Assert.NotNull(entry.Id); 53Assert.Equal(OtlpApplicationType.ResourceGrouping, entry.Id.Type); 54Assert.Null(entry.Id.InstanceId); 55Assert.Equal("App1", entry.Id.ReplicaSetName); 61Assert.NotNull(entry.Id); 62Assert.Equal(OtlpApplicationType.Instance, entry.Id.Type); 63Assert.Equal("App1-r1", entry.Id.InstanceId); 64Assert.Equal("App1", entry.Id.ReplicaSetName); 70Assert.NotNull(entry.Id); 71Assert.Equal(OtlpApplicationType.Instance, entry.Id.Type); 72Assert.Equal("App1-r2", entry.Id.InstanceId); 73Assert.Equal("App1", entry.Id.ReplicaSetName); 79Assert.NotNull(entry.Id); 80Assert.Equal(OtlpApplicationType.Singleton, entry.Id.Type); 81Assert.Equal("App2", entry.Id.InstanceId); 87Assert.NotNull(entry.Id); 88Assert.Equal(OtlpApplicationType.Singleton, entry.Id.Type); 89Assert.Equal("App3", entry.Id.InstanceId); 95Assert.NotNull(entry.Id); 96Assert.Equal(OtlpApplicationType.Singleton, entry.Id.Type); 97Assert.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);