@ -1,25 +1,20 @@
< mat-card class = "dashboard-card" >
< mat-expansion-panel >
< mat-expansion-panel-header >
< mat-card-title class = "card-container-left" >
Add WireGuard Server
< / mat-card-title >
< mat-card-title class = "card-container-right" >
< mat-panel-title >
< b > New WireGuard Server< / b >
< / mat-panel-title >
< input # confInput hidden = "true" type = "file" multiple onclick = "this.value=null" ( change ) = " parseFiles ( $ event ) " accept = ".conf" / >
< button
mat-flat-button
color="primary"
(click)="confInput.click()"
matTooltip="Import existing wireguard configuration. You can select both server and peer configuration. The number of imported peers are described near the submit button."
>Import Configuration< / button >
< / mat-card-title >
< mat-panel-description >
Expand this to open configuration of a new wireguard server
< / mat-panel-description >
< / mat-expansion-panel-header >
< mat-card-content class = "dashboard-card-content" >
< form [ formGroup ] = " serverForm " class = "add-server-form" >
< p > < b > Essentials < / b > < / p >
< p > < b > Network Configuration < / b > < / p >
< table class = "add-server-full-width" cellspacing = "0" > < tr >
< td >
@ -32,7 +27,7 @@
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Endpoint< / mat-label >
< input formControlName = "endpoint" matInput placeholder = "my-address.com ">
< input formControlName = "endpoint" matInput [ placeholder ] = " defaultEndpoint " >
< / mat-form-field >
< / td >
< td >
@ -41,12 +36,35 @@
< input formControlName = "listen_port" matInput [ placeholder ] = " defaultListenPort " >
< / mat-form-field >
< / td >
< / tr >
< tr >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Default DNS< / mat-label >
< input formControlName = "dns" matInput [ placeholder ] = " defaultIPv4Address " >
< / mat-form-field >
< / td >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Default allowed IPs< / mat-label >
< input formControlName = "allowed_ips" matInput [ placeholder ] = " defaultAllowedIPs " >
< / mat-form-field >
< / td >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Default PersistentKeepalive interval< / mat-label >
< input formControlName = "keep_alive" matInput [ placeholder ] = " defaultPersistentKeepalive " >
< / mat-form-field >
< / td >
< / tr >
< / tr > < / table >
< / table >
< p > < b > IPv4 Configuration< / b > < / p >
< table class = "add-server-full-width" cellspacing = "0" > < tr >
< td >
@ -69,15 +87,16 @@
< / tr > < / table >
< p > < b > IPv6 Configuration< / b > < / p >
< table class = "add-server-full-width" cellspacing = "0" > < tr >
< td >
< mat-checkbox [ checked ] = " true " # hasIPV6Support ( change ) = " ipv6SupportChanged ( $ event ) " > IPv6 Support< / mat-checkbox >
< mat-checkbox [ checked ] = " defaultHasIPV6Support " [ value ] = " defaultHasIPV6Support " ( change ) = " ipv6SupportChanged ( $ event ) " > IPv6 Support< / mat-checkbox >
< / td >
< / tr > < / table >
< table * ngIf = "hasIPV6Support.checked" class = "add-server-full-width" cellspacing = "0" > < tr >
< table class = "add-server-full-width" cellspacing = "0" > < tr >
< td >
< mat-form-field class = "add-server-full-width" >
@ -96,73 +115,56 @@
< / mat-form-field >
< / td >
< / tr > < / table >
< table class = "add-server-full-width" cellspacing = "0" > < tr >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Default DNS< / mat-label >
< input formControlName = "dns" matInput [ placeholder ] = " defaultIPv4Address " >
< / mat-form-field >
< / td >
< / tr >
< p > < b > Key-pairs< / b > < / p >
< div class = "button-row" >
< button type = "button" [ disabled ] = " ! isEdit " ( click ) = " getKeyPair ( ) " mat-raised-button color = "primary" >
< i class = "material-icons" > vpn_key< / i >
Generate KeyPair
< / button >
< / div >
< table class = "add-server-full-width" cellspacing = "0" >
< tr >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Default allowed IPs < / mat-label >
< input formControlName = "allowed_ips" matInput [ placeholder ] = " defaultAllowedIPs " >
< mat-label > Private-Key < / mat-label >
< input formControlName = "private_key" matInput >
< / mat-form-field >
< / td >
< / tr >
< tr >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Default PersistentKeepalive interval < / mat-label >
< input formControlName = "keep_alive" matInput [ placeholder ] = " defaultPersistentKeepalive " >
< mat-label > Public-Key < / mat-label >
< input formControlName = "public_key" matInput >
< / mat-form-field >
< / td >
< / tr >
< / table >
< p > < b > Keys< / b > < / p >
< p >
< mat-form-field class = "add-server-full-width" >
< mat-label > Private-Key< / mat-label >
< input formControlName = "private_key" matInput >
< / mat-form-field >
< / p >
< p >
< mat-form-field class = "add-server-full-width" >
< mat-label > Public-Key< / mat-label >
< input formControlName = "public_key" matInput >
< / mat-form-field >
< / p >
< div class = "button-row" >
< button type = "button" [ disabled ] = " ! isEdit " ( click ) = " getKeyPair ( ) " mat-raised-button color = "primary" >
< i class = "material-icons" > vpn_key< / i >
Generate KeyPair
< / button >
< / div >
< p > < b > Scripts< / b > < / p >
< p >
< table class = "add-server-full-width" cellspacing = "0" >
< tr >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Post-Up< / mat-label >
< input formControlName = "post_up" matInput >
< textarea formControlName = "post_up" matInput rows = "4" > < / textarea >
< / mat-form-field >
< / p >
< p >
< / td >
< / tr >
< tr >
< td >
< mat-form-field class = "add-server-full-width" >
< mat-label > Post-Down< / mat-label >
< input formControlName = "post_down" matInput >
< textarea formControlName = "post_down" matInput rows = "4" > < / textarea >
< / mat-form-field >
< / p >
< / td >
< / tr >
< / table >
< div class = "button-row" >
@ -180,6 +182,14 @@
Reset
< / button >
< input # confInput hidden = "true" type = "file" multiple onclick = "this.value=null" ( change ) = " parseFiles ( $ event ) " accept = ".conf" / >
< button
mat-raised-button
color="primary"
(click)="confInput.click()"
matTooltip="Import existing wireguard configuration. You can select both server and peer configuration. The number of imported peers are described near the submit button."
>Import Configuration< / button >
< div * ngIf = "this.serverForm.value['peers'] && this.serverForm.value['peers'].length > 0" >
Importing < b > {{this.serverForm.value['peers'].length}}< / b > peers.
< / div >
@ -191,5 +201,6 @@
< / mat-card-content >
< / mat-card >
< / mat-expansion-panel >