115 references to Resource
Aspire.Dashboard (50)
Components\Controls\ResourceDetails.razor.cs (4)
194
[KnownProperties.
Resource
.State] = new ComponentMetadata
199
[KnownProperties.
Resource
.DisplayName] = new ComponentMetadata
204
[KnownProperties.
Resource
.HealthState] = new ComponentMetadata
404
|| string.Equals(vm.KnownProperty?.Key, KnownProperties.
Resource
.State, StringComparisons.ResourcePropertyName));
Components\Layout\ResourcesLayout.razor.cs (3)
1662
var parentName = resource.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName);
1790
if (resource.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName) is { Length: > 0 } parentName)
1941
var parentName = resource.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName);
Components\Legacy\Pages\Resources.razor.cs (3)
752
if (current.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName) is { Length: > 0 } value)
879
.Where(r => _resourceByName.Values.Any(nested => nested.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName) == r.Name))
917
return _resourceByName.Values.Any(r => !string.IsNullOrEmpty(r.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName)));
Components\Pages\ResourceOverview.Details.cs (9)
21
KnownProperties.
Resource
.DisplayName,
22
KnownProperties.
Resource
.State,
23
KnownProperties.
Resource
.HealthState,
24
KnownProperties.
Resource
.ResourceTypeDisplayName,
25
KnownProperties.
Resource
.StartTime,
26
KnownProperties.
Resource
.StopTime,
27
KnownProperties.
Resource
.ExitCode,
28
KnownProperties.
Resource
.Source,
35
if (string.Equals(propertyName, KnownProperties.
Resource
.Type, StringComparisons.ResourcePropertyName))
Components\Pages\Resources.razor.cs (3)
791
if (current.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName) is { Length: > 0 } value)
918
.Where(r => _resourceByName.Values.Any(nested => nested.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName) == r.Name))
956
return _resourceByName.Values.Any(r => !string.IsNullOrEmpty(r.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName)));
Model\KnownPropertyLookup.cs (9)
21
new(new(KnownProperties.
Resource
.DisplayName, loc => loc[nameof(ResourcesDetailsDisplayNameProperty)]), KnownResourcePropertySortOrder.DisplayName),
22
new(new(KnownProperties.
Resource
.Type, loc => loc[nameof(ResourcesTypeColumnHeader)]), KnownResourcePropertySortOrder.ResourceType),
23
new(new(KnownProperties.
Resource
.ResourceTypeDisplayName, loc => loc[nameof(ResourcesDetailsResourceTypeDisplayNameProperty)]), KnownResourcePropertySortOrder.ResourceTypeDisplayName),
24
new(new(KnownProperties.
Resource
.State, loc => loc[nameof(ResourcesDetailsStateProperty)]), KnownResourcePropertySortOrder.State),
25
new(new(KnownProperties.
Resource
.HealthState, loc => loc[nameof(ResourcesDetailsHealthStateProperty)]), KnownResourcePropertySortOrder.HealthState),
26
new(new(KnownProperties.
Resource
.StartTime, loc => loc[nameof(ResourcesDetailsStartTimeProperty)]), KnownResourcePropertySortOrder.StartTime),
27
new(new(KnownProperties.
Resource
.StopTime, loc => loc[nameof(ResourcesDetailsStopTimeProperty)]), KnownResourcePropertySortOrder.StopTime),
28
new(new(KnownProperties.
Resource
.ExitCode, loc => loc[nameof(ResourcesDetailsExitCodeProperty)]), KnownResourcePropertySortOrder.ExitCode),
29
new(new(KnownProperties.
Resource
.ConnectionString, loc => loc[nameof(ResourcesDetailsConnectionStringProperty)]), KnownResourcePropertySortOrder.ConnectionString)
Model\ResourceGridViewModel.cs (2)
60
foreach (var childGridVM in initialGridVMs.Where(r => r.Resource.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName) == resource.Name))
75
var parentName = gridViewModel.Resource.GetResourcePropertyValue(KnownProperties.
Resource
.ParentName);
Model\ResourceOutgoingPeerResolver.cs (3)
116
if (!ArePropertyValuesEquivalent(resource1, resource2, KnownProperties.
Resource
.ConnectionString))
121
if (!ArePropertyValuesEquivalent(resource1, resource2, KnownProperties.
Resource
.ConnectionProperties))
254
else if (resource.Properties.ContainsKey(KnownProperties.
Resource
.ConnectionString))
Model\ResourceViewModel.cs (8)
59
Properties.TryGetValue(KnownProperties.
Resource
.TraitPrefix + name, out var property) && property.Value.KindCase == Value.KindOneofCase.ListValue
66
Properties.TryGetValue(KnownProperties.
Resource
.DisplayOrder, out var property) &&
106
if (Properties.TryGetValue(KnownProperties.
Resource
.ConnectionString, out var connectionStringProperty) &&
134
if (Properties.TryGetValue(KnownProperties.
Resource
.ConnectionString, out var connectionStringProperty) &&
146
if (!Properties.TryGetValue(KnownProperties.
Resource
.ConnectionProperties, out var connectionPropertiesProperty) ||
409
KnownProperties.
Resource
.TraitPrefix + KnownResourceTraits.Tag => _loc[nameof(Resources.Resources.ResourceTraitDashboardTags)],
410
KnownProperties.
Resource
.DisplayOrder => _loc[nameof(Resources.Resources.ResourceDisplayOrder)],
491
public bool IsTrait => Name.StartsWith(KnownProperties.
Resource
.TraitPrefix, StringComparison.Ordinal);
Model\ResourceViewModelExtensions.cs (4)
64
return resource.TryGetCustomDataInt(KnownProperties.
Resource
.ExitCode, out exitCode);
94
return resource.TryGetCustomDataStringArray(KnownProperties.
Resource
.AppArgs, out arguments);
99
return resource.TryGetCustomDataBoolArray(KnownProperties.
Resource
.AppArgsSensitivity, out argParams);
130
return resource.TryGetCustomDataStringArray(KnownProperties.
Resource
.WaitingFor, out dependencies) && dependencies.Length > 0;
src\Shared\Model\ResourceSourceViewModel.cs (2)
13
if (properties.TryGetValue(KnownProperties.
Resource
.Source, out var explicitSource) &&
46
if (properties.TryGetValue(KnownProperties.
Resource
.Source, out var source) &&
Aspire.Dashboard.Components.Tests (28)
Controls\ResourceDetailsTests.cs (6)
466
[KnownProperties.
Resource
.WaitingFor] = new(
467
KnownProperties.
Resource
.WaitingFor,
501
[KnownProperties.
Resource
.State] = new ResourcePropertyViewModel(
502
KnownProperties.
Resource
.State,
505
knownProperty: new KnownProperty(KnownProperties.
Resource
.State, _ => Aspire.Dashboard.Resources.Resources.ResourcesDetailsStateProperty),
651
KnownProperties.
Resource
.TraitPrefix + name,
Controls\TerminalDisconnectedBannerTests.cs (4)
40
[KnownProperties.
Resource
.ExitCode] = new(KnownProperties.
Resource
.ExitCode, Value.ForString(exitCode),
121
[KnownProperties.
Resource
.ExitCode] = new(KnownProperties.
Resource
.ExitCode, Value.ForString("42"),
Layout\ResourcesLayoutTests.cs (14)
366
[InlineData("PostgresDatabase", KnownProperties.
Resource
.Source, "catalogdb")]
852
var name = KnownProperties.
Resource
.TraitPrefix + KnownResourceTraits.Tag;
880
var name = KnownProperties.
Resource
.TraitPrefix + KnownResourceTraits.Tag;
1184
[KnownProperties.
Resource
.ParentName] = new(KnownProperties.
Resource
.ParentName, Value.ForString("root"), false, null, 0, null, false)
1188
[KnownProperties.
Resource
.ParentName] = new(KnownProperties.
Resource
.ParentName, Value.ForString("root"), false, null, 0, null, false)
1219
[KnownProperties.
Resource
.ParentName] = new(KnownProperties.
Resource
.ParentName, Value.ForString("root"), false, null, 0, null, false)
1591
var tagKey = KnownProperties.
Resource
.TraitPrefix + KnownResourceTraits.Tag;
1594
[KnownProperties.
Resource
.ParentName] = new(KnownProperties.
Resource
.ParentName, Value.ForString("postgres"), false, null, 0, null, false),
1635
[KnownProperties.
Resource
.ParentName] = new(KnownProperties.
Resource
.ParentName, Value.ForString(parent), false, null, 0, null, false)
Pages\ResourceOverviewTypeDisplayNameTests.cs (2)
81
[KnownProperties.
Resource
.Type] = new(KnownProperties.
Resource
.Type, Value.ForString(resourceType), false, null, 0, null, false)
Pages\ResourcesTests.cs (2)
199
.Add(KnownProperties.
Resource
.ParentName, new ResourcePropertyViewModel(
200
KnownProperties.
Resource
.ParentName,
Aspire.Dashboard.Playwright.Tests (5)
Integration\Playwright\ResourcePaneResponsiveTests.cs (5)
2663
[KnownProperties.
Resource
.ParentName] =
2664
new(KnownProperties.
Resource
.ParentName, Value.ForString(index % 2 == 0 ? "api" : "cache"), false, null, 0, null, false)
2697
var tagKey = KnownProperties.
Resource
.TraitPrefix + KnownResourceTraits.Tag;
2715
properties = properties.Add(KnownProperties.
Resource
.ParentName,
2716
new(KnownProperties.
Resource
.ParentName, Value.ForString(name == "frontend" ? "queue" : "cache"), false, null, 0, null, false));
Aspire.Dashboard.Tests (32)
Model\KnownPropertyLookupTests.cs (2)
16
var (sortOrder, knownProperty) = lookup.FindProperty(KnownProperties.
Resource
.State);
20
Assert.Equal(KnownProperties.
Resource
.State, knownProperty.Key);
Model\ResourceOrderStoreTests.cs (2)
263
[KnownProperties.
Resource
.DisplayOrder] = new(KnownProperties.
Resource
.DisplayOrder, Value.ForString(order.ToString(CultureInfo.InvariantCulture)), false, null, 0, null, false)
Model\ResourceSourceViewModelTests.cs (5)
22
AddStringProperty(KnownProperties.
Resource
.Source, testData.SourceProperty);
31
properties.TryAdd(KnownProperties.
Resource
.AppArgs, new ResourcePropertyViewModel(KnownProperties.
Resource
.AppArgs, Value.ForList(testData.AppArgs.Select(Value.ForString).ToArray()), false, null, 0, displayName: null, isHighlighted: false));
36
properties.TryAdd(KnownProperties.
Resource
.AppArgsSensitivity, new ResourcePropertyViewModel(KnownProperties.
Resource
.AppArgsSensitivity, Value.ForList(testData.AppArgsSensitivity.Select(b => Value.ForNumber(Convert.ToInt32(b))).ToArray()), false, null, 0, displayName: null, isHighlighted: false));
Model\ResourceStateViewModelTests.cs (12)
82
propertiesDictionary.TryAdd(KnownProperties.
Resource
.ExitCode, new ResourcePropertyViewModel(KnownProperties.
Resource
.ExitCode, Value.ForNumber((double)exitCode), false, null, 0, displayName: null, isHighlighted: false));
95
resource.Properties.TryAdd(KnownProperties.
Resource
.ExitCode, new ResourcePropertyViewModel(KnownProperties.
Resource
.ExitCode, Value.ForNumber((double)exitCode), false, null, 0, displayName: null, isHighlighted: false));
119
[KnownProperties.
Resource
.WaitingFor] = new(
120
KnownProperties.
Resource
.WaitingFor,
147
[KnownProperties.
Resource
.WaitingFor] = new(
148
KnownProperties.
Resource
.WaitingFor,
178
[KnownProperties.
Resource
.WaitingFor] = new(
179
KnownProperties.
Resource
.WaitingFor,
206
[KnownProperties.
Resource
.WaitingFor] = new(
207
KnownProperties.
Resource
.WaitingFor,
Model\ResourceTagStoreTests.cs (1)
33
var name = KnownProperties.
Resource
.TraitPrefix + KnownResourceTraits.Tag;
Model\TelemetryExportServiceTests.cs (6)
1398
[KnownProperties.
Resource
.WaitingFor] = new(
1399
KnownProperties.
Resource
.WaitingFor,
1406
[KnownProperties.
Resource
.ConnectionProperties] = new(
1407
KnownProperties.
Resource
.ConnectionProperties,
1433
var waitingForProperty = Assert.IsType<JsonArray>(deserialized.Properties[KnownProperties.
Resource
.WaitingFor]);
1436
var connectionPropertiesObject = Assert.IsType<JsonObject>(deserialized.Properties[KnownProperties.
Resource
.ConnectionProperties]);
ResourceOutgoingPeerResolverTests.cs (4)
583
[KnownProperties.
Resource
.ConnectionString] = new(
584
name: KnownProperties.
Resource
.ConnectionString,
597
properties[KnownProperties.
Resource
.ConnectionProperties] = new(
598
name: KnownProperties.
Resource
.ConnectionProperties,