ui(admin): start work on egg install settings

This commit is contained in:
Matthew Penner 2021-09-13 00:07:09 -06:00
parent a615b7fa70
commit a92f3648b2
No known key found for this signature in database
GPG key ID: 030E4AB751DC756F
2 changed files with 7 additions and 12 deletions

View file

@ -39,11 +39,11 @@ export const rawDataToEgg = ({ attributes }: FractalResponseData): Egg => ({
configStop: attributes.config_stop,
configFrom: attributes.config_from,
startup: attributes.startup,
scriptContainer: attributes.script_container,
copyScriptFrom: attributes.copy_script_from,
scriptEntry: attributes.script_entry,
scriptIsPrivileged: attributes.script_is_privileged,
scriptInstall: attributes.script_install,
scriptContainer: attributes.script?.container,
scriptEntry: attributes.script?.entry,
scriptIsPrivileged: attributes.script?.privileged,
scriptInstall: attributes.script?.install,
createdAt: new Date(attributes.created_at),
updatedAt: new Date(attributes.updated_at),
});

View file

@ -9,11 +9,6 @@ import Input from '@/components/elements/Input';
import Label from '@/components/elements/Label';
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
const initialContent = `#!/bin/ash
curl -s https://cdn.pterodactyl.io/releases/latest.json | jq
`;
export default () => {
const egg = Context.useStoreState(state => state.egg);
@ -28,19 +23,19 @@ export default () => {
<div css={tw`relative pb-4`}>
<SpinnerOverlay visible={false}/>
<Editor overrides={tw`h-96 mb-4`} initialContent={initialContent} mode={shell}/>
<Editor overrides={tw`h-96 mb-4`} initialContent={egg.scriptInstall || ''} mode={shell}/>
<div css={tw`mx-6 mb-4`}>
<div css={tw`grid grid-cols-3 gap-x-8 gap-y-6`}>
<div>
<Label>Install Container</Label>
<Input type="text" defaultValue={'ghcr.io/pterodactyl/installers:alpine'}/>
<Input type="text" defaultValue={egg.scriptContainer}/>
<p className={'input-help'}>The Docker image to use for running this installation script.</p>
</div>
<div>
<Label>Install Entrypoint</Label>
<Input type="text" defaultValue={'/bin/ash'}/>
<Input type="text" defaultValue={egg.scriptEntry}/>
<p className={'input-help'}>The command that should be used to run this script inside of the installation container.</p>
</div>
</div>