mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 17:41:56 +08:00
fix: conditionally render servers in dash command
This commit is contained in:
parent
ce94204efd
commit
d302df895a
@ -71,6 +71,8 @@ export function DashCommand() {
|
|||||||
<CommandInput placeholder={t("TypeCommand")} value={search} onValueChange={setSearch} />
|
<CommandInput placeholder={t("TypeCommand")} value={search} onValueChange={setSearch} />
|
||||||
<CommandList>
|
<CommandList>
|
||||||
<CommandEmpty>{t("NoResults")}</CommandEmpty>
|
<CommandEmpty>{t("NoResults")}</CommandEmpty>
|
||||||
|
{nezhaWsData.servers.length > 0 && (
|
||||||
|
<>
|
||||||
<CommandGroup heading={t("Servers")}>
|
<CommandGroup heading={t("Servers")}>
|
||||||
{nezhaWsData.servers.map((server) => (
|
{nezhaWsData.servers.map((server) => (
|
||||||
<CommandItem
|
<CommandItem
|
||||||
@ -90,6 +92,8 @@ export function DashCommand() {
|
|||||||
</CommandItem>
|
</CommandItem>
|
||||||
))}
|
))}
|
||||||
</CommandGroup>
|
</CommandGroup>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<CommandSeparator />
|
<CommandSeparator />
|
||||||
|
|
||||||
<CommandGroup heading={t("Shortcuts")}>
|
<CommandGroup heading={t("Shortcuts")}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user