"use client"; import { FormControl, FormField, FormItem, FormLabel, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Switch } from "@/components/ui/switch"; import { Textarea } from "@/components/ui/textarea"; import { KeygenProduct, PolicyFormData } from "@/lib/types"; import { UseFormReturn } from "react-hook-form"; interface Props { form: UseFormReturn; products: KeygenProduct[] | undefined; isNew: boolean; } function PolicyForm({ form, products, isNew }: Props) { return ( <> {/* Basic Information */}

Basic Information

{/* Name */} ( Name * )} /> {/* Duration */} ( Duration (seconds) )} /> {/* Product - Disabled during updates */} ( Product * {!isNew && (

Product cannot be changed after creation

)}
)} /> {/* Scheme - Disabled during updates */} ( Encryption Scheme * {!isNew && (

Encryption scheme cannot be changed after creation

)}
)} />
{/* Basic Switches */}

Basic Settings

(
Strict
Enable strict validation
)} /> (
Floating
Allow floating licenses
)} /> (
Encrypted
Encrypt license keys
)} /> (
Protected
Enable additional protection
)} /> (
Use Pool
Enable license pooling
)} />
{/* Scope Requirements */}

Scope Requirements

(
Product Scope
)} /> (
Policy Scope
)} /> (
Machine Scope
)} /> (
Fingerprint Scope
)} /> (
Components Scope
)} /> (
User Scope
)} /> (
Checksum Scope
)} /> (
Version Scope
)} />
{/* Limits */}

Resource Limits

( Max Machines )} /> ( Max Processes )} /> ( Max Users )} /> ( Max Cores )} /> ( Max Memory (MB) )} /> ( Max Disk (GB) )} /> ( Max Uses )} />
{/* Check-in Settings */}

Check-in Settings

(
Require Check-in
Require periodic check-ins
)} /> ( Check-in Interval (seconds) )} /> ( Check-in Interval Count )} />
{/* Heartbeat Settings */}

Heartbeat Settings

(
Require Heartbeat
Require periodic heartbeats
)} /> ( Heartbeat Duration (seconds) )} /> ( Heartbeat Cull Strategy )} /> ( Heartbeat Resurrection Strategy )} /> ( Heartbeat Basis )} />
{/* Strategy Settings */}

Strategy Settings

( Machine Uniqueness Strategy )} /> ( Machine Matching Strategy )} /> ( Component Uniqueness Strategy )} /> ( Component Matching Strategy )} /> ( Expiration Strategy )} /> ( Expiration Basis )} /> ( Renewal Basis )} /> ( Transfer Strategy )} /> ( Authentication Strategy )} /> ( Machine Leasing Strategy )} /> ( Process Leasing Strategy )} /> ( Overage Strategy )} />
{/* Metadata */}

Metadata

( Metadata (JSON)