ui(admin): fix egg creation
This commit is contained in:
parent
6f5fb09c13
commit
3721b2007b
9 changed files with 1224 additions and 1142 deletions
|
@ -27,8 +27,6 @@ class EggController extends ApplicationApiController
|
||||||
public function __construct(private EggExporterService $eggExporterService)
|
public function __construct(private EggExporterService $eggExporterService)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->eggExporterService = $eggExporterService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -78,6 +78,9 @@ class Egg extends Model
|
||||||
* Fields that are not mass assignable.
|
* Fields that are not mass assignable.
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
|
'nest_id',
|
||||||
|
'author',
|
||||||
|
'uuid',
|
||||||
'name',
|
'name',
|
||||||
'description',
|
'description',
|
||||||
'features',
|
'features',
|
||||||
|
|
|
@ -162,7 +162,7 @@ class Server extends Model
|
||||||
'allocation_id' => 'required|bail|unique:servers|exists:allocations,id',
|
'allocation_id' => 'required|bail|unique:servers|exists:allocations,id',
|
||||||
'nest_id' => 'required|exists:nests,id',
|
'nest_id' => 'required|exists:nests,id',
|
||||||
'egg_id' => 'required|exists:eggs,id',
|
'egg_id' => 'required|exists:eggs,id',
|
||||||
'startup' => 'required|string',
|
'startup' => 'nullable|string',
|
||||||
'skip_scripts' => 'sometimes|boolean',
|
'skip_scripts' => 'sometimes|boolean',
|
||||||
'image' => 'required|string|max:191',
|
'image' => 'required|string|max:191',
|
||||||
'database_limit' => 'present|nullable|integer|min:0',
|
'database_limit' => 'present|nullable|integer|min:0',
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@7.26.3",
|
"packageManager": "pnpm@8.7.6",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.13"
|
"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_files: egg.configFiles,
|
||||||
config_startup: egg.configStartup,
|
config_startup: egg.configStartup,
|
||||||
config_stop: egg.configStop,
|
config_stop: egg.configStop,
|
||||||
config_from: egg.configFrom,
|
|
||||||
startup: egg.startup,
|
startup: egg.startup,
|
||||||
script_container: egg.scriptContainer,
|
script_container: egg.scriptContainer,
|
||||||
copy_script_from: egg.copyScriptFrom,
|
|
||||||
script_entry: egg.scriptEntry,
|
script_entry: egg.scriptEntry,
|
||||||
script_is_privileged: egg.scriptIsPrivileged,
|
|
||||||
script_install: egg.scriptInstall,
|
script_install: egg.scriptInstall,
|
||||||
|
// config_from: egg.configFrom,
|
||||||
|
// copy_script_from: egg.copyScriptFrom,
|
||||||
|
// script_is_privileged: egg.scriptIsPrivileged,
|
||||||
})
|
})
|
||||||
.then(({ data }) => resolve(rawDataToEgg(data)))
|
.then(({ data }) => resolve(rawDataToEgg(data)))
|
||||||
.catch(reject);
|
.catch(reject);
|
||||||
|
|
|
@ -43,15 +43,15 @@ export interface Egg {
|
||||||
configFiles: Record<string, any> | null;
|
configFiles: Record<string, any> | null;
|
||||||
configStartup: Record<string, any> | null;
|
configStartup: Record<string, any> | null;
|
||||||
configStop: string | null;
|
configStop: string | null;
|
||||||
configFrom: number | null;
|
|
||||||
startup: string;
|
startup: string;
|
||||||
scriptContainer: string;
|
scriptContainer: string;
|
||||||
copyScriptFrom: number | null;
|
|
||||||
scriptEntry: string;
|
scriptEntry: string;
|
||||||
scriptIsPrivileged: boolean;
|
|
||||||
scriptInstall: string | null;
|
scriptInstall: string | null;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
|
// configFrom: number | null;
|
||||||
|
// copyScriptFrom: number | null;
|
||||||
|
// scriptIsPrivileged: boolean;
|
||||||
|
|
||||||
relations: {
|
relations: {
|
||||||
nest?: Nest;
|
nest?: Nest;
|
||||||
|
|
|
@ -64,11 +64,11 @@ function InternalForm() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form>
|
<Form>
|
||||||
<div css={tw`grid grid-cols-2 gap-y-6 gap-x-8 mb-16`}>
|
<div className="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-1 gap-y-6 col-span-2 md:col-span-1">
|
||||||
<BaseSettingsBox>
|
<BaseSettingsBox>
|
||||||
<NodeSelect node={node} setNode={setNode} />
|
<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
|
<FormikSwitch
|
||||||
name={'startOnCompletion'}
|
name={'startOnCompletion'}
|
||||||
label={'Start after installation'}
|
label={'Start after installation'}
|
||||||
|
|
|
@ -82,14 +82,14 @@ export function ServerServiceContainer({
|
||||||
const [nestId, setNestId] = useState<number>(_nestId);
|
const [nestId, setNestId] = useState<number>(_nestId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminBox title={'Service Configuration'} isLoading={isSubmitting} css={tw`w-full`}>
|
<AdminBox title={'Service Configuration'} isLoading={isSubmitting} className="w-full">
|
||||||
<div css={tw`mb-6`}>
|
<div className="mb-6">
|
||||||
<NestSelector selectedNestId={nestId} onNestSelect={setNestId} />
|
<NestSelector selectedNestId={nestId} onNestSelect={setNestId} />
|
||||||
</div>
|
</div>
|
||||||
<div css={tw`mb-6`}>
|
<div className="mb-6">
|
||||||
<EggSelect nestId={nestId} selectedEggId={egg?.id} onEggSelect={setEgg} />
|
<EggSelect nestId={nestId} selectedEggId={egg?.id} onEggSelect={setEgg} />
|
||||||
</div>
|
</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™'} />
|
<FormikSwitch name={'skipScripts'} label={'Skip Egg Install Script'} description={'Soon™'} />
|
||||||
</div>
|
</div>
|
||||||
</AdminBox>
|
</AdminBox>
|
||||||
|
|
Loading…
Reference in a new issue