Fixed app naming error

This commit is contained in:
frikky
2020-08-24 09:24:47 +02:00
parent 70cb64925c
commit 2ba9f7ce88
2 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -6012,7 +6012,7 @@ func verifySwagger(resp http.ResponseWriter, request *http.Request) {
if err != nil {
log.Printf("Docker build error: %s", err)
resp.WriteHeader(500)
resp.Write([]byte(fmt.Sprintf(`{"success": true, "reason": "Error in Docker build"}`)))
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Error in Docker build"}`)))
return
}
+16 -1
View File
@@ -1569,7 +1569,22 @@ const AppCreator = (props) => {
margin="normal"
variant="outlined"
value={name}
onChange={e => setName(e.target.value)}
onChange={e => {
const invalid = ["#", ":", "."]
for (var key in invalid) {
if (e.target.value.includes(invalid[key])) {
alert.error("Can't use "+invalid[key]+" in name")
return
}
}
if (e.target.value.length > 100) {
alert.error("Choose a shorter name.")
return
}
setName(e.target.value)
}}
color="primary"
InputProps={{
style:{