From dd479d41172552db9b8d685afbf38a4be4f385c4 Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Thu, 10 Oct 2024 10:03:21 -0400 Subject: [PATCH] fix: remove older references to magic_dns via usernames --- app/routes/_data.machines.$id.tsx | 6 +-- .../_data.machines._index/dialogs/move.tsx | 52 ++++--------------- app/routes/_data.users._index/remove.tsx | 21 +------- app/routes/_data.users._index/rename.tsx | 27 ---------- 4 files changed, 14 insertions(+), 92 deletions(-) diff --git a/app/routes/_data.machines.$id.tsx b/app/routes/_data.machines.$id.tsx index de433a1..c078f09 100644 --- a/app/routes/_data.machines.$id.tsx +++ b/app/routes/_data.machines.$id.tsx @@ -1,11 +1,11 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import { ActionFunctionArgs, type LoaderFunctionArgs } from '@remix-run/node' +import { ActionFunctionArgs, LoaderFunctionArgs } from '@remix-run/node' import { Link, useLoaderData } from '@remix-run/react' import Attribute from '~/components/Attribute' import Card from '~/components/Card' import StatusCircle from '~/components/StatusCircle' -import { type Machine, Route, User } from '~/types' +import { Machine, Route, User } from '~/types' import { cn } from '~/utils/cn' import { loadContext } from '~/utils/config/headplane' import { loadConfig } from '~/utils/config/headscale' @@ -141,7 +141,7 @@ export default function Page() { ) : undefined} diff --git a/app/routes/_data.machines._index/dialogs/move.tsx b/app/routes/_data.machines._index/dialogs/move.tsx index 67de9ce..3fadc92 100644 --- a/app/routes/_data.machines._index/dialogs/move.tsx +++ b/app/routes/_data.machines._index/dialogs/move.tsx @@ -29,8 +29,6 @@ export default function Move({ machine, state, magic, users }: MoveProps) { The owner of the machine is the user associated with it. - When MagicDNS is enabled, the username of the owner - will control the hostname of the machine.
{magic ? ( - owner === machine.user.name - ? ( -

- This machine is accessible by the hostname - {' '} - - {machine.givenName} - . - {owner} - . - {magic} - - . -

- ) - : ( -

- This machine will be accessible by the hostname - {' '} - - {machine.givenName} - . - {owner} - . - {magic} - - {'. '} - The hostname - {' '} - - {machine.givenName} - . - {machine.user.name} - . - {magic} - - {' '} - will no longer point to this machine. -

- ) +

+ This machine is accessible by the hostname + {' '} + + {machine.givenName} + . + {magic} + + . +

) : undefined}
diff --git a/app/routes/_data.users._index/remove.tsx b/app/routes/_data.users._index/remove.tsx index e90d575..6d87c6e 100644 --- a/app/routes/_data.users._index/remove.tsx +++ b/app/routes/_data.users._index/remove.tsx @@ -8,10 +8,9 @@ import Dialog from '~/components/Dialog' interface Props { username: string - magic?: string } -export default function Remove({ username, magic }: Props) { +export default function Remove({ username }: Props) { const submit = useSubmit() const dialogState = useState(false) @@ -41,24 +40,6 @@ export default function Remove({ username, magic }: Props) { ? {' '} A deleted user cannot be recovered. - {magic - ? ( -

- {' '} - Since Magic DNS is enabled, machines - currently accessible via - {' '} - - [machine]. - {username} - . - {magic} - - {' '} - will become orphaned and inaccessible. -

- ) - : undefined} - {' '} - Since Magic DNS is enabled, machines - currently accessible via - {' '} - - [machine]. - {username} - . - {magic} - - {' '} - will now become accessible via - {' '} - - [machine]. - . - {magic} - - . -

- ) - : undefined}