Implemented interface member:
property
PageViewModel
Aspire.Dashboard.Components.Pages.IPageWithSessionAndUrlState<TViewModel, TSerializableViewModel>.PageViewModel
1 write to PageViewModel
Aspire.Dashboard (1)
Components\Pages\Metrics.razor.cs (1)
102PageViewModel = new MetricsViewModel
69 references to PageViewModel
Aspire.Dashboard (64)
Components\Pages\Metrics.razor.cs (36)
132ResourceName = PageViewModel.SelectedResource.Id is not null ? PageViewModel.SelectedResource.Name : null, 133MeterName = PageViewModel.SelectedMeter?.Name, 134InstrumentName = PageViewModel.SelectedInstrument?.Name, 135DurationMinutes = (int)PageViewModel.SelectedDuration.Id.TotalMinutes, 136ViewKind = PageViewModel.SelectedViewKind?.ToString() 145PageViewModel.SelectedResource = r; 193PageViewModel.SelectedResource = _resourceViewModels.Single(); 201UpdateInstruments(PageViewModel); 205if (PageViewModel.SelectedMeter != null || 206PageViewModel.SelectedInstrument != null) 208if (PageViewModel.Instruments == null || ShouldClearSelectedMetrics(PageViewModel.Instruments)) 210PageViewModel.SelectedMeter = null; 211PageViewModel.SelectedInstrument = null; 225if (PageViewModel.SelectedMeter != null && !instruments.Any(i => i.Parent.Name == PageViewModel.SelectedMeter.Name)) 229if (PageViewModel.SelectedInstrument != null && !instruments.Any(i => i.Name == PageViewModel.SelectedInstrument.Name)) 283if (PageViewModel.SelectedTreeItem?.Data is OtlpScope meter) 285PageViewModel.SelectedMeter = meter; 286PageViewModel.SelectedInstrument = null; 288else if (PageViewModel.SelectedTreeItem?.Data is OtlpInstrumentSummary instrument) 290PageViewModel.SelectedMeter = instrument.Parent; 291PageViewModel.SelectedInstrument = instrument; 295PageViewModel.SelectedMeter = null; 296PageViewModel.SelectedInstrument = null; 316PageViewModel.SelectedViewKind = newView; 322var selectedResourceKey = PageViewModel.SelectedResource.Id?.GetResourceKey(); 335if (PageViewModel.Instruments is null || instruments.Count != PageViewModel.Instruments.Count) 337PageViewModel.Instruments = instruments; 358new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsResourceIsReplica, new AspireTelemetryProperty(PageViewModel.SelectedResource.Id?.ReplicaSetName is not null)), 359new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsInstrumentsCount, new AspireTelemetryProperty((PageViewModel.Instruments?.Count ?? -1).ToString(CultureInfo.InvariantCulture), AspireTelemetryPropertyType.Metric)), 360new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsSelectedDuration, new AspireTelemetryProperty(PageViewModel.SelectedDuration.Id.ToString(), AspireTelemetryPropertyType.UserSetting)), 361new ComponentTelemetryProperty(TelemetryPropertyKeys.MetricsSelectedView, new AspireTelemetryProperty(PageViewModel.SelectedViewKind?.ToString() ?? string.Empty, AspireTelemetryPropertyType.UserSetting))
Components_Pages_Metrics_razor.g.cs (28)
239if (PageViewModel.SelectedResource.Id is { ReplicaSetName: { } replicaSetName }) 241additionalText = PageViewModel.SelectedInstrument is { } selectedInstrument 447PageViewModel.SelectedResource 453__builder2.AddComponentParameter(26, nameof(global::Aspire.Dashboard.Components.Controls.ResourceSelect.SelectedResourceChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Aspire.Dashboard.Model.Otlp.SelectViewModel<Aspire.Dashboard.Model.ResourceTypeDetails>>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Aspire.Dashboard.Model.Otlp.SelectViewModel<Aspire.Dashboard.Model.ResourceTypeDetails>>(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: __value => { PageViewModel.SelectedResource = __value; return global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate(callback: 461); }, value: PageViewModel.SelectedResource), PageViewModel.SelectedResource)))); 536PageViewModel.SelectedResource 691PageViewModel.SelectedDuration 697__builder2.AddComponentParameter(49, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<TimeSpan>>.SelectedOptionChanged), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<SelectViewModel<TimeSpan>>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<SelectViewModel<TimeSpan>>(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredEventCallback(this, global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.CreateInferredBindSetter(callback: __value => { PageViewModel.SelectedDuration = __value; return global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.InvokeAsynchronousDelegate(callback: 705); }, value: PageViewModel.SelectedDuration), PageViewModel.SelectedDuration)))); 706__builder2.AddComponentParameter(50, nameof(global::Microsoft.FluentUI.AspNetCore.Components.FluentSelect<SelectViewModel<TimeSpan>>.SelectedOptionExpression), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Linq.Expressions.Expression<global::System.Func<SelectViewModel<TimeSpan>>>>(() => PageViewModel.SelectedDuration)); 748PageViewModel 824if (PageViewModel.Instruments?.Count > 0) 934PageViewModel 995if (PageViewModel.SelectedResource.Id?.ReplicaSetName != null && PageViewModel is { SelectedMeter: not null, SelectedInstrument: not null }) 1014PageViewModel.SelectedResource.Id.GetResourceKey() 1031PageViewModel.SelectedMeter.Name 1048PageViewModel.SelectedInstrument.Name 1065PageViewModel.SelectedDuration.Id 1082PageViewModel.SelectedViewKind ?? Metrics.MetricViewKind.Graph 1143else if (PageViewModel.SelectedMeter != null) 1155__builder3.AddContent(89, PageViewModel.SelectedMeter.Name 1192PageViewModel.Instruments.Where(i => i.Parent == PageViewModel.SelectedMeter).OrderBy(i => i.Name).AsQueryable() 1246DashboardUrls.MetricsUrl(resource: PageViewModel.SelectedResource.Name, meter: context.Parent.Name, instrument: context.Name, duration: DurationMinutes, view: ViewKindName) 1446else if (PageViewModel.Instruments == null)
Aspire.Dashboard.Components.Tests (5)
Pages\MetricsTests.cs (5)
221cut.WaitForState(() => cut.Instance.PageViewModel.Instruments?.Count == 1); 229foreach (var instrument in cut.Instance.PageViewModel.Instruments!) 266cut.WaitForState(() => cut.Instance.PageViewModel.Instruments?.Count == 3); 274foreach (var instrument in cut.Instance.PageViewModel.Instruments!) 343var viewModel = cut.Instance.PageViewModel;