microsoft / microsoft/aspire

Allow resources to specify custom icons to use when displayed in the dashboard

Open
#8,684 14 comments 10 reactions 1 assignee Assigned to @Copilot View on GitHub
area-app-model area-dashboard help wanted
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

In 9.2 we added resource icons to the resources table and graph views. We should go further and enable resources to specify their own custom icons to be used when displayed in the dashboard. This should be done in such a way that hosting integrations can specify custom icons for their resources, so that, e.g., the Redis resource could show up with the Redis icon in the dashboard.

The icon itself would need to be sent from the app host resource server to the dashboard process so would need to be serializable. I imagine we'd want to support SVG which has the advantage of being vector and text-based. We could support bitmap-based formats like PNG, ICO, JPG, etc., by encoding them as data-uris.

I imagine an API kinda like the following for using a file on disk:

```csharp
builder.AddContainer("foo", "foo")
.WithResourceIcon("./myicon.svg");
```

And perhaps something like this for something embedded, e.g. in a hosting integration:

```csharp
builder.AddContainer("foo", "foo")
.WithResourceIcon(EncodeAsDataUri(Resources.MyIcon), ImageFormat.Png);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.