5 instantiations of ResourceViewModel
Aspire.Dashboard (1)
ResourceService\Partials.cs (1)
20return new()
Aspire.Dashboard.Tests (4)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (1)
107return new ResourceViewModel
Integration\Playwright\MockDashboardClient.cs (1)
13public static readonly ResourceViewModel TestResource1 = new()
Model\ResourceEndpointHelpersTests.cs (1)
192return new ResourceViewModel
ResourceOutgoingPeerResolverTests.cs (1)
17return new ResourceViewModel
74 references to ResourceViewModel
Aspire.Dashboard (56)
Components\Controls\ResourceDetails.razor.cs (1)
34private ResourceViewModel? _resource;
Components\Pages\ConsoleLogs.razor.cs (6)
46private readonly ConcurrentDictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName); 139void SetSelectedResourceOption(ResourceViewModel resource) 183ConcurrentDictionary<string, ResourceViewModel> resourcesByName, 220SelectViewModel<ResourceTypeDetails> ToOption(ResourceViewModel resource, bool isReplica, string applicationName) 234var resourceName = ResourceViewModel.GetResourceName(resource, resourcesByName); 315private async Task OnResourceChanged(ResourceViewModelChangeType changeType, ResourceViewModel resource)
Components\Pages\Resources.razor.cs (19)
63private ResourceViewModel? SelectedResource { get; set; } 66private readonly ConcurrentDictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName); 76private bool Filter(ResourceViewModel resource) => _visibleResourceTypes.ContainsKey(resource.ResourceType) && (_filter.Length == 0 || resource.MatchesFilter(_filter)) && !resource.IsHiddenState(); 144private IQueryable<ResourceViewModel>? FilteredResources => _resourceByName.Values.Where(Filter).OrderBy(e => e.ResourceType).ThenBy(e => e.Name).AsQueryable(); 146private readonly GridSort<ResourceViewModel> _nameSort = GridSort<ResourceViewModel>.ByAscending(p => p.Name); 147private readonly GridSort<ResourceViewModel> _stateSort = GridSort<ResourceViewModel>.ByAscending(p => p.State); 148private readonly GridSort<ResourceViewModel> _startTimeSort = GridSort<ResourceViewModel>.ByDescending(p => p.CreationTimeStamp); 251private async Task ShowResourceDetailsAsync(ResourceViewModel resource, string? buttonId) 279private string GetResourceName(ResourceViewModel resource) => ResourceViewModel.GetResourceName(resource, _resourceByName); 281private bool HasMultipleReplicas(ResourceViewModel resource) 304private string GetRowClass(ResourceViewModel resource) 307private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command) 341private static (string Value, string? ContentAfterValue, string ValueToCopy, string Tooltip)? GetSourceColumnValueAndTooltip(ResourceViewModel resource) 371private string GetEndpointsTooltip(ResourceViewModel resource) 396private List<DisplayedEndpoint> GetDisplayedEndpoints(ResourceViewModel resource, out string? additionalMessage)
Components\ResourcesGridColumns\UnreadLogErrorsBadge.razor.cs (1)
32private (string? applicationName, int unviewedErrorCount) GetUnviewedErrorCount(ResourceViewModel resource)
Extensions\ResourceViewModelExtensions.cs (6)
10public static bool IsHiddenState(this ResourceViewModel resource) 15public static bool IsRunningState(this ResourceViewModel resource) 20public static bool IsFinishedState(this ResourceViewModel resource) 25public static bool IsStopped(this ResourceViewModel resource) 30public static bool IsStartingOrBuilding(this ResourceViewModel resource) 35public static bool HasNoState(this ResourceViewModel resource) => string.IsNullOrEmpty(resource.State);
Model\ResourceEndpointHelpers.cs (1)
13public static List<DisplayedEndpoint> GetEndpoints(ResourceViewModel resource, bool includeInternalUrls = false)
Model\ResourceOutgoingPeerResolver.cs (4)
14private readonly ConcurrentDictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName); 33foreach (var resource in snapshot) 67internal static bool TryResolvePeerNameCore(IDictionary<string, ResourceViewModel> resources, KeyValuePair<string, string>[] attributes, out string? name) 105name = ResourceViewModel.GetResourceName(resource, resources);
Model\ResourceViewModel.cs (2)
34public static string GetResourceName(ResourceViewModel resource, IDictionary<string, ResourceViewModel> allResources)
Model\ResourceViewModelExtensions.cs (11)
12public static bool IsContainer(this ResourceViewModel resource) 17public static bool IsProject(this ResourceViewModel resource) 22public static bool IsExecutable(this ResourceViewModel resource, bool allowSubtypes) 37public static bool TryGetExitCode(this ResourceViewModel resource, out int exitCode) 42public static bool TryGetContainerImage(this ResourceViewModel resource, [NotNullWhen(returnValue: true)] out string? containerImage) 47public static bool TryGetProjectPath(this ResourceViewModel resource, [NotNullWhen(returnValue: true)] out string? projectPath) 52public static bool TryGetExecutablePath(this ResourceViewModel resource, [NotNullWhen(returnValue: true)] out string? executablePath) 57public static bool TryGetExecutableArguments(this ResourceViewModel resource, out ImmutableArray<string> arguments) 62private static bool TryGetCustomDataString(this ResourceViewModel resource, string key, [NotNullWhen(returnValue: true)] out string? s) 74private static bool TryGetCustomDataStringArray(this ResourceViewModel resource, string key, out ImmutableArray<string> strings) 99private static bool TryGetCustomDataInt(this ResourceViewModel resource, string key, out int i)
ResourceService\DashboardClient.cs (1)
42private readonly Dictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName);
ResourceService\IDashboardClient.cs (2)
58ImmutableArray<ResourceViewModel> InitialState, 63ResourceViewModel Resource);
ResourceService\Partials.cs (2)
16public ResourceViewModel ToViewModel() 38throw new InvalidOperationException($@"Error converting resource ""{Name}"" to {nameof(ResourceViewModel)}.", ex);
Aspire.Dashboard.Tests (18)
ConsoleLogsTests\CreateResourceSelectModelsTests.cs (3)
20var applications = new List<ResourceViewModel> 36var resourcesByName = new ConcurrentDictionary<string, ResourceViewModel>(applications.ToDictionary(app => app.Name)); 105private static ResourceViewModel CreateResourceViewModel(string appName, KnownResourceState? state, string? displayName = null)
Integration\Playwright\MockDashboardClient.cs (1)
13public static readonly ResourceViewModel TestResource1 = new()
Model\ResourceEndpointHelpersTests.cs (2)
14public static List<DisplayedEndpoint> GetEndpoints(ResourceViewModel resource, bool includeInternalUrls = false) 190private static ResourceViewModel CreateResource(ImmutableArray<UrlViewModel> urls)
Model\ResourceViewModelTests.cs (1)
30var vm = resource.ToViewModel();
ResourceOutgoingPeerResolverTests.cs (11)
15private static ResourceViewModel CreateResource(string name, string? serviceAddress = null, int? servicePort = null, string? displayName = null) 38var resources = new Dictionary<string, ResourceViewModel> 51var resources = new Dictionary<string, ResourceViewModel> 64var resources = new Dictionary<string, ResourceViewModel> 77var resources = new Dictionary<string, ResourceViewModel> 91var resources = new Dictionary<string, ResourceViewModel> 105var resources = new Dictionary<string, ResourceViewModel> 119var resources = new Dictionary<string, ResourceViewModel> 178var resources = new Dictionary<string, ResourceViewModel> 192var resources = new Dictionary<string, ResourceViewModel> 206private static bool TryResolvePeerName(IDictionary<string, ResourceViewModel> resources, KeyValuePair<string, string>[] attributes, out string? peerName)