Skip to content

Commit

Permalink
add copy ID to clipboard for nodes & templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwang401 committed Dec 5, 2023
1 parent 2e1156f commit 3e627ef
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions resources/scripts/components/admin/nodes/NodesContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ const NodesContainer = () => {

return (
<Actions>
<Menu.Item
onClick={() => navigator.clipboard.writeText(node.id)}
>
Copy ID
</Menu.Item>
<Menu.Divider />
<Menu.Item
color='red'
disabled={node.serversCount > 0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ const TemplateCard = ({ template, group, className }: Props) => {
<DottedButton />
</Menu.Target>
<Menu.Dropdown>
<Menu.Item
onClick={() =>
navigator.clipboard.writeText(template.uuid)
}
>
Copy ID
</Menu.Item>
<Menu.Item onClick={() => setShowEditModal(true)}>
Edit
</Menu.Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import EditTemplateGroupModal from '@/components/admin/nodes/templates/EditTempl
import EditTemplateModal from '@/components/admin/nodes/templates/EditTemplateModal'
import TemplateCard from '@/components/admin/nodes/templates/TemplateCard'


interface Props {
group: TemplateGroup
className?: string
Expand Down Expand Up @@ -211,6 +212,15 @@ const TemplateGroupCard = ({ group, className }: Props) => {
/>
</Menu.Target>
<Menu.Dropdown>
<Menu.Item
onClick={() =>
navigator.clipboard.writeText(
group.uuid
)
}
>
Copy ID
</Menu.Item>
<Menu.Item
onClick={() => setShowEditModal(true)}
>
Expand Down

0 comments on commit 3e627ef

Please sign in to comment.