diff --git a/ui/App/components/ConfigContent.jsx b/ui/App/components/ConfigContent.jsx index be050e1..96279cb 100644 --- a/ui/App/components/ConfigContent.jsx +++ b/ui/App/components/ConfigContent.jsx @@ -31,7 +31,21 @@ class ConfigContent extends React.Component { var change = this.state.serverSettings; if (e.target.value === "true" || e.target.value === "false") { + // Ensure Boolean type is used if required + if (e.target.id === "lan" || e.target.id === "public") { + if (e.target.value == "true") { + fieldValue = true + } else { + fieldValue = false + } + change["visibility"][e.target.id] = fieldValue + this.setState({serverSettings: change}); + return; + } fieldValue = Boolean(e.target.value) + } else if (e.target.id === "admins" || e.target.id === "tags") { + // Split settings values that are stored as arrays + fieldValue = e.target.value.split(",") } else { fieldValue = e.target.value } @@ -105,66 +119,78 @@ class ConfigContent extends React.Component { switch(typeof setting) { case "number": return ( - + ) case "string": if (key.includes("password")) { return ( - + ) } else { return ( - + ) } case "boolean": - console.log(key) return ( - + ) case "object": if (Array.isArray(setting)) { return ( - + ) } else { - if (Object.keys(setting).length > 0) { - //this.formTypeField(key, setting); + if (key.includes("visibility")) { + let vis_fields = [] + for (const key in setting) { + const field = +
{key}
+ +