Add stubbed UI & feature flag for VNet#39963
Conversation
09af61a to
b4a61c0
Compare
There was a problem hiding this comment.
The best way to review b4a61c0 is to start in this file and then go deeper.
| flexDirection="column" | ||
| css={` | ||
| &:empty { | ||
| display: none; |
There was a problem hiding this comment.
This is so that when there's no content within this Flex, the extra padding set on line 42 isn't applied and we don't have to manually add p={textSpacing} to each Text within this Flex.
4f000fc to
0b1d15e
Compare
b4a61c0 to
9c7b727
Compare
| {startAttempt.status === 'error' && ( | ||
| <Text>Could not start VNet: {startAttempt.statusText}</Text> | ||
| )} | ||
| {stopAttempt.status === 'error' && ( | ||
| <Text>Could not stop VNet: {stopAttempt.statusText}</Text> | ||
| )} | ||
|
|
||
| {status === 'stopped' && ( | ||
| <Text>VNet automatically authenticates connections to TCP apps.</Text> | ||
| )} |
There was a problem hiding this comment.
out of curiosity, if none of these are true, then there is a empty styled div in the dom. is that generally okay to do?
There was a problem hiding this comment.
Yeah, that's generally fine. The only issue is that Text inside VnetSliderStep requires more padding than AppConnectionItem, so that's why this Flex has p={textSpacing}.
When it's empty, it still adds that padding, which I counteract with &:empty { display: none; }. IMHO it's better and more self-contained than adding three different conditions before rendering this Flex or adding p={textSpacing} to each Text.
This is an improved version of what I got so far on the
vnet-demobranch, added behind a feature flag so that it doesn't rot on a separate feature branch.Check out the UX section of the RFD for how it's supposed to work. In short, when VNet is active, you can just send requests to
your-tcp-app.cluster.example.comand they'll be automatically authenticated. As this is mostly a "backend" thing, the UI boils down to just an extra option next to the "Connect" button for TCP apps and VNet panel in connections. After some recent discussions we decided to support only TCP apps in the initial version.At the moment the UI uses a stubbed version of the gRPC service from #39826, so it doesn't have any effect on the system. Once Nic moves the rest of the code from
vnet-demointo master, I'm going to set it all up to actually start/stop VNet.There's a bunch of TODOs remaining, some of them left in the code. I'm going to address them in the future. For example, the VNet item in the connection list is not yet searchable and the VNet panel should expand rather than slide.
Important
To see the new UI, you need to set
feature.vnettotruein your app config.