ui(admin): fix oom killer setting toggle

This commit is contained in:
Matthew Penner 2023-01-17 11:43:26 -07:00
parent f6cf4a1236
commit 450fba00bc
No known key found for this signature in database
10 changed files with 18 additions and 23 deletions

View file

@ -195,9 +195,7 @@ export default () => {
io: 500,
cpu: 0,
threads: '',
// This value is inverted to have the switch be on when the
// OOM Killer is enabled, rather than when disabled.
oomDisabled: false,
oomKiller: true,
},
featureLimits: {
allocations: 1,

View file

@ -23,10 +23,6 @@ export default () => {
const submit = (values: Values, { setSubmitting, setFieldValue }: FormikHelpers<Values>) => {
clearFlashes('server');
// This value is inverted to have the switch be on when the
// OOM Killer is enabled, rather than when disabled.
values.limits.oomDisabled = !values.limits.oomDisabled;
updateServer(server.id, values)
.then(() => {
// setServer({ ...server, ...s });
@ -58,7 +54,7 @@ export default () => {
threads: server.limits.threads || '',
// This value is inverted to have the switch be on when the
// OOM Killer is enabled, rather than when disabled.
oomDisabled: !server.limits.oomDisabled,
oomKiller: server.limits.oomKiller,
},
featureLimits: {
allocations: server.featureLimits.allocations,

View file

@ -60,7 +60,7 @@ export default () => {
/>
<div css={tw`xl:col-span-2 bg-neutral-800 border border-neutral-900 shadow-inner p-4 rounded`}>
<FormikSwitch
name={'limits.oomDisabled'}
name={'limits.oomKiller'}
label={'Out of Memory Killer'}
description={
'Enabling the Out of Memory Killer may cause server processes to exit unexpectedly.'