ui(admin): update server image when switching eggs

This commit is contained in:
Matthew Penner 2021-11-17 14:28:19 -07:00
parent 81ff03c2a3
commit 6e4e0bc0a4
No known key found for this signature in database
GPG Key ID: BAB67850901908A8

View File

@ -27,11 +27,13 @@ function ServerStartupLineContainer ({ egg, server }: { egg: Egg | null; server:
} }
if (server.eggId === egg.id) { if (server.eggId === egg.id) {
setFieldValue('image', server.container.image);
setFieldValue('startup', server.container.startup || ''); setFieldValue('startup', server.container.startup || '');
return; return;
} }
// Whenever the egg is changed, set the server's startup command to the egg's default. // Whenever the egg is changed, set the server's startup command to the egg's default.
setFieldValue('image', egg.dockerImages.length > 0 ? egg.dockerImages[0] : '');
setFieldValue('startup', ''); setFieldValue('startup', '');
}, [ egg ]); }, [ egg ]);