Private GIT

Skip to content
Snippets Groups Projects
Commit aa71b15d authored by Christoph Haas's avatar Christoph Haas
Browse files

Remove characters from the name of the config-file that prevent it from being...

Remove characters from the name of the config-file that prevent it from being imported into WireGuard apps
parent 8b4038c2
No related branches found
No related tags found
No related merge requests found
......@@ -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>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment