From 771570042c591a085810861af9ab78cf5dccc24b Mon Sep 17 00:00:00 2001 From: Alex Goodkind Date: Sun, 25 May 2025 23:32:30 +0000 Subject: [PATCH] feat: add loopback-only mode functionality to UI - Implemented a new setting for enabling loopback-only mode, restricting web interface access to localhost. - Added a confirmation dialog to warn users before enabling this feature. - Updated the ConfirmDialog component to accept React nodes for the description prop. - Refactored imports and adjusted component structure for clarity. --- ui/src/components/ConfirmDialog.tsx | 12 +-- .../routes/devices.$id.settings.advanced.tsx | 96 +++++++++++++++++-- 2 files changed, 92 insertions(+), 16 deletions(-) diff --git a/ui/src/components/ConfirmDialog.tsx b/ui/src/components/ConfirmDialog.tsx index 3771096..f6a3923 100644 --- a/ui/src/components/ConfirmDialog.tsx +++ b/ui/src/components/ConfirmDialog.tsx @@ -1,12 +1,12 @@ import { - ExclamationTriangleIcon, CheckCircleIcon, + ExclamationTriangleIcon, InformationCircleIcon, } from "@heroicons/react/24/outline"; -import { cx } from "@/cva.config"; import { Button } from "@/components/Button"; import Modal from "@/components/Modal"; +import { cx } from "@/cva.config"; type Variant = "danger" | "success" | "warning" | "info"; @@ -14,7 +14,7 @@ interface ConfirmDialogProps { open: boolean; onClose: () => void; title: string; - description: string; + description: React.ReactNode; variant?: Variant; confirmText?: string; cancelText?: string | null; @@ -84,8 +84,8 @@ export function ConfirmDialog({ >