Add active tasks indicator, propagate LXC create errors, fix Fedora logo
- Surface a topbar indicator with a live count of active tasks - Propagate exceptions from Proxmox LXC container creation instead of swallowing them, and validate minimum password length - Replace the Fedora catalog icon with the official logo artwork
This commit is contained in:
44
frontend/src/components/shared/ActiveTasksIndicator.tsx
Normal file
44
frontend/src/components/shared/ActiveTasksIndicator.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import { useNavigate } from 'react-router';
|
||||
import { ListTodo } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
||||
import { useActiveTaskCount } from '@/hooks/use-tasks';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export default function ActiveTasksIndicator() {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const { data } = useActiveTaskCount();
|
||||
const count = data?.count ?? 0;
|
||||
|
||||
return (
|
||||
<Tooltip>
|
||||
<TooltipTrigger
|
||||
render={
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="relative"
|
||||
onClick={() => navigate('/tasks')}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<ListTodo className="h-4 w-4" />
|
||||
{count > 0 && (
|
||||
<Badge
|
||||
variant="default"
|
||||
className="absolute -right-0.5 -top-0.5 h-4 min-w-4 px-1 text-2xs"
|
||||
>
|
||||
{count > 99 ? '99+' : count}
|
||||
</Badge>
|
||||
)}
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
{count > 0
|
||||
? t('tasks.active_count', { count })
|
||||
: t('tasks.no_active', 'No active tasks')}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
@@ -119,8 +119,16 @@ const OS_MAP: Array<{ keys: string[]; info: OsInfo }> = [
|
||||
bg: '#294172',
|
||||
fg: '#fff',
|
||||
svg: (
|
||||
<svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm4 11h-3v3a1 1 0 0 1-2 0v-3H8a1 1 0 0 1 0-2h3V8a1 1 0 0 1 2 0v3h3a1 1 0 0 1 0 2z" />
|
||||
<svg viewBox="0 0 267 267" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M 266.62575,133.50613 C 266.62575,59.98128 207.02222,0.37583 133.49792,0.37583 C 60.00668,0.37583 0.42639,59.93123 0.37425,133.41225 L 0.37425,236.4333 C 0.4138,253.11763 13.94545,266.62417 30.64027,266.62417 L 133.55192,266.62417 C 207.05167,266.59532 266.62575,207.01142 266.62575,133.50613" fill="#294172"/>
|
||||
<path d="M 77.126289,142.09756 C 77.126289,142.09756 124.97104,142.09756 124.97104,142.09756 C 124.97104,142.09756 124.97104,189.94234 124.97104,189.94234 C 124.97104,216.35263 103.53659,237.78707 77.126289,237.78707 C 50.715979,237.78707 29.28153,216.35263 29.28153,189.94234 C 29.28153,163.53203 50.715979,142.09756 77.126289,142.09756 z" fill="none" stroke="#3c6eb4" strokeWidth="29.21"/>
|
||||
<use transform="matrix(-1,0,0,-1,249.71151,284.2882)" xlinkHref="#fedora-in"/>
|
||||
<path d="M 139.6074,127.52923 L 139.6074,189.87541 C 139.6074,224.37943 111.63203,252.35541 77.12679,252.35541 C 71.89185,252.35541 68.1703,251.7644 63.32444,250.49771 C 56.25849,248.64859 50.48398,242.85518 50.48158,236.1166 C 50.48158,227.97147 56.39394,222.0467 65.23187,222.0467 C 69.43824,222.0467 70.96454,222.85435 77.12679,222.85435 C 95.3184,222.85435 110.07443,208.11916 110.10634,189.92756 L 110.10634,161.27099 C 110.10634,158.70324 108.01971,156.62274 105.44767,156.62274 L 83.78246,156.61846 C 75.71034,156.61846 69.18845,150.18003 69.18845,142.0858 C 69.18414,133.94124 75.77725,127.52923 83.93653,127.52923" fill="#ffffff"/>
|
||||
<use transform="matrix(-1,0,0,-1,249.71152,284.28821)" xlinkHref="#fedora-free"/>
|
||||
<defs>
|
||||
<path d="M 77.126289,142.09756 C 77.126289,142.09756 124.97104,142.09756 124.97104,142.09756 C 124.97104,142.09756 124.97104,189.94234 124.97104,189.94234 C 124.97104,216.35263 103.53659,237.78707 77.126289,237.78707 C 50.715979,237.78707 29.28153,216.35263 29.28153,189.94234 C 29.28153,163.53203 50.715979,142.09756 77.126289,142.09756 z" id="fedora-in" fill="none" stroke="#3c6eb4" strokeWidth="29.21"/>
|
||||
<path d="M 139.6074,127.52923 L 139.6074,189.87541 C 139.6074,224.37943 111.63203,252.35541 77.12679,252.35541 C 71.89185,252.35541 68.1703,251.7644 63.32444,250.49771 C 56.25849,248.64859 50.48398,242.85518 50.48158,236.1166 C 50.48158,227.97147 56.39394,222.0467 65.23187,222.0467 C 69.43824,222.0467 70.96454,222.85435 77.12679,222.85435 C 95.3184,222.85435 110.07443,208.11916 110.10634,189.92756 L 110.10634,161.27099 C 110.10634,158.70324 108.01971,156.62274 105.44767,156.62274 L 83.78246,156.61846 C 75.71034,156.61846 69.18845,150.18003 69.18845,142.0858 C 69.18414,133.94124 75.77725,127.52923 83.93653,127.52923" id="fedora-free" fill="#ffffff"/>
|
||||
</defs>
|
||||
</svg>
|
||||
),
|
||||
},
|
||||
|
||||
@@ -33,6 +33,7 @@ import { useGlobalRealtimeSync } from '@/hooks/use-realtime-sync';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import NotificationsDropdown from '@/components/shared/NotificationsDropdown';
|
||||
import ActiveTasksIndicator from '@/components/shared/ActiveTasksIndicator';
|
||||
import CommandPalette from '@/components/shared/CommandPalette';
|
||||
import MinimizedOpsTray from '@/components/shared/MinimizedOpsTray';
|
||||
import { navGroups, canSeeNavItem } from '@/lib/nav-items';
|
||||
@@ -275,6 +276,7 @@ function TopBar() {
|
||||
<TooltipContent>{theme === 'dark' ? 'Light mode' : 'Dark mode'}</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
<ActiveTasksIndicator />
|
||||
<NotificationsDropdown />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
@@ -1690,7 +1690,10 @@
|
||||
"server": "Server",
|
||||
"node": "Node",
|
||||
"started": "Started",
|
||||
"progress": "Progress"
|
||||
"progress": "Progress",
|
||||
"active_count_one": "{{count}} active task",
|
||||
"active_count_other": "{{count}} active tasks",
|
||||
"no_active": "No active tasks"
|
||||
},
|
||||
"notifications": {
|
||||
"title": "Notifications",
|
||||
|
||||
@@ -1675,7 +1675,11 @@
|
||||
"server": "Сервер",
|
||||
"node": "Узел",
|
||||
"started": "Запущено",
|
||||
"progress": "Прогресс"
|
||||
"progress": "Прогресс",
|
||||
"active_count_one": "{{count}} активная задача",
|
||||
"active_count_few": "{{count}} активные задачи",
|
||||
"active_count_many": "{{count}} активных задач",
|
||||
"no_active": "Нет активных задач"
|
||||
},
|
||||
"notifications": {
|
||||
"title": "Уведомления",
|
||||
|
||||
Reference in New Issue
Block a user