Commit eee23c2a authored by Janis Streib's avatar Janis Streib 🦉
Browse files

FIXUP: numeric check

parent 3e1d8d8f
Pipeline #117692 passed with stages
in 6 minutes and 32 seconds
...@@ -346,7 +346,7 @@ export default { ...@@ -346,7 +346,7 @@ export default {
this.descriminator = this.getSearchDiscriminator() this.descriminator = this.getSearchDiscriminator()
const term = this.cutDescriminator().trim() const term = this.cutDescriminator().trim()
const termIsIP = ipaddress.isValid(term.split('/')[0]) const termIsIP = ipaddress.isValid(term.split('/')[0])
const termIsNumeric = !isNaN(parseInt(term)) const termIsNumeric = /^(0|[1-9][0-9]*)$/.test(term)
if (this.descriminator == null) { // Nur is_own, ohne regex if (this.descriminator == null) { // Nur is_own, ohne regex
if (termIsNumeric) { if (termIsNumeric) {
this.dispatch_search(SearchService.searchVlan(this.$store.state.netdb_axios_config, parseInt(term)), 'nd.vlan') this.dispatch_search(SearchService.searchVlan(this.$store.state.netdb_axios_config, parseInt(term)), 'nd.vlan')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment