Merge pull request #595 from imbavirus/feature/wireguard-qrcode

Added QR code to wireguard config for easy scanning on mobile phones
This commit is contained in:
Milo Schwartz 2025-04-28 18:21:01 -04:00 committed by GitHub
commit c4ae34383d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 2 deletions

View file

@ -57,6 +57,8 @@ import {
BreadcrumbSeparator
} from "@app/components/ui/breadcrumb";
import Link from "next/link";
import { QRCodeCanvas } from "qrcode.react";
import QRContainer from "@app/components/QRContainer";
const createSiteFormSchema = z
.object({
@ -775,8 +777,16 @@ PersistentKeepalive = 5`;
</SettingsSectionDescription>
</SettingsSectionHeader>
<SettingsSectionBody>
<div className="flex items-center gap-4">
<CopyTextBox text={wgConfig} />
<QRContainer>
<QRCodeCanvas
value={wgConfig}
size={168}
className="mx-auto"
/>
</QRContainer>
</div>
<Alert variant="neutral">
<InfoIcon className="h-4 w-4" />
<AlertTitle className="font-semibold">

View file

@ -0,0 +1,17 @@
"use client";
export default function QRContainer({
children = <div/>,
outline = true
}) {
return (
<div
className={`relative w-fit border-2 rounded-md`}
>
<div className="bg-white p-6 rounded-md">
{children}
</div>
</div>
);
}