mirror of
https://github.com/khairul169/vaulterm.git
synced 2025-04-29 00:59:40 +07:00
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import FormField from "@/components/ui/form";
|
|
import { MiscFormFieldProps } from "../types";
|
|
import { InputField } from "@/components/ui/input";
|
|
import { SelectField } from "@/components/ui/select";
|
|
import { pveTypes } from "../schema/form";
|
|
import { useKeychainsOptions } from "../hooks/query";
|
|
import CredentialsSection from "./credentials-section";
|
|
|
|
export const PVEFormFields = ({ form }: MiscFormFieldProps) => {
|
|
const keys = useKeychainsOptions();
|
|
|
|
return (
|
|
<>
|
|
<FormField label="Node">
|
|
<InputField form={form} name="metadata.node" placeholder="pve" />
|
|
</FormField>
|
|
<FormField label="Type">
|
|
<SelectField
|
|
form={form}
|
|
name="metadata.type"
|
|
placeholder="Select Type"
|
|
items={pveTypes}
|
|
/>
|
|
</FormField>
|
|
<FormField label="VMID">
|
|
<InputField
|
|
form={form}
|
|
name="metadata.vmid"
|
|
keyboardType="number-pad"
|
|
placeholder="VMID"
|
|
/>
|
|
</FormField>
|
|
|
|
<CredentialsSection type="pve" />
|
|
|
|
<FormField label="Account">
|
|
<SelectField
|
|
form={form}
|
|
name="keyId"
|
|
placeholder="Select Account"
|
|
items={keys.filter((i) => i.type === "pve")}
|
|
/>
|
|
</FormField>
|
|
</>
|
|
);
|
|
};
|