update command palette items

This commit is contained in:
Henry Dollman
2024-09-16 13:38:03 -04:00
parent e03e2b8d67
commit 060846d70a

View File

@@ -6,6 +6,7 @@ import {
LogsIcon, LogsIcon,
MailIcon, MailIcon,
Server, Server,
SettingsIcon,
UsersIcon, UsersIcon,
} from 'lucide-react' } from 'lucide-react'
@@ -46,33 +47,9 @@ export default function CommandPalette() {
<CommandInput placeholder="Search for systems or settings..." /> <CommandInput placeholder="Search for systems or settings..." />
<CommandList> <CommandList>
<CommandEmpty>No results found.</CommandEmpty> <CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem
keywords={['home']}
onSelect={() => {
navigate('/')
setOpen((open) => !open)
}}
>
<LayoutDashboard className="mr-2 h-4 w-4" />
<span>Dashboard</span>
<CommandShortcut>Page</CommandShortcut>
</CommandItem>
<CommandItem
keywords={['github']}
onSelect={() => {
window.location.href = 'https://github.com/henrygd/beszel/blob/main/readme.md'
}}
>
<Github className="mr-2 h-4 w-4" />
<span>Documentation</span>
<CommandShortcut>GitHub</CommandShortcut>
</CommandItem>
</CommandGroup>
{systems.length > 0 && ( {systems.length > 0 && (
<> <>
<CommandSeparator /> <CommandGroup>
<CommandGroup heading="Systems">
{systems.map((system) => ( {systems.map((system) => (
<CommandItem <CommandItem
key={system.id} key={system.id}
@@ -87,11 +64,56 @@ export default function CommandPalette() {
</CommandItem> </CommandItem>
))} ))}
</CommandGroup> </CommandGroup>
<CommandSeparator className="mb-1.5" />
</> </>
)} )}
<CommandGroup heading="Pages / Settings">
<CommandItem
keywords={['home']}
onSelect={() => {
navigate('/')
setOpen((open) => !open)
}}
>
<LayoutDashboard className="mr-2 h-4 w-4" />
<span>Dashboard</span>
<CommandShortcut>Page</CommandShortcut>
</CommandItem>
<CommandItem
onSelect={() => {
navigate('/settings/general')
setOpen((open) => !open)
}}
>
<SettingsIcon className="mr-2 h-4 w-4" />
<span>Settings</span>
<CommandShortcut>Settings</CommandShortcut>
</CommandItem>
<CommandItem
keywords={['alerts']}
onSelect={() => {
navigate('/settings/notifications')
setOpen((open) => !open)
}}
>
<MailIcon className="mr-2 h-4 w-4" />
<span>Notification settings</span>
<CommandShortcut>Settings</CommandShortcut>
</CommandItem>
<CommandItem
keywords={['github']}
onSelect={() => {
window.location.href = 'https://github.com/henrygd/beszel/blob/main/readme.md'
}}
>
<Github className="mr-2 h-4 w-4" />
<span>Documentation</span>
<CommandShortcut>GitHub</CommandShortcut>
</CommandItem>
</CommandGroup>
{isAdmin() && ( {isAdmin() && (
<> <>
<CommandSeparator /> <CommandSeparator className="mb-1.5" />
<CommandGroup heading="Admin"> <CommandGroup heading="Admin">
<CommandItem <CommandItem
keywords={['pocketbase']} keywords={['pocketbase']}