import NodeLimitContainer from '@/components/admin/nodes/NodeLimitContainer'; import NodeListenContainer from '@/components/admin/nodes/NodeListenContainer'; import NodeSettingsContainer from '@/components/admin/nodes/NodeSettingsContainer'; import Button from '@/components/elements/Button'; import FlashMessageRender from '@/components/FlashMessageRender'; import { ApplicationStore } from '@/state'; import { Actions, useStoreActions } from 'easy-peasy'; import { Form, Formik, FormikHelpers } from 'formik'; import React from 'react'; import { useHistory } from 'react-router-dom'; import tw from 'twin.macro'; import AdminContentBlock from '@/components/admin/AdminContentBlock'; import { number, object, string } from 'yup'; import createNode, { Values } from '@/api/admin/nodes/createNode'; type Values2 = Omit, 'public'> & { behindProxy: string; public: string }; const initialValues: Values2 = { name: '', locationId: 0, databaseHostId: null, fqdn: '', scheme: 'https', behindProxy: 'false', public: 'true', daemonBase: '/var/lib/pterodactyl/volumes', listenPortHTTP: 8080, publicPortHTTP: 8080, listenPortSFTP: 2022, publicPortSFTP: 2022, memory: 0, memoryOverallocate: 0, disk: 0, diskOverallocate: 0, }; export default () => { const history = useHistory(); const { clearFlashes, clearAndAddHttpError } = useStoreActions((actions: Actions) => actions.flashes); const submit = (values2: Values2, { setSubmitting }: FormikHelpers) => { clearFlashes('node:create'); const values: Values = { ...values2, behindProxy: values2.behindProxy === 'true', public: values2.public === 'true' }; createNode(values) .then(node => history.push(`/admin/nodes/${node.id}`)) .catch(error => { console.error(error); clearAndAddHttpError({ key: 'node:create', error }); }) .then(() => setSubmitting(false)); }; return (

Create Node

Add a new node to the panel.

{ ({ isSubmitting, isValid }) => (
) }
); };