mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-15 23:17:55 +02:00
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:
commit
c4ae34383d
2 changed files with 29 additions and 2 deletions
|
@ -57,6 +57,8 @@ import {
|
||||||
BreadcrumbSeparator
|
BreadcrumbSeparator
|
||||||
} from "@app/components/ui/breadcrumb";
|
} from "@app/components/ui/breadcrumb";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { QRCodeCanvas } from "qrcode.react";
|
||||||
|
import QRContainer from "@app/components/QRContainer";
|
||||||
|
|
||||||
const createSiteFormSchema = z
|
const createSiteFormSchema = z
|
||||||
.object({
|
.object({
|
||||||
|
@ -775,8 +777,16 @@ PersistentKeepalive = 5`;
|
||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
|
<div className="flex items-center gap-4">
|
||||||
<CopyTextBox text={wgConfig} />
|
<CopyTextBox text={wgConfig} />
|
||||||
|
<QRContainer>
|
||||||
|
<QRCodeCanvas
|
||||||
|
value={wgConfig}
|
||||||
|
size={168}
|
||||||
|
className="mx-auto"
|
||||||
|
/>
|
||||||
|
</QRContainer>
|
||||||
|
</div>
|
||||||
<Alert variant="neutral">
|
<Alert variant="neutral">
|
||||||
<InfoIcon className="h-4 w-4" />
|
<InfoIcon className="h-4 w-4" />
|
||||||
<AlertTitle className="font-semibold">
|
<AlertTitle className="font-semibold">
|
||||||
|
|
17
src/components/QRContainer.tsx
Normal file
17
src/components/QRContainer.tsx
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue