misc_pterodactyl-panel/resources/scripts/components/admin/nodes/NodeLimitContainer.tsx

59 lines
2.1 KiB
TypeScript
Raw Normal View History

2021-02-11 17:21:49 +00:00
import React from 'react';
import AdminBox from '@/components/admin/AdminBox';
import tw from 'twin.macro';
import Field from '@/components/elements/Field';
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
2021-03-23 23:47:24 +00:00
import { Form, useFormikContext } from 'formik';
2021-02-11 17:21:49 +00:00
export default () => {
2021-03-23 23:47:24 +00:00
const { isSubmitting } = useFormikContext();
2021-02-11 17:21:49 +00:00
return (
2021-03-23 23:47:24 +00:00
<AdminBox title={'Limits'} css={tw`w-full relative`}>
<SpinnerOverlay visible={isSubmitting}/>
2021-02-11 17:21:49 +00:00
2021-03-23 23:47:24 +00:00
<Form css={tw`mb-0`}>
<div css={tw`md:w-full md:flex md:flex-row mb-6`}>
<div css={tw`md:w-full md:flex md:flex-col md:mr-4 mb-6 md:mb-0`}>
<Field
id={'memory'}
name={'memory'}
label={'Memory'}
type={'number'}
/>
</div>
2021-02-11 17:21:49 +00:00
2021-03-23 23:47:24 +00:00
<div css={tw`md:w-full md:flex md:flex-col md:ml-4 mb-6 md:mb-0`}>
<Field
id={'memoryOverallocate'}
name={'memoryOverallocate'}
label={'Memory Overallocate'}
type={'number'}
/>
</div>
</div>
2021-02-11 17:21:49 +00:00
2021-03-23 23:47:24 +00:00
<div css={tw`md:w-full md:flex md:flex-row mb-6`}>
<div css={tw`md:w-full md:flex md:flex-col md:mr-4 mb-6 md:mb-0`}>
<Field
id={'disk'}
name={'disk'}
label={'Disk'}
type={'number'}
/>
</div>
2021-02-11 17:21:49 +00:00
2021-03-23 23:47:24 +00:00
<div css={tw`md:w-full md:flex md:flex-col md:ml-4 mb-6 md:mb-0`}>
<Field
id={'diskOverallocate'}
name={'diskOverallocate'}
label={'Disk Overallocate'}
type={'number'}
/>
</div>
</div>
</Form>
</AdminBox>
2021-02-11 17:21:49 +00:00
);
};