Simplify RAM management
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -279,14 +279,16 @@ function VMDetailsTabGeneral(p: DetailsInnerProps): React.ReactElement {
|
||||
label="Memory (MB)"
|
||||
editable={p.editable}
|
||||
type="number"
|
||||
value={p.vm.memory.toString()}
|
||||
value={Math.floor(p.vm.memory / (1000 * 1000)).toString()}
|
||||
onValueChange={(v) => {
|
||||
p.vm.memory = Number(v ?? "0");
|
||||
p.vm.memory = Number(v ?? "0") * 1000 * 1000;
|
||||
p.onChange?.();
|
||||
}}
|
||||
checkValue={(v) =>
|
||||
Number(v) > ServerApi.Config.constraints.memory_size.min &&
|
||||
Number(v) < ServerApi.Config.constraints.memory_size.max
|
||||
Number(v) >
|
||||
ServerApi.Config.constraints.memory_size.min / (1000 * 1000) &&
|
||||
Number(v) <
|
||||
ServerApi.Config.constraints.memory_size.max / (1000 * 1000)
|
||||
}
|
||||
/>
|
||||
|
||||
|
Reference in New Issue
Block a user