Components\Controls\ResourceDetails.razor.cs (11)
26public required ResourceViewModel Resource { get; set; }
29public required ConcurrentDictionary<string, ResourceViewModel> ResourceByName { get; set; }
61private ResourceViewModel? _resource;
177Parameters = { ["Resource"] = _resource, ["FormatName"] = new Func<ResourceViewModel, string>(FormatName) }
222NavigationManager.NavigateTo(DashboardUrls.ConsoleLogsUrl(ResourceViewModel.GetResourceName(Resource, ResourceByName)));
278foreach (var match in matches)
280items.Add(ResourceDetailRelationshipViewModel.Create(match, ResourceViewModel.GetResourceName(match, ResourceByName), resourceRelationships));
300foreach (var otherResource in otherResources)
306items.Add(ResourceDetailRelationshipViewModel.Create(otherResource, ResourceViewModel.GetResourceName(otherResource, ResourceByName), resourceRelationships));
365private string FormatName(ResourceViewModel resource)
367return 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 (24)
107private ResourceViewModel? SelectedResource { get; set; }
110private readonly ConcurrentDictionary<string, ResourceViewModel> _resourceByName = new(StringComparers.ResourceName);
139private bool Filter(ResourceViewModel resource)
283foreach (var resource in snapshot)
343private bool UpdateFromResource(ResourceViewModel resource)
356private bool UpdateFromResource(ResourceViewModel resource, Func<string, bool> resourceTypeVisible, Func<string, bool> stateVisible, Func<string, bool> healthStatusVisible)
420if (resources._resourceByName.TryGetValue(id, out var resource))
433if (resources._resourceByName.TryGetValue(id, out var resource))
443internal IEnumerable<ResourceViewModel> GetFilteredResources()
548foreach (var resource in GetFilteredResources())
584if (_resourceByName.TryGetValue(ResourceName, out var selectedResource))
618private async Task ShowContextMenuAsync(ResourceViewModel resource, int screenWidth, int screenHeight, int clientX, int clientY)
658private async Task ShowResourceDetailsAsync(ResourceViewModel resource, string? buttonId)
673var current = resource;
728private string GetResourceName(ResourceViewModel resource) => ResourceViewModel.GetResourceName(resource, _resourceByName, _showHiddenResources);
730private bool HasMultipleReplicas(ResourceViewModel resource)
753private string GetRowClass(ResourceViewModel resource)
756private async Task ExecuteResourceCommandAsync(ResourceViewModel resource, CommandViewModel command)
761private static (string? Value, bool IsSensitive, bool IsUnresolved) GetParameterValue(ResourceViewModel resource)
774private static string GetUrlsTooltip(ResourceViewModel resource)
828foreach (var resource in resourcesWithChildren)
835foreach (var resource in resourcesWithChildren)
854private static List<DisplayedUrl> GetDisplayedUrls(ResourceViewModel resource)
Components_Pages_Resources_razor.g.cs (11)
1882), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
1916), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::System.String>)(
1996), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2092), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2586), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2696), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::Aspire.Dashboard.Model.CommandViewModel, global::System.Boolean>)(
2730), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
2747), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::System.String>)(
2781), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Collections.Concurrent.ConcurrentDictionary<global::System.String, global::Aspire.Dashboard.Model.ResourceViewModel>>(
3289), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Aspire.Dashboard.Model.ResourceViewModel>(
3306), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::System.Collections.Concurrent.ConcurrentDictionary<global::System.String, global::Aspire.Dashboard.Model.ResourceViewModel>>(
Model\Assistant\AIHelpers.cs (11)
161internal static string GetResponseGraphJson(List<ResourceViewModel> resources, DashboardOptions options, bool includeDashboardUrl = false, Func<ResourceViewModel, string>? getResourceName = null, bool includeEnvironmentVariables = false)
214static List<object> GetResourceRelationships(List<ResourceViewModel> allResources, ResourceViewModel resourceViewModel, Func<ResourceViewModel, string>? getResourceName)
225foreach (var match in matches)
238static string? GetResourceHealthStatus(ResourceViewModel resource)
253static string? GetReportHealthStatus(ResourceViewModel resource, HealthReportViewModel report)
431public static bool TryGetResource(IReadOnlyList<ResourceViewModel> resources, string resourceName, [NotNullWhen(true)] out ResourceViewModel? resource)
590public static bool IsResourceAIOptOut(ResourceViewModel r)
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)