various small fixes

This commit is contained in:
miloschwartz
2025-04-29 22:59:38 -04:00
parent 3ebc01df8c
commit 237960fc5b
11 changed files with 122 additions and 43 deletions

View File

@@ -56,12 +56,16 @@ import { MinusCircle, PlusCircle } from "lucide-react";
import ConfirmDeleteDialog from "@app/components/ConfirmDeleteDialog";
import { SitePriceCalculator } from "./components/SitePriceCalculator";
import Link from "next/link";
import { Checkbox } from "@app/components/ui/checkbox";
const formSchema = z.object({
licenseKey: z
.string()
.nonempty({ message: "License key is required" })
.max(255)
.max(255),
agreeToTerms: z.boolean().refine((val) => val === true, {
message: "You must agree to the license terms"
})
});
function obfuscateLicenseKey(key: string): string {
@@ -95,7 +99,8 @@ export default function LicensePage() {
const form = useForm<z.infer<typeof formSchema>>({
resolver: zodResolver(formSchema),
defaultValues: {
licenseKey: ""
licenseKey: "",
agreeToTerms: false
}
});
@@ -265,6 +270,39 @@ export default function LicensePage() {
</FormItem>
)}
/>
<FormField
control={form.control}
name="agreeToTerms"
render={({ field }) => (
<FormItem className="flex flex-row items-start space-x-3 space-y-0">
<FormControl>
<Checkbox
checked={field.value}
onCheckedChange={
field.onChange
}
/>
</FormControl>
<div className="space-y-1 leading-none">
<FormLabel>
I have read and agree to the
Fossorial Commercial License
- Professional Edition
Subscription Terms.{" "}
<Link
href="https://docs.fossorial.io/license.html"
target="_blank"
rel="noopener noreferrer"
className="text-primary hover:underline"
>
View License & Terms
</Link>
</FormLabel>
<FormMessage />
</div>
</FormItem>
)}
/>
</form>
</Form>
</CredenzaBody>
@@ -305,8 +343,7 @@ export default function LicensePage() {
<p>
<b>
This will remove the license key and all
associated permissions. Any sites using this
license key will no longer be accessible.
associated permissions granted by it.
</b>
</p>
<p>