Components\Controls\ResourceDetails.razor.cs (10)
24public required ResourceViewModel Resource { get; set; }
27public required ConcurrentDictionary<string, ResourceViewModel> ResourceByName { get; set; }
59private ResourceViewModel? _resource;
171Parameters = { ["Resource"] = _resource, ["FormatName"] = new Func<ResourceViewModel, string>(FormatName) }
220foreach (var match in matches)
222items.Add(ResourceDetailRelationshipViewModel.Create(match, ResourceViewModel.GetResourceName(match, ResourceByName), resourceRelationships));
242foreach (var otherResource in otherResources)
248items.Add(ResourceDetailRelationshipViewModel.Create(otherResource, ResourceViewModel.GetResourceName(otherResource, ResourceByName), resourceRelationships));
307private string FormatName(ResourceViewModel resource)
309return ResourceViewModel.GetResourceName(resource, ResourceByName);
Components\Pages\ConsoleLogs.razor.cs (23)
40public ResourceViewModel Resource { get; }
47public ConsoleLogsSubscription(ResourceViewModel resource, ILogger logger)
143private readonly ConcurrentDictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName);
248foreach (var resource in snapshot)
259if (ResourceViewModel.TryGetResourceByName(ResourceName, _resourceByName, out var selectedResource))
301void SetSelectedResourceOption(ResourceViewModel resource)
410else if (selectedResourceName is not null && _resourceByName.TryGetValue(selectedResourceName, out var resource))
449var selectedResource = GetSelectedResource();
527private ResourceViewModel? GetSelectedResource()
534_resourceByName.TryGetValue(name, out var resource);
561var selectedResource = GetSelectedResource();
618foreach (var resource in availableResources)
626private Task SubscribeToSingleResourceAsync(ResourceViewModel resource)
653private string GetResourceName(ResourceViewModel resource) => ResourceViewModel.GetResourceName(resource, _resourceByName);
656ConcurrentDictionary<string, ResourceViewModel> resourcesByName,
686foreach (var resource in grouping.Select(g => g.Value).OrderBy(r => r, ResourceViewModelNameComparer.Instance))
707SelectViewModel<ResourceTypeDetails> ToOption(ResourceViewModel resource, bool isReplica, string resourceName)
721var resourceName = ResourceViewModel.GetResourceName(resource, resourcesByName);
785var resourcePrefix = ResourceViewModel.GetResourceName(subscription.Resource, _resourceByName, _showHiddenResources);
866private async Task OnResourceChanged(ResourceViewModelChangeType changeType, ResourceViewModel resource)
1059ResourceViewModel? TryGetSingleResource()
Components\Pages\Resources.razor.cs (22)
106private ResourceViewModel? SelectedResource { get; set; }
109private readonly ConcurrentDictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName);
138private bool Filter(ResourceViewModel resource)
269foreach (var resource in snapshot)
329private bool UpdateFromResource(ResourceViewModel resource)
342private bool UpdateFromResource(ResourceViewModel resource, Func<string, bool> resourceTypeVisible, Func<string, bool> stateVisible, Func<string, bool> healthStatusVisible)
406if (resources._resourceByName.TryGetValue(id, out var resource))
419if (resources._resourceByName.TryGetValue(id, out var resource))
429internal IEnumerable<ResourceViewModel> GetFilteredResources()
568if (_resourceByName.TryGetValue(ResourceName, out var selectedResource))
602private async Task ShowContextMenuAsync(ResourceViewModel resource, int screenWidth, int screenHeight, int clientX, int clientY)
642private async Task ShowResourceDetailsAsync(ResourceViewModel resource, string? buttonId)
657var current = resource;
702private string GetResourceName(ResourceViewModel resource) => ResourceViewModel.GetResourceName(resource, _resourceByName, _showHiddenResources);
704private bool HasMultipleReplicas(ResourceViewModel resource)
727private string GetRowClass(ResourceViewModel resource)
730private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
735private static string GetUrlsTooltip(ResourceViewModel resource)
789foreach (var resource in resourcesWithChildren)
796foreach (var resource in resourcesWithChildren)
815private static List<DisplayedUrl> GetDisplayedUrls(ResourceViewModel resource)
Components_Pages_Resources_razor.g.cs (11)
1795), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
1829), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::System.String>)(
1909), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2005), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2309), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2419), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::Aspire.Dashboard.Model.CommandViewModel, global::System.Boolean>)(
2453), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2470), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::System.String>)(
2504), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Collections.Concurrent.ConcurrentDictionary<global::System.String, global::Aspire.Dashboard.Model.ResourceViewModel>>(
3012), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
3029), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Collections.Concurrent.ConcurrentDictionary<global::System.String, global::Aspire.Dashboard.Model.ResourceViewModel>>(
Model\ResourceMenuItems.cs (8)
31ResourceViewModel resource,
35Func<ResourceViewModel, string> getResourceName,
43Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting,
96private static void AddUrlMenuItems(List<MenuButtonItem> menuItems, ResourceViewModel resource, IStringLocalizer<Resources.Resources> loc)
153private static void AddTelemetryMenuItems(List<MenuButtonItem> menuItems, ResourceViewModel resource, NavigationManager navigationManager, TelemetryRepository telemetryRepository, Func<ResourceViewModel, string> getResourceName, IStringLocalizer<Resources.Resources> loc)
205private static void AddCommandMenuItems(List<MenuButtonItem> menuItems, ResourceViewModel resource, IStringLocalizer<Resources.Resources> loc, IStringLocalizer<Commands> commandsLoc, EventCallback<CommandViewModel> commandSelected, Func<ResourceViewModel, CommandViewModel, bool> isCommandExecuting, IconResolver iconResolver)
Model\ResourceOutgoingPeerResolver.cs (13)
21private readonly ConcurrentDictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName);
40foreach (var resource in snapshot)
57if (!_resourceByName.TryGetValue(resource.Name, out var existingResource) ||
82private static bool ArePeerRelevantPropertiesEquivalent(ResourceViewModel resource1, ResourceViewModel resource2)
127private static bool ArePropertyValuesEquivalent(ResourceViewModel resource1, ResourceViewModel resource2, string propertyName)
151public bool TryResolvePeer(KeyValuePair<string, string>[] attributes, out string? name, out ResourceViewModel? matchedResource)
156internal static bool TryResolvePeerCore(IDictionary<string, ResourceViewModel> resources, KeyValuePair<string, string>[] attributes, [NotNullWhen(true)] out string? name, [NotNullWhen(true)] out ResourceViewModel? resourceMatch)
191private static bool TryMatchAgainstResources(string peerAddress, IDictionary<string, ResourceViewModel> resources, [NotNullWhen(true)] out string? name, [NotNullWhen(true)] out ResourceViewModel? resourceMatch)
199name = ResourceViewModel.GetResourceName(resource, resources);
Model\ResourceViewModelExtensions.cs (14)
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)
62public static bool TryGetAppArgs(this ResourceViewModel resource, out ImmutableArray<string> arguments)
67public static bool TryGetAppArgsSensitivity(this ResourceViewModel resource, out ImmutableArray<bool> argParams)
72private static bool TryGetCustomDataString(this ResourceViewModel resource, string key, [NotNullWhen(returnValue: true)] out string? s)
84private static bool TryGetCustomDataStringArray(this ResourceViewModel resource, string key, out ImmutableArray<string> strings)
109private static bool TryGetCustomDataBoolArray(this ResourceViewModel resource, string key, out ImmutableArray<bool> bools)
134private static bool TryGetCustomDataInt(this ResourceViewModel resource, string key, out int i)