mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-24 01:52:30 +01:00
ui(admin): fix egg creation
This commit is contained in:
parent
6f5fb09c13
commit
3721b2007b
@ -27,8 +27,6 @@ class EggController extends ApplicationApiController
|
||||
public function __construct(private EggExporterService $eggExporterService)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->eggExporterService = $eggExporterService;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,6 +78,9 @@ class Egg extends Model
|
||||
* Fields that are not mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'nest_id',
|
||||
'author',
|
||||
'uuid',
|
||||
'name',
|
||||
'description',
|
||||
'features',
|
||||
|
@ -162,7 +162,7 @@ class Server extends Model
|
||||
'allocation_id' => 'required|bail|unique:servers|exists:allocations,id',
|
||||
'nest_id' => 'required|exists:nests,id',
|
||||
'egg_id' => 'required|exists:eggs,id',
|
||||
'startup' => 'required|string',
|
||||
'startup' => 'nullable|string',
|
||||
'skip_scripts' => 'sometimes|boolean',
|
||||
'image' => 'required|string|max:191',
|
||||
'database_limit' => 'present|nullable|integer|min:0',
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@7.26.3",
|
||||
"packageManager": "pnpm@8.7.6",
|
||||
"engines": {
|
||||
"node": ">=16.13"
|
||||
},
|
||||
|
2331
pnpm-lock.yaml
2331
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
@ -14,13 +14,13 @@ export default (egg: Partial<Egg2>): Promise<Egg> => {
|
||||
config_files: egg.configFiles,
|
||||
config_startup: egg.configStartup,
|
||||
config_stop: egg.configStop,
|
||||
config_from: egg.configFrom,
|
||||
startup: egg.startup,
|
||||
script_container: egg.scriptContainer,
|
||||
copy_script_from: egg.copyScriptFrom,
|
||||
script_entry: egg.scriptEntry,
|
||||
script_is_privileged: egg.scriptIsPrivileged,
|
||||
script_install: egg.scriptInstall,
|
||||
// config_from: egg.configFrom,
|
||||
// copy_script_from: egg.copyScriptFrom,
|
||||
// script_is_privileged: egg.scriptIsPrivileged,
|
||||
})
|
||||
.then(({ data }) => resolve(rawDataToEgg(data)))
|
||||
.catch(reject);
|
||||
|
@ -43,15 +43,15 @@ export interface Egg {
|
||||
configFiles: Record<string, any> | null;
|
||||
configStartup: Record<string, any> | null;
|
||||
configStop: string | null;
|
||||
configFrom: number | null;
|
||||
startup: string;
|
||||
scriptContainer: string;
|
||||
copyScriptFrom: number | null;
|
||||
scriptEntry: string;
|
||||
scriptIsPrivileged: boolean;
|
||||
scriptInstall: string | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
// configFrom: number | null;
|
||||
// copyScriptFrom: number | null;
|
||||
// scriptIsPrivileged: boolean;
|
||||
|
||||
relations: {
|
||||
nest?: Nest;
|
||||
|
@ -64,11 +64,11 @@ function InternalForm() {
|
||||
|
||||
return (
|
||||
<Form>
|
||||
<div css={tw`grid grid-cols-2 gap-y-6 gap-x-8 mb-16`}>
|
||||
<div css={tw`grid grid-cols-1 gap-y-6 col-span-2 md:col-span-1`}>
|
||||
<div className="grid grid-cols-2 gap-y-6 gap-x-8 mb-16">
|
||||
<div className="grid grid-cols-1 gap-y-6 col-span-2 md:col-span-1">
|
||||
<BaseSettingsBox>
|
||||
<NodeSelect node={node} setNode={setNode} />
|
||||
<div css={tw`xl:col-span-2 bg-neutral-800 border border-neutral-900 shadow-inner p-4 rounded`}>
|
||||
<div className="xl:col-span-2 bg-neutral-800 border border-neutral-900 shadow-inner p-4 rounded">
|
||||
<FormikSwitch
|
||||
name={'startOnCompletion'}
|
||||
label={'Start after installation'}
|
||||
|
@ -82,14 +82,14 @@ export function ServerServiceContainer({
|
||||
const [nestId, setNestId] = useState<number>(_nestId);
|
||||
|
||||
return (
|
||||
<AdminBox title={'Service Configuration'} isLoading={isSubmitting} css={tw`w-full`}>
|
||||
<div css={tw`mb-6`}>
|
||||
<AdminBox title={'Service Configuration'} isLoading={isSubmitting} className="w-full">
|
||||
<div className="mb-6">
|
||||
<NestSelector selectedNestId={nestId} onNestSelect={setNestId} />
|
||||
</div>
|
||||
<div css={tw`mb-6`}>
|
||||
<div className="mb-6">
|
||||
<EggSelect nestId={nestId} selectedEggId={egg?.id} onEggSelect={setEgg} />
|
||||
</div>
|
||||
<div css={tw`bg-neutral-800 border border-neutral-900 shadow-inner p-4 rounded`}>
|
||||
<div className="bg-neutral-800 border border-neutral-900 shadow-inner p-4 rounded">
|
||||
<FormikSwitch name={'skipScripts'} label={'Skip Egg Install Script'} description={'Soon™'} />
|
||||
</div>
|
||||
</AdminBox>
|
||||
|
Loading…
Reference in New Issue
Block a user