|
|
@@ -1,6 +1,6 @@
|
|
|
import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
|
|
|
import { NavLink, Outlet, useNavigate, useLocation } from 'react-router-dom';
|
|
|
-import { Printer, Archive, Calendar, BarChart3, Cloud, Settings, Sun, Moon, ChevronLeft, ChevronRight, Keyboard, Github, GripVertical, ArrowUpCircle, Wrench, FolderKanban, FolderOpen, X, Menu, Info, Plug, Bug, LogOut, Key, Loader2, Disc3, type LucideIcon } from 'lucide-react';
|
|
|
+import { Printer, Archive, Calendar, BarChart3, Cloud, Settings, Sun, Moon, ChevronLeft, ChevronRight, Keyboard, Github, GripVertical, ArrowUpCircle, Wrench, FolderKanban, FolderOpen, X, Menu, Info, Plug, Bug, LogOut, Key, Loader2, Disc3, ShieldAlert, type LucideIcon } from 'lucide-react';
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
import { useTheme } from '../contexts/ThemeContext';
|
|
|
import { KeyboardShortcutsModal } from './KeyboardShortcutsModal';
|
|
|
@@ -149,6 +149,15 @@ export function Layout() {
|
|
|
refetchInterval: 60 * 1000, // Refresh every minute
|
|
|
});
|
|
|
|
|
|
+ // Check developer LAN mode warnings
|
|
|
+ const { data: devModeWarnings } = useQuery({
|
|
|
+ queryKey: ['developer-mode-warnings'],
|
|
|
+ queryFn: api.getDeveloperModeWarnings,
|
|
|
+ staleTime: 10 * 1000,
|
|
|
+ refetchInterval: 30 * 1000,
|
|
|
+ refetchOnWindowFocus: true,
|
|
|
+ });
|
|
|
+
|
|
|
// Fetch pending queue items count for badge
|
|
|
const { data: queueItems } = useQuery({
|
|
|
queryKey: ['queue', 'pending'],
|
|
|
@@ -807,6 +816,24 @@ export function Layout() {
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|
|
|
+ {devModeWarnings && devModeWarnings.length > 0 && (
|
|
|
+ <div className="bg-orange-500/20 border-b border-orange-500/30 px-4 py-2 flex items-center justify-between">
|
|
|
+ <div className="flex items-center gap-2 text-sm">
|
|
|
+ <ShieldAlert className="w-4 h-4 text-orange-500" />
|
|
|
+ <span className="text-orange-200">
|
|
|
+ {t('printers.developerModeWarning', {
|
|
|
+ names: devModeWarnings.map(w => w.name).join(', '),
|
|
|
+ defaultValue: `Developer LAN mode is not enabled on: ${devModeWarnings.map(w => w.name).join(', ')}. Some features may not work.`
|
|
|
+ })}
|
|
|
+ </span>
|
|
|
+ <a href="https://wiki.bambulab.com/en/knowledge-sharing/enable-developer-mode"
|
|
|
+ target="_blank" rel="noopener noreferrer"
|
|
|
+ className="text-orange-400 hover:text-orange-300 font-medium underline ml-2">
|
|
|
+ {t('printers.howToEnable', { defaultValue: 'How to enable' })}
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
{/* Persistent update banner */}
|
|
|
{showUpdateBanner && (
|
|
|
<div className="bg-bambu-green/20 border-b border-bambu-green/30 px-4 py-2 flex items-center justify-between">
|