mirror of
https://github.com/tale/headplane.git
synced 2026-09-05 03:35:41 +00:00
feat: change node tag dialog to use Select
This commit is contained in:
@@ -9,7 +9,7 @@ import { ExpiryTag } from '~/components/tags/Expiry';
|
||||
import { HeadplaneAgentTag } from '~/components/tags/HeadplaneAgent';
|
||||
import { SubnetTag } from '~/components/tags/Subnet';
|
||||
import { TailscaleSSHTag } from '~/components/tags/TailscaleSSH';
|
||||
import type { User } from '~/types';
|
||||
import type { Machine, User } from '~/types';
|
||||
import cn from '~/utils/cn';
|
||||
import * as hinfo from '~/utils/host-info';
|
||||
import { PopulatedNode } from '~/utils/node-info';
|
||||
@@ -22,6 +22,7 @@ interface Props {
|
||||
isAgent?: boolean;
|
||||
magic?: string;
|
||||
isDisabled?: boolean;
|
||||
nodeList?: Machine[];
|
||||
}
|
||||
|
||||
export default function MachineRow({
|
||||
@@ -30,6 +31,7 @@ export default function MachineRow({
|
||||
isAgent,
|
||||
magic,
|
||||
isDisabled,
|
||||
nodeList,
|
||||
}: Props) {
|
||||
const uiTags = useMemo(() => {
|
||||
const tags = uiTagsForNode(node, isAgent);
|
||||
@@ -149,6 +151,7 @@ export default function MachineRow({
|
||||
isDisabled={isDisabled}
|
||||
magic={magic}
|
||||
node={node}
|
||||
nodeList={nodeList}
|
||||
users={users}
|
||||
/>
|
||||
</td>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Cog, Ellipsis, SquareTerminal } from 'lucide-react';
|
||||
import { useState } from 'react';
|
||||
import Button from '~/components/Button';
|
||||
import Menu from '~/components/Menu';
|
||||
import type { User } from '~/types';
|
||||
import type { Machine, User } from '~/types';
|
||||
import cn from '~/utils/cn';
|
||||
import { PopulatedNode } from '~/utils/node-info';
|
||||
import Delete from '../dialogs/delete';
|
||||
@@ -18,6 +18,7 @@ interface MenuProps {
|
||||
magic?: string;
|
||||
isFullButton?: boolean;
|
||||
isDisabled?: boolean;
|
||||
nodeList?: Machine[];
|
||||
}
|
||||
|
||||
type Modal = 'rename' | 'expire' | 'remove' | 'routes' | 'move' | 'tags' | null;
|
||||
@@ -28,6 +29,7 @@ export default function MachineMenu({
|
||||
users,
|
||||
isFullButton,
|
||||
isDisabled,
|
||||
nodeList,
|
||||
}: MenuProps) {
|
||||
const [modal, setModal] = useState<Modal>(null);
|
||||
const supportsTailscaleSSH =
|
||||
@@ -77,6 +79,7 @@ export default function MachineMenu({
|
||||
<Tags
|
||||
isOpen={modal === 'tags'}
|
||||
machine={node}
|
||||
nodeList={nodeList}
|
||||
setIsOpen={(isOpen) => {
|
||||
if (!isOpen) setModal(null);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user