Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
usePreferences,
useAllIPsQuery,
useLinodeIPsQuery,
useLinodeQuery,
useAllIPsQuery,
usePreferences,
} from '@linode/queries';
import { CircleProgress, Typography } from '@linode/ui';
import { styled } from '@mui/material/styles';
Expand All @@ -13,7 +13,9 @@ import { CopyTooltip } from 'src/components/CopyTooltip/CopyTooltip';
import { LinkButton } from 'src/components/LinkButton';
import { TableCell } from 'src/components/TableCell';
import { StyledTableRow } from 'src/features/Linodes/LinodeEntityDetail.styles';
import { useIsLinodeInterfacesEnabled } from 'src/utilities/linodes';

import { ipTypeToText } from './constants';
import { LinodeNetworkingActionMenu } from './LinodeNetworkingActionMenu';

import type { IPAddress, IPRange } from '@linode/api-v4';
Expand Down Expand Up @@ -53,6 +55,8 @@ export const LinodeIPAddressRow = (props: LinodeIPAddressRowProps) => {
type,
} = props;

const { isLinodeInterfacesEnabled } = useIsLinodeInterfacesEnabled();

const { data: ips } = useLinodeIPsQuery(linodeId);
const { data: maskSensitiveDataPreference } = usePreferences(
(preferences) => preferences?.maskSensitiveData
Expand All @@ -78,7 +82,7 @@ export const LinodeIPAddressRow = (props: LinodeIPAddressRowProps) => {
{!isVPCOnlyLinode && <StyledCopyToolTip text={address} />}
</TableCell>
<TableCell data-qa-ip-address sx={{ whiteSpace: 'nowrap' }}>
{type}
{isLinodeInterfacesEnabled ? ipTypeToText[type] : type}
</TableCell>
<TableCell>{gateway}</TableCell>
<TableCell>{subnetMask}</TableCell>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type { IPTypes } from './types';

// @TODO Linode Interfaces: when the Linode Interfaces feature flag is no longer needed,
// we can instead directly update IPTypes and relevant logic
export const ipTypeToText: Record<IPTypes, string> = {
'IPv4 – Private': 'Private – IPv4',
'IPv4 – Public': 'Public – IPv4',
'IPv4 – Reserved (private)': 'Reserved IPv4 (private)',
'IPv4 – Reserved (public)': 'Reserved IPv4 (public)',
'IPv4 – Shared': 'Shared – IPv4',
'IPv4 – VPC': 'VPC – IPv4',
'IPv4 – VPC – Range': 'VPC – Range – IPv4',
'IPv6 – Link Local': 'Link Local – IPv6',
'IPv6 – Range': 'Range – IPv6',
'IPv6 – SLAAC': 'Public - SLAAC – IPv6',
Copy link
Contributor Author

@coliu-akamai coliu-akamai Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI mockups example:

(I've been trying to familiarize myself more with IPs/networking stuff, but there's still a lot I don't know - hopefully these are accurate!). For the UI, reading through IPs/networking stuff online and the API spec:

  • for Link Local IPs I haven't been able to find a big connection between them and public interfaces/internet. Also, when fetching IPs, i've been seeing that the public field in the returned object is false, so I haven't included 'Public' like in the UI mockup here
  • SLAAC addresses - the API spec notes "This is the main IPv6 address used to communicate over the public Internet and with other services in the same data center." The Public field is true, and the SLAAC address I receive when fetching IPs matches the SLAAC address in the public Linode Interface
  • for IPs not associated with interfaces like private IPs, I've still switched the order around for consistency (ex. 'Private' comes before IP type). (side note, iirc, private IPs are not allowed for new Linode Interfaces)

'VPC IPv4 – NAT': 'VPC NAT – IPv4',
};