[FEATURE] Live Modifications, Host Safety, Minor Tweaks (#19)

Co-authored-by: Dunemask <dunemask@gmail.com>
Reviewed-on: https://gitea.dunemask.dev/elysium/minecluster/pulls/19
This commit is contained in:
dunemask 2024-02-13 05:09:18 +00:00
parent 0a0f9c8463
commit fc60df27ac
9 changed files with 154 additions and 31 deletions

View file

@ -3,7 +3,8 @@ import TextField from "@mui/material/TextField";
import Autocomplete from "@mui/material/Autocomplete";
import Chip from "@mui/material/Chip";
const validatePort = (p) => p !== "25565" && p !== "25575" && p.length < 6;
const validatePort = (p) =>
p !== "25565" && p !== "25575" && p.length < 6 && parseInt(p) < 60_000;
export default function ExtraPortsOption(props) {
const { extraPorts: initExtraPorts } = props;
@ -30,7 +31,14 @@ export default function ExtraPortsOption(props) {
value={extraPorts}
onChange={portChange}
freeSolo
renderInput={(p) => <TextField {...p} label="Extra Ports" />}
renderInput={(p) => (
<TextField
{...p}
label="Extra Ports"
helperText="Remember to press enter to add the port!"
FormHelperTextProps={{ sx: { ml: 0 } }}
/>
)}
renderTags={(value, getTagProps) =>
value.map((option, index) => {
const defaultChipProps = getTagProps({ index });