-
Notifications
You must be signed in to change notification settings - Fork 14
Add VPC and instance external IP to instance page #1882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -52,10 +52,11 @@ const VpcNameFromId = ({ value }: { value: string }) => { | |||
// possible because you can't delete a VPC that has child resources, but let's | |||
// be safe | |||
if (isError) return <Badge color="neutral">Deleted</Badge> | |||
if (!vpc) return <Spinner /> // loading | |||
if (!vpc) | |||
return <div className="h-4 w-12 rounded bg-tertiary motion-safe:animate-pulse" /> // loading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a skeleton state here rather than the full spinner which can be a bit strong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know we had that. That's great. You should update SubnetNameFromId
too, which is also using the spinner. Also maybe make it wider (maybe not the pulsing thing itself, but its container) so the pop-in is less severe when the name shows up? Though that depends on making a guess about the average length of name. Usually it will be default
, right?
* Update copy to clipboard component Uses new icon and snazzy animation * Add copy to clipboard to external IP * `CopyOnTruncate` component * Add description to `CopyOnTruncate` * Revert "Add description to `CopyOnTruncate`" This reverts commit 4bf0bcc. * Revert "`CopyOnTruncate` component" This reverts commit e4a0107.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license-eye has totally checked 459 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
407 | 1 | 51 | 0 |
Click to see the invalid file list
- libs/api-mocks/external-ip.ts
|
||
return ( | ||
<div className="flex items-center gap-1 text-secondary"> | ||
{primary ? ips : <>—</>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a) this logic doesn't work for the case where you're looking at the whole list and don't have any IPs. primary && ips.length > 0
would probably cover it, but deserves a comment to explain that the two conditions are for two different call sites. I might tweak the props API since primary is not relevant to the instance page and the need to include primary: true
there is confusing because it's meaningless.
b) should probably make the VPC one also use mdash

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -45,7 +45,7 @@ PropertiesTable.Row = ({ label, children }: PropertiesTableRowProps) => ( | |||
<span className="flex items-center"> | |||
<Badge>{label}</Badge> | |||
</span> | |||
<div className="flex items-center overflow-hidden whitespace-nowrap pr-4 text-sans-md text-secondary"> | |||
<div className="flex h-11 items-center overflow-hidden whitespace-nowrap pr-4 text-sans-md text-secondary"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were getting a flash of movement when the skeleton switched to the text since they're not the exact same height. This fixes that and any future issues where the content of the row is not the same height as text-sans-md
.
const VpcNameFromId = ({ value }: { value: string }) => { | ||
export const Skeleton = classed.div`h-4 w-12 rounded bg-tertiary motion-safe:animate-pulse` | ||
|
||
export const EmptyCellContent = () => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a better home for this?
return ( | ||
<a | ||
className="underline text-sans-semi-md text-secondary hover:text-default" | ||
href={ip} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a protocol – we can assume this is http
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. Might be better to do https and let them fix it after nav if it’s wrong.
cell={ExternalIpsFromInstanceName} | ||
cell={({ value: primary }) => | ||
primary ? <ExternalIps {...instanceSelector} /> : <EmptyCell /> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This primary logic was inside the component before, but it's only relevant here, not in the table at the top. But you know... what if we just got rid of this column? The relation to the network interface is kind of tenuous to begin with. VPC name is different because each network interface can point to a different VPC. But external IPs really are instance level. So let's take them out of this table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -81,6 +116,8 @@ export function InstancePage() { | |||
|
|||
const memory = filesize(instance.memory, { output: 'object', base: 2 }) | |||
|
|||
const primaryVpcId = nics.items.length > 0 ? nics.items[0].vpcId : undefined | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just occurred to me — I don't think we can rely on the first NIC being the primary one. We have to find the primary directly.
oxidecomputer/console@367142c...644a45b * [644a45b8](oxidecomputer/console@644a45b8) oxidecomputer/console#1882 * [69927db1](oxidecomputer/console@69927db1) oxidecomputer/console#1879 * [a3165dff](oxidecomputer/console@a3165dff) oxidecomputer/console#1883 * [4f706c2b](oxidecomputer/console@4f706c2b) oxidecomputer/console#1877 * [7999343d](oxidecomputer/console@7999343d) oxidecomputer/console#1880
oxidecomputer/console@367142c...644a45b * [644a45b8](oxidecomputer/console@644a45b8) oxidecomputer/console#1882 * [69927db1](oxidecomputer/console@69927db1) oxidecomputer/console#1879 * [a3165dff](oxidecomputer/console@a3165dff) oxidecomputer/console#1883 * [4f706c2b](oxidecomputer/console@4f706c2b) oxidecomputer/console#1877 * [7999343d](oxidecomputer/console@7999343d) oxidecomputer/console#1880
Fixes #1849
Some assumptions here: we're just interested in showing the primary VPC here, but we might want to show all of the external IPs.
Added VPC here also because whilst the current navigation to get to the associated VPC feels systematically correct, we have had people struggle to find their firewall rules and this is part of a larger effort to make that easier to find.
Also making it clearer they are clickable with the underline (following up with some similar changes elsewhere to make other links clearer).
Also fixes #1775 through #1885