fix: use new headscale user api routes

This commit is contained in:
Aarnav Tale 2025-02-19 13:01:20 -05:00
parent e6580eed2c
commit 774fdb7be2
No known key found for this signature in database
12 changed files with 250 additions and 252 deletions

View file

@ -1,37 +0,0 @@
import { Pencil } from 'lucide-react';
import { useState } from 'react';
import Dialog from '~/components/Dialog';
import Input from '~/components/Input';
interface Props {
username: string;
}
// TODO: Server side validation before submitting
export default function Rename({ username }: Props) {
const [newName, setNewName] = useState(username);
return (
<Dialog>
<Dialog.IconButton label={`Rename ${username}`}>
<Pencil className="p-1" />
</Dialog.IconButton>
<Dialog.Panel>
<Dialog.Title>Rename {username}?</Dialog.Title>
<Dialog.Text className="mb-8">
Enter a new username for {username}. Changing a username will not
update any ACL policies that may refer to this user by their old
username.
</Dialog.Text>
<input type="hidden" name="_method" value="rename" />
<input type="hidden" name="old" value={username} />
<Input
isRequired
name="new"
label="Username"
placeholder="my-new-name"
/>
</Dialog.Panel>
</Dialog>
);
}