diff --git a/package.json b/package.json index c698e43b..7323b73b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fossorial/pangolin", - "version": "0.1.0", + "version": "1.0.0", "private": true, "type": "module", "scripts": { diff --git a/server/config.ts b/server/config.ts index 98f69928..8d78cbc0 100644 --- a/server/config.ts +++ b/server/config.ts @@ -132,6 +132,17 @@ if (!parsedConfig.success) { throw new Error(`Invalid configuration file: ${errors}`); } +const packageJsonPath = path.join(__DIRNAME, "..", "package.json"); +let packageJson: any; +if (fs.existsSync && fs.existsSync(packageJsonPath)) { + const packageJsonContent = fs.readFileSync(packageJsonPath, "utf8"); + packageJson = JSON.parse(packageJsonContent); + + if (packageJson.version) { + process.env.APP_VERSION = packageJson.version; + } +} + process.env.NEXT_PORT = parsedConfig.data.server.next_port.toString(); process.env.SERVER_EXTERNAL_PORT = parsedConfig.data.server.external_port.toString(); diff --git a/src/app/[orgId]/settings/general/page.tsx b/src/app/[orgId]/settings/general/page.tsx index e2b1f1fd..213542a5 100644 --- a/src/app/[orgId]/settings/general/page.tsx +++ b/src/app/[orgId]/settings/general/page.tsx @@ -139,7 +139,7 @@ export default function GeneralPage() { - + diff --git a/src/app/[orgId]/settings/share-links/components/CreateShareLinkForm.tsx b/src/app/[orgId]/settings/share-links/components/CreateShareLinkForm.tsx index f0e0f9c1..c5839621 100644 --- a/src/app/[orgId]/settings/share-links/components/CreateShareLinkForm.tsx +++ b/src/app/[orgId]/settings/share-links/components/CreateShareLinkForm.tsx @@ -63,6 +63,7 @@ import { Checkbox } from "@app/components/ui/checkbox"; import { GenerateAccessTokenResponse } from "@server/routers/accessToken"; import { constructShareLink } from "@app/lib/shareLinks"; import { ShareLinkRow } from "./ShareLinksTable"; +import { QRCodeSVG } from "qrcode.react"; type FormProps = { open: boolean; @@ -448,14 +449,24 @@ export default function CreateShareLinkForm({ {link && (

- You will be able to see this link once. + You will only be able to see this link once. Make sure to copy it.

Anyone with this link can access the resource. Share it with care.

- + +
+ +
+ +
+ +
)} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ad937aac..2271bcff 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,6 +4,7 @@ import { Figtree } from "next/font/google"; import { Toaster } from "@/components/ui/toaster"; import { ThemeProvider } from "@app/providers/ThemeProvider"; import EnvProvider from "@app/providers/EnvProvider"; +import { Separator } from "@app/components/ui/separator"; export const metadata: Metadata = { title: `Dashboard - Pangolin`, @@ -17,6 +18,8 @@ export default async function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { + const version = process.env.APP_VERSION; + return ( @@ -40,23 +43,33 @@ export default async function RootLayout({ {children} diff --git a/src/components/Enable2FaForm.tsx b/src/components/Enable2FaForm.tsx index a5402322..9266edca 100644 --- a/src/components/Enable2FaForm.tsx +++ b/src/components/Enable2FaForm.tsx @@ -203,11 +203,11 @@ export default function Enable2FaForm({ open, setOpen }: Enable2FaProps) { {step === 2 && (

- Scan this QR code with your authenticator app or + scan this qr code with your authenticator app or enter the secret key manually:

-
- +
+
- Forgot password? Click here + Forgot password?
diff --git a/src/components/ui/input.tsx b/src/components/ui/input.tsx index c822150b..2f4da515 100644 --- a/src/components/ui/input.tsx +++ b/src/components/ui/input.tsx @@ -1,24 +1,53 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; +import { EyeOff, Eye } from "lucide-react"; export type InputProps = React.InputHTMLAttributes; const Input = React.forwardRef( ({ className, type, ...props }, ref) => { - return ( - - ) - } -) -Input.displayName = "Input" + const [showPassword, setShowPassword] = React.useState(false); + const togglePasswordVisibility = () => setShowPassword(!showPassword); -export { Input } + console.log("type", type); + + return ( +
+ + {type === "password" && ( +
+ {showPassword ? ( + + ) : ( + + )} +
+ )} +
+ ); + } +); +Input.displayName = "Input"; + +export { Input };