feat: change hooks to textareas (#2522)
* hooks are now textareas * remove newlines in client config
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// ! Auto Imports are not supported in this file
|
||||
|
||||
import type { InterfaceType } from '#db/repositories/interface/types';
|
||||
|
||||
/**
|
||||
@@ -9,6 +11,10 @@ export function template(templ: string, values: Record<string, string>) {
|
||||
});
|
||||
}
|
||||
|
||||
export function removeNewlines(templ: string) {
|
||||
return templ.replace(/\r\n|\r|\n/g, ' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Available keys:
|
||||
* - ipv4Cidr: IPv4 CIDR
|
||||
@@ -18,7 +24,7 @@ export function template(templ: string, values: Record<string, string>) {
|
||||
* - uiPort: UI port number
|
||||
*/
|
||||
export function iptablesTemplate(templ: string, wgInterface: InterfaceType) {
|
||||
return template(templ, {
|
||||
return template(removeNewlines(templ), {
|
||||
ipv4Cidr: wgInterface.ipv4Cidr,
|
||||
ipv6Cidr: wgInterface.ipv6Cidr,
|
||||
device: wgInterface.device,
|
||||
|
||||
Reference in New Issue
Block a user