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