Skip to content

Commit

Permalink
feature: Update wireguard config generator to include block lists, im…
Browse files Browse the repository at this point in the history
…prove UI
  • Loading branch information
Natanael Rodriguez Ramos authored and Natanael Rodriguez Ramos committed Nov 28, 2023
1 parent 160e75c commit 4e6508d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
15 changes: 15 additions & 0 deletions src/themes/ivpn-v3/assets/js/styles/vpn-configuration.scss
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,19 @@
margin-top: 10px;
}
}

input[type=checkbox]{
vertical-align: middle;
}

label{
margin: 0 5px 0 5px;
}

@media only screen and (max-device-width: 600px){
.select{
margin-top:10px !important;
width:100% !important;
}
}
}
39 changes: 26 additions & 13 deletions src/themes/ivpn-v3/assets/js/views/Account/WireguardConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,17 @@
<div>
<input type="radio" name="dns" id="dns_antitracker" ref="dns_antitracker" value="antitracker" @change="selectDNS($event)">
<label for="dns_antitracker">AntiTracker </label>
<i></i>
<div class="select">
<select v-model="selectedBlockList">
<option v-for="(item, key) in antitrackerBlockLists" :value="item" :selected="true">{{item.Name}}</option>
</select>
<i></i>
</div>
<input id="hardcore_mode" type="checkbox" v-model="isDnsHardcore">
<label for="hardcore_mode">Hardcore Mode</label>
</div>


<div>
<input type="radio" name="dns" id="dns_hardcore" ref="dns_hardcore" value="hardcore" @change="selectDNS($event)">
<label for="dns_hardcore">AntiTracker + Hardcore mode</label>
</div>
<div class="search">
<input type="radio" name="dns" id="dns_custom" value="custom" @change="selectDNS($event)">
<label for="dns_custom">Custom DNS</label>
Expand Down Expand Up @@ -267,6 +265,7 @@ export default {
isLight : false,
antitrackerBlockLists: [],
selectedBlockList: null,
isDnsHardcore: false,
};
},
watch: {
Expand All @@ -289,13 +288,26 @@ export default {
},
selectedBlockList: {
handler: function (after, before) {
if(this.$refs.dns_hardcore.checked){
this.dns = after.Hardcore;
}else if(this.$refs.dns_antitracker.checked){
this.dns= after.Normal;
if( this.$refs.dns_antitracker.checked){
if(this.isDnsHardcore){
this.dns = after.Hardcore;
}else{
this.dns= after.Normal;
}
}
}
},
isDnsHardcore: {
handler: function (after, before) {
if( this.$refs.dns_antitracker.checked){
if(this.isDnsHardcore){
this.dns = this.selectedBlockList.Hardcore;
}else{
this.dns = this.selectedBlockList.Normal;
}
}
}
}
},
computed: {
...mapState({
Expand Down Expand Up @@ -512,10 +524,11 @@ export default {
this.dns = null;
break;
case "antitracker":
this.dns = this.selectedBlockList.Normal;
break;
case "hardcore":
this.dns = this.selectedBlockList.Hardcore;
if(this.isDnsHardcore){
this.dns = this.selectedBlockList.Hardcore;
}else{
this.dns = this.selectedBlockList.Normal;
}
break;
}
},
Expand Down

0 comments on commit 4e6508d

Please sign in to comment.