diff --git a/src/ui/dashboard/DashboardTab.tsx b/src/ui/dashboard/DashboardTab.tsx index 3d68802c..cadd4c56 100644 --- a/src/ui/dashboard/DashboardTab.tsx +++ b/src/ui/dashboard/DashboardTab.tsx @@ -276,10 +276,15 @@ function CountersBarCard({ function QuickActionsCard({ onOpenSingletonTab, + hosts, + onOpenTab, }: { onOpenSingletonTab: (type: TabType, pendingEvent?: string) => void; + hosts: Host[]; + onOpenTab: (host: Host, type: TabType) => void; }) { const { t } = useTranslation(); + const pinnedHosts = hosts.filter((h) => h.pin); return ( @@ -328,38 +333,64 @@ function QuickActionsCard({ - onOpenSingletonTab("admin-settings")} - className="group/btn flex items-center gap-2.5 px-4 py-2.5 hover:bg-muted transition-colors cursor-pointer border-b border-border flex-1" - > - - + {pinnedHosts.length > 0 ? ( + + {pinnedHosts.slice(0, 4).map((host) => ( + onOpenTab(host, "terminal")} + className="group/btn flex items-center gap-2.5 px-4 py-2 hover:bg-muted transition-colors cursor-pointer border-b border-border last:border-b-0" + > + + + + + + {host.name || host.ip} + + + {host.ip}:{host.sshPort} + + + + ))} - - - {t("dashboard.adminSettings")} - - - {t("dashboardTab.manageUsersAndRoles")} - - - - onOpenSingletonTab("user-profile")} - className="group/btn flex items-center gap-2.5 px-4 py-2.5 hover:bg-muted transition-colors cursor-pointer flex-1" - > - - - - - - {t("dashboard.userProfile")} - - - {t("dashboardTab.manageYourAccount")} - - - + ) : ( + <> + onOpenSingletonTab("admin-settings")} + className="group/btn flex items-center gap-2.5 px-4 py-2.5 hover:bg-muted transition-colors cursor-pointer border-b border-border flex-1" + > + + + + + + {t("dashboard.adminSettings")} + + + {t("dashboardTab.manageUsersAndRoles")} + + + + onOpenSingletonTab("user-profile")} + className="group/btn flex items-center gap-2.5 px-4 py-2.5 hover:bg-muted transition-colors cursor-pointer flex-1" + > + + + + + + {t("dashboard.userProfile")} + + + {t("dashboardTab.manageYourAccount")} + + + + > + )} @@ -706,7 +737,7 @@ function CardItem({ /> )} {slot.id === "quick_actions" && ( - + )} {slot.id === "host_status" && ( )} {slot.id === "quick_actions" && ( - + )} {slot.id === "host_status" && (