mirror of
https://github.com/fosrl/pangolin.git
synced 2025-05-13 05:40:38 +01:00
manually merge wg qr code
This commit is contained in:
parent
e4af990bf2
commit
cffc156cf6
1 changed files with 37 additions and 7 deletions
|
@ -29,14 +29,29 @@ import { InfoIcon, Terminal } from "lucide-react";
|
||||||
import { Button } from "@app/components/ui/button";
|
import { Button } from "@app/components/ui/button";
|
||||||
import CopyTextBox from "@app/components/CopyTextBox";
|
import CopyTextBox from "@app/components/CopyTextBox";
|
||||||
import CopyToClipboard from "@app/components/CopyToClipboard";
|
import CopyToClipboard from "@app/components/CopyToClipboard";
|
||||||
import { InfoSection, InfoSectionContent, InfoSections, InfoSectionTitle } from "@app/components/InfoSection";
|
import {
|
||||||
import { FaApple, FaCubes, FaDocker, FaFreebsd, FaWindows } from "react-icons/fa";
|
InfoSection,
|
||||||
|
InfoSectionContent,
|
||||||
|
InfoSections,
|
||||||
|
InfoSectionTitle
|
||||||
|
} from "@app/components/InfoSection";
|
||||||
|
import {
|
||||||
|
FaApple,
|
||||||
|
FaCubes,
|
||||||
|
FaDocker,
|
||||||
|
FaFreebsd,
|
||||||
|
FaWindows
|
||||||
|
} from "react-icons/fa";
|
||||||
import { Checkbox } from "@app/components/ui/checkbox";
|
import { Checkbox } from "@app/components/ui/checkbox";
|
||||||
import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert";
|
import { Alert, AlertDescription, AlertTitle } from "@app/components/ui/alert";
|
||||||
import { generateKeypair } from "../[niceId]/wireguardConfig";
|
import { generateKeypair } from "../[niceId]/wireguardConfig";
|
||||||
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
import { createApiClient, formatAxiosError } from "@app/lib/api";
|
||||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||||
import { CreateSiteBody, CreateSiteResponse, PickSiteDefaultsResponse } from "@server/routers/site";
|
import {
|
||||||
|
CreateSiteBody,
|
||||||
|
CreateSiteResponse,
|
||||||
|
PickSiteDefaultsResponse
|
||||||
|
} from "@server/routers/site";
|
||||||
import { toast } from "@app/hooks/useToast";
|
import { toast } from "@app/hooks/useToast";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { useParams, useRouter } from "next/navigation";
|
import { useParams, useRouter } from "next/navigation";
|
||||||
|
@ -48,6 +63,7 @@ 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";
|
||||||
|
|
||||||
const createSiteFormSchema = z
|
const createSiteFormSchema = z
|
||||||
.object({
|
.object({
|
||||||
|
@ -101,7 +117,7 @@ const platforms = [
|
||||||
"freebsd"
|
"freebsd"
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
type Platform = typeof platforms[number];
|
type Platform = (typeof platforms)[number];
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
const { env } = useEnvContext();
|
const { env } = useEnvContext();
|
||||||
|
@ -725,7 +741,9 @@ WantedBy=default.target`
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p className="font-bold mb-3">
|
<p className="font-bold mb-3">
|
||||||
{["docker", "podman"].includes(platform)
|
{["docker", "podman"].includes(
|
||||||
|
platform
|
||||||
|
)
|
||||||
? "Method"
|
? "Method"
|
||||||
: "Architecture"}
|
: "Architecture"}
|
||||||
</p>
|
</p>
|
||||||
|
@ -783,8 +801,20 @@ WantedBy=default.target`
|
||||||
</SettingsSectionDescription>
|
</SettingsSectionDescription>
|
||||||
</SettingsSectionHeader>
|
</SettingsSectionHeader>
|
||||||
<SettingsSectionBody>
|
<SettingsSectionBody>
|
||||||
<CopyTextBox text={wgConfig} />
|
<div className="flex items-center gap-4">
|
||||||
|
<CopyTextBox text={wgConfig} />
|
||||||
|
<div
|
||||||
|
className={`relative w-fit border rounded-md`}
|
||||||
|
>
|
||||||
|
<div className="bg-white p-6 rounded-md">
|
||||||
|
<QRCodeCanvas
|
||||||
|
value={wgConfig}
|
||||||
|
size={168}
|
||||||
|
className="mx-auto"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</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">
|
||||||
|
|
Loading…
Reference in a new issue