diff --git a/ui/src/components/Clients.vue b/ui/src/components/Clients.vue index b06e238397e244480cc778163d286daef1a88201..305e69549992bc39ab9b9f7281accb7e40ef7098 100644 --- a/ui/src/components/Clients.vue +++ b/ui/src/components/Clients.vue @@ -601,10 +601,17 @@ const url = window.URL.createObjectURL(new Blob([config])) const link = document.createElement('a') link.href = url - link.setAttribute('download', client.name.split(' ').join('-') + '.conf') //or any other extension + link.setAttribute('download', this.getConfigFileName(client)) //or any other extension document.body.appendChild(link) link.click() }, + + getConfigFileName(client){ + let name = client.name.split(' ').join('-'); + // replace special chars + name = name.replace(/[^a-zA-Z0-9_-]+/g, ''); + return name + '.conf'; + }, } }; </script>