diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 7cbc234..9d9c891 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -10,6 +10,10 @@ "core:window:allow-hide", "core:window:allow-show", "core:window:allow-set-focus", + "core:window:allow-minimize", + "core:window:allow-maximize", + "core:window:allow-unmaximize", + "core:window:allow-start-dragging", "opener:default", "shell:default", "fs:default", diff --git a/src-tauri/tauri.linux-aarch64.conf.json b/src-tauri/tauri.linux-aarch64.conf.json index 930bc6b..faa2a47 100644 --- a/src-tauri/tauri.linux-aarch64.conf.json +++ b/src-tauri/tauri.linux-aarch64.conf.json @@ -10,8 +10,9 @@ "windows": [ { "title": "NeoDLP", - "width": 1067, - "height": 605, + "width": 1080, + "height": 680, + "decorations": false, "visible": false } ], diff --git a/src-tauri/tauri.linux-x86_64.conf.json b/src-tauri/tauri.linux-x86_64.conf.json index 4d4b74e..27294d5 100644 --- a/src-tauri/tauri.linux-x86_64.conf.json +++ b/src-tauri/tauri.linux-x86_64.conf.json @@ -10,8 +10,9 @@ "windows": [ { "title": "NeoDLP", - "width": 1067, - "height": 605, + "width": 1080, + "height": 680, + "decorations": false, "visible": false } ], diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 179b6a1..a9484fb 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -10,8 +10,9 @@ "windows": [ { "title": "NeoDLP", - "width": 1067, - "height": 605, + "width": 1080, + "height": 680, + "decorations": false, "visible": false } ], diff --git a/src/components/icons/close.tsx b/src/components/icons/close.tsx new file mode 100644 index 0000000..4c8f6df --- /dev/null +++ b/src/components/icons/close.tsx @@ -0,0 +1,12 @@ +export function CloseIcon({ className }: { className?: string }) { + return ( + + + + ); +} diff --git a/src/components/icons/maximize.tsx b/src/components/icons/maximize.tsx new file mode 100644 index 0000000..58bb27a --- /dev/null +++ b/src/components/icons/maximize.tsx @@ -0,0 +1,7 @@ +export function MaximizeIcon({ className }: { className?: string }) { + return ( + + + + ); +} diff --git a/src/components/icons/minimize.tsx b/src/components/icons/minimize.tsx new file mode 100644 index 0000000..0892ce4 --- /dev/null +++ b/src/components/icons/minimize.tsx @@ -0,0 +1,7 @@ +export function MinimizeIcon({ className }: { className?: string }) { + return ( + + + + ); +} diff --git a/src/components/icons/unmaximize.tsx b/src/components/icons/unmaximize.tsx new file mode 100644 index 0000000..3c13cf5 --- /dev/null +++ b/src/components/icons/unmaximize.tsx @@ -0,0 +1,10 @@ +export function UnmaximizeIcon({ className }: { className?: string }) { + return ( + + + + + + + ); +} diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index fe1d2ba..eb7ac18 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -8,10 +8,13 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; import { useLogger } from "@/helpers/use-logger"; import { writeText } from "@tauri-apps/plugin-clipboard-manager"; +import TitleBar from "@/components/titlebar"; +import { platform } from "@tauri-apps/plugin-os"; export default function Navbar() { const [copied, setCopied] = useState(false); const location = useLocation(); + const currentPlatform = platform(); const logger = useLogger(); const logs = logger.getLogs(); const logText = logs.map(log => `${new Date(log.timestamp).toLocaleTimeString()} [${log.level.toUpperCase()}] ${log.context}: ${log.message}`).join('\n'); @@ -23,67 +26,74 @@ export default function Navbar() { } return ( - - - - {getRouteName(location.pathname)} - - - - - - - - - - - - - Logs - - - - - Log Viewer - Monitor real-time app session logs (latest on top) - - - {logs.length === 0 ? ( - NO LOGS TO SHOW! - ) : ( - logs.slice().reverse().map((log, index) => ( - - {new Date(log.timestamp).toLocaleTimeString()} [{log.level.toUpperCase()}] {log.context} : - {log.message} - - )) - )} - - - logger.clearLogs()} - > - - Clear Logs - - handleCopyLogs()} - > - {copied ? ( - + + {currentPlatform === "windows" || currentPlatform === "linux" ? ( + + ) : ( + null + )} + + + + {getRouteName(location.pathname)} + + + + + + + + + + + + + Logs + + + + + Log Viewer + Monitor real-time app session logs (latest on top) + + + {logs.length === 0 ? ( + NO LOGS TO SHOW! ) : ( - + logs.slice().reverse().map((log, index) => ( + + {new Date(log.timestamp).toLocaleTimeString()} [{log.level.toUpperCase()}] {log.context} : + {log.message} + + )) )} - Copy Logs - - - - - - + + + logger.clearLogs()} + > + + Clear Logs + + handleCopyLogs()} + > + {copied ? ( + + ) : ( + + )} + Copy Logs + + + + + + + ) } diff --git a/src/components/sidebar.tsx b/src/components/sidebar.tsx index 75ee11f..7f9e603 100644 --- a/src/components/sidebar.tsx +++ b/src/components/sidebar.tsx @@ -147,7 +147,7 @@ export function AppSidebar() { - + diff --git a/src/components/titlebar.tsx b/src/components/titlebar.tsx new file mode 100644 index 0000000..e0e626f --- /dev/null +++ b/src/components/titlebar.tsx @@ -0,0 +1,58 @@ +import { useState } from "react"; +import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow"; +import { MaximizeIcon } from "@/components/icons/maximize"; +import { MinimizeIcon } from "@/components/icons/minimize"; +import { CloseIcon } from "@/components/icons/close"; +import { UnmaximizeIcon } from "@/components/icons/unmaximize"; + +export default function TitleBar() { + const [maximized, setMaximized] = useState(false); + const appWindow = getCurrentWebviewWindow(); + + return ( + + + NeoDLP + + + appWindow.minimize()} + > + + + { + const isMaximized = await appWindow.isMaximized(); + if (isMaximized) { + await appWindow.unmaximize(); + setMaximized(false); + } else { + await appWindow.maximize(); + setMaximized(true); + } + }} + > + {maximized ? ( + + ) : ( + + )} + + appWindow.hide()} + > + + + + + ); +} diff --git a/src/pages/layout/root.tsx b/src/pages/layout/root.tsx index b9dd9c9..18fe6e7 100644 --- a/src/pages/layout/root.tsx +++ b/src/pages/layout/root.tsx @@ -7,16 +7,16 @@ import Footer from "@/components/footer"; export default function RootLayout() { return ( <> - - - - - - - - - + + + + + + + + + > ); -} \ No newline at end of file +}
Logs
NO LOGS TO SHOW!
{new Date(log.timestamp).toLocaleTimeString()} [{log.level.toUpperCase()}] {log.context} :
{log.message}