[FEATURE] Storage adjustments and minor tweaks (#9)
Co-authored-by: Dunemask <dunemask@gmail.com> Reviewed-on: https://gitea.dunemask.dev/elysium/minecluster/pulls/9
This commit is contained in:
parent
3d73f69678
commit
43c4409498
13 changed files with 121 additions and 39 deletions
|
@ -35,6 +35,7 @@ export default function EditCoreOptions(props) {
|
|||
const { serverId } = props;
|
||||
const [spec, setSpec] = useState();
|
||||
const modifyServer = useModifyServer(spec);
|
||||
const nav = useNavigate();
|
||||
const { isLoading, data: serverBlueprint } = useGetServer(serverId);
|
||||
|
||||
useEffect(() => setSpec(serverBlueprint), [serverBlueprint]);
|
||||
|
@ -47,9 +48,7 @@ export default function EditCoreOptions(props) {
|
|||
|
||||
const coreUpdate = (attr) => (e) => updateSpec(attr, e.target.value);
|
||||
|
||||
const upsertSpec = () => {
|
||||
modifyServer(spec);
|
||||
};
|
||||
const upsertSpec = () => modifyServer().then(() => nav("/"));
|
||||
|
||||
const toggleBackupEnabled = () =>
|
||||
updateSpec("backupEnabled", !spec.backupEnabled);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue