Skip to content

Commit

Permalink
fix: Validation of node names and location to match hass requirements #…
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Apr 3, 2020
1 parent 5309dbb commit fa0af36
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,17 @@ export default {
val || this.closeDialog()
},
newName (val) {
this.nameError = /["+*\s]+/g.test(val)
? 'Remove " + * and blank space characters'
var match = val.match(/[a-zA-Z0-9_-]+/g)
this.nameError = match[0] !== val
? 'Only a-zA-Z0-9_- chars are allowed'
: null
},
newLoc (val) {
this.locError = /["+*\s]+/g.test(val)
? 'Remove " + * and blank space characters'
var match = val.match(/[a-zA-Z0-9_-]+/g)
this.locError = match[0] !== val
? 'Only a-zA-Z0-9_- chars are allowed'
: null
},
selectedNode () {
Expand Down

0 comments on commit fa0af36

Please sign in to comment.