[FEATURE] Quality of Life Improvements for Management (#7)
Co-authored-by: Dunemask <dunemask@gmail.com> Reviewed-on: https://gitea.dunemask.dev/elysium/minecluster/pulls/7
This commit is contained in:
parent
6eb4ed3e95
commit
23efaafe1d
18 changed files with 479 additions and 39 deletions
|
@ -21,6 +21,7 @@ import CpuOption, {
|
|||
import MemoryOption, {
|
||||
memoryOptions,
|
||||
} from "@mcl/components/server-options/MemoryOption.jsx";
|
||||
import ExtraPortsOption from "@mcl/components/server-options/ExtraPortsOption.jsx";
|
||||
|
||||
import BackupHostOption from "@mcl/components/server-options/BackupHostOption.jsx";
|
||||
import BackupBucketOption from "@mcl/components/server-options/BackupBucketOption.jsx";
|
||||
|
@ -35,6 +36,7 @@ const defaultServer = {
|
|||
serverType: serverTypeOptions[0],
|
||||
cpu: cpuOptions[0],
|
||||
memory: memoryOptions[2], // 1.5GB
|
||||
extraPorts: [],
|
||||
};
|
||||
|
||||
export default function CreateCoreOptions() {
|
||||
|
@ -79,7 +81,6 @@ export default function CreateCoreOptions() {
|
|||
).toLowerCase()}`);
|
||||
} else for (var k in s) if (k.startsWith("backup")) delete s[k];
|
||||
setSpec(s);
|
||||
console.log(s);
|
||||
setBackupEnabled(!backupEnabled);
|
||||
};
|
||||
|
||||
|
@ -98,6 +99,7 @@ export default function CreateCoreOptions() {
|
|||
/>
|
||||
<CpuOption value={spec.cpu} onChange={coreUpdate("cpu")} />
|
||||
<MemoryOption value={spec.memory} onChange={coreUpdate("memory")} />
|
||||
<ExtraPortsOption onChange={updateSpec} />
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import { useState, useEffect } from "react";
|
||||
import { useSearchParams, useNavigate } from "react-router-dom";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Toolbar from "@mui/material/Toolbar";
|
||||
import FilePreview, {
|
||||
useFilePreview,
|
||||
} from "@mcl/components/files/FilePreview.jsx";
|
||||
|
@ -18,14 +16,15 @@ export default function Files() {
|
|||
if (!currentServer) nav("/");
|
||||
}, [currentServer]);
|
||||
|
||||
function changePreview(name, fileData) {
|
||||
setPreviewData({ name, fileData });
|
||||
function changePreview(name, fileData, filePath) {
|
||||
setPreviewData({ name, fileData, filePath });
|
||||
dialogToggle();
|
||||
}
|
||||
|
||||
return (
|
||||
<Box className="edit" sx={{ height: "100%" }}>
|
||||
<FilePreview
|
||||
server={currentServer}
|
||||
open={open}
|
||||
dialogToggle={dialogToggle}
|
||||
previewData={previewData}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue