winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.79k stars 189 forks source link

Add ability to change icons on resources in the console (based on desired target) #6767

Open boyney123 opened 3 weeks ago

boyney123 commented 3 weeks ago

Use Case

Minor improvement, but it would be nice to select my platform in the console and the icons switch over to the icons of the provider. Example would be if I select AWS TF as a target platform the resource icons would change to AWS icons.

Proposed Solution

Allow user to select their desired platform in the console, and load the correct icons based on this.

Implementation Notes

No response

Component

Wing Console

Community Notes

skyrpex commented 2 weeks ago

We need to take into account that the sim target doesn't always output the same resources as the tf-aws target. See the following app:

bring cloud;

let bucket = new cloud.Bucket();
bucket.onCreate(inflight () => {});

It creates the following nodes for the sim target:

image

But it may create the optimal infrastructure in tf-aws:

flowchart LR
    Bucket
    Lambda
    Bucket --> |onObjectCreated| Lambda

Given the above details... maybe we should hide implementation details in our sim target, such as the bucket topic, so both targets have similar infrastructure. But it doesn't mean the infrastructure will be equivalent...

A different approach would be to actually compile the application to the tf-aws target and display the map with real AWS icons. The Console resources wouldn't be interactive, though, and would be much slower than just changing icons on the fly.

Thoughts?