3 instantiations of CommandViewModel
Aspire.Dashboard (1)
ServiceClient\Partials.cs (1)
120
.Select(c => new
CommandViewModel
(c.Name, MapState(c.State), c.DisplayName, c.DisplayDescription, c.ConfirmationMessage, c.Parameter, c.IsHighlighted, c.IconName, MapIconVariant(c.IconVariant)))
Aspire.Dashboard.Components.Tests (2)
Pages\ConsoleLogsTests.cs (2)
593
commands: [new
CommandViewModel
("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", parameter: null, isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]);
657
commands: [new
CommandViewModel
("test-name", CommandViewModelState.Enabled, "test-displayname", "test-displaydescription", confirmationMessage: "", parameter: null, isHighlighted: true, iconName: string.Empty, iconVariant: IconVariant.Regular)]);
46 references to CommandViewModel
Aspire.Dashboard (35)
Components\Controls\ResourceActions.razor.cs (3)
36
public required EventCallback<
CommandViewModel
> CommandSelected { get; set; }
39
public required Func<ResourceViewModel,
CommandViewModel
, bool> IsCommandExecuting { get; set; }
56
private readonly List<
CommandViewModel
> _highlightedCommands = new();
Components\Controls\ResourceDetails.razor.cs (2)
38
public required EventCallback<
CommandViewModel
> CommandSelected { get; set; }
41
public required Func<ResourceViewModel,
CommandViewModel
, bool> IsCommandExecuting { get; set; }
Components\Pages\ConsoleLogs.razor.cs (3)
166
private readonly List<
CommandViewModel
> _highlightedCommands = new();
514
EventCallback.Factory.Create<
CommandViewModel
>(this, ExecuteResourceCommandAsync),
554
private async Task ExecuteResourceCommandAsync(
CommandViewModel
command)
Components\Pages\Resources.razor.cs (3)
566
foreach (
var
command in resource.Commands)
648
EventCallback.Factory.Create<
CommandViewModel
>(this, (command) => ExecuteResourceCommandAsync(resource, command)),
765
private async Task ExecuteResourceCommandAsync(ResourceViewModel resource,
CommandViewModel
command)
Components_Controls_ResourceActions_razor.g.cs (1)
228
var
highlightedCommand = _highlightedCommands[i];
Components_Pages_ConsoleLogs_razor.g.cs (1)
543
foreach (
var
command in _highlightedCommands)
Components_Pages_Resources_razor.g.cs (6)
2679
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Aspire.Dashboard.Model.
CommandViewModel
>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Aspire.Dashboard.Model.
CommandViewModel
>(this,
2696
), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::Aspire.Dashboard.Model.
CommandViewModel
, global::System.Boolean>)(
3339
), global::Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck<global::Microsoft.AspNetCore.Components.EventCallback<global::Aspire.Dashboard.Model.
CommandViewModel
>>(global::Microsoft.AspNetCore.Components.EventCallback.Factory.Create<global::Aspire.Dashboard.Model.
CommandViewModel
>(this,
3356
), (global::System.Func<global::Aspire.Dashboard.Model.ResourceViewModel, global::Aspire.Dashboard.Model.
CommandViewModel
, global::System.Boolean>)(
Mcp\AspireResourceMcpTools.cs (1)
155
var
command = resource.Commands.FirstOrDefault(c => string.Equals(c.Name, commandName, StringComparisons.CommandName));
Model\DashboardCommandExecutor.cs (2)
33
public async Task ExecuteAsync(ResourceViewModel resource,
CommandViewModel
command, Func<ResourceViewModel, string> getResourceName)
85
public async Task ExecuteAsyncCore(ResourceViewModel resource,
CommandViewModel
command, Func<ResourceViewModel, string> getResourceName)
Model\ResourceMenuBuilder.cs (8)
78
EventCallback<
CommandViewModel
> commandSelected,
79
Func<ResourceViewModel,
CommandViewModel
, bool> isCommandExecuting,
285
private void AddCommandMenuItems(List<MenuButtonItem> menuItems, ResourceViewModel resource, EventCallback<
CommandViewModel
> commandSelected, Func<ResourceViewModel,
CommandViewModel
, bool> isCommandExecuting)
302
foreach (
var
highlightedCommand in highlightedMenuCommands)
313
foreach (
var
command in otherMenuCommands)
328
foreach (
var
command in otherMenuCommands)
334
MenuButtonItem CreateMenuItem(
CommandViewModel
command)
Model\ResourceViewModel.cs (1)
40
public required ImmutableArray<
CommandViewModel
> Commands { get; init; }
ServiceClient\DashboardClient.cs (1)
744
public async Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, CancellationToken cancellationToken)
ServiceClient\IDashboardClient.cs (1)
73
Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, CancellationToken cancellationToken);
ServiceClient\Partials.cs (1)
117
ImmutableArray<
CommandViewModel
> GetCommands()
Telemetry\TelemetryPropertyValues.cs (1)
15
return
CommandViewModel
.IsKnownCommand(commandName)
Aspire.Dashboard.Components.Tests (2)
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24
ImmutableArray<
CommandViewModel
>? commands = null,
tests\Shared\TestDashboardClient.cs (1)
52
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, CancellationToken cancellationToken)
Aspire.Dashboard.Tests (9)
Integration\Playwright\Infrastructure\MockDashboardClient.cs (1)
43
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, CancellationToken cancellationToken) => throw new NotImplementedException();
Mcp\AspireResourceMcpToolsTests.cs (2)
190
commands: ImmutableArray<
CommandViewModel
>.Empty,
206
var resource = ModelTestHelpers.CreateResource(resourceName: "app1", commands: ImmutableArray<
CommandViewModel
>.Empty);
Model\ResourceMenuBuilderTests.cs (3)
67
EventCallback<
CommandViewModel
>.Empty,
118
EventCallback<
CommandViewModel
>.Empty,
169
EventCallback<
CommandViewModel
>.Empty,
ResourceOutgoingPeerResolverTests.cs (1)
418
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, CancellationToken cancellationToken) => throw new NotImplementedException();
tests\Shared\DashboardModel\ModelTestHelpers.cs (1)
24
ImmutableArray<
CommandViewModel
>? commands = null,
tests\Shared\TestDashboardClient.cs (1)
52
public Task<ResourceCommandResponseViewModel> ExecuteResourceCommandAsync(string resourceName, string resourceType,
CommandViewModel
command, CancellationToken cancellationToken)