diff --git a/js/tool.js b/js/tool.js index 1bfdaae..d4276e7 100644 --- a/js/tool.js +++ b/js/tool.js @@ -75,6 +75,7 @@ function saveDynamicDataToFile() { break; } } + var exclWifi = document.getElementById("exclWifi"); var fileString = "\n"; fileString += "\n"; @@ -96,6 +97,46 @@ function saveDynamicDataToFile() { } fileString += "" + document.getElementById("serverUrl").value + "\n"; fileString += "\n"; + fileString += "OnDemandRules\n"; + if (exclWifi.value != "") { + fileString += "\n"; + fileString += "\n"; + fileString += "Action\n"; + fileString += "Disconnect\n"; + fileString += "SSIDMatch\n" + fileString += "\n"; + exclWifi.value.split(/\s*,\s*/).forEach(function(wifiString) { + console.log(wifiString); + fileString += "" + wifiString + "\n"; + }); + fileString += "\n"; + fileString += "\n"; + fileString += "\n"; + fileString += "Action\n"; + fileString += "Connect\n"; + fileString += "\n"; + } + if (document.getElementById("useWifi").checked) { + fileString += "\n"; + fileString += "Action\n"; + fileString += "Connect\n"; + fileString += "InterfaceTypeMatch\n"; + fileString += "WiFi\n"; + fileString += "\n"; + } + if (document.getElementById("useCell").checked) { + fileString += "\n"; + fileString += "Action\n"; + fileString += "Connect\n"; + fileString += "InterfaceTypeMatch\n"; + fileString += "Cellular\n"; + fileString += "\n"; + } + fileString += "\n"; + fileString += "Action\n"; + fileString += "Disconnect\n"; + fileString += "\n"; + fileString += "\n"; fileString += "PayloadDescription\n"; fileString += "Configures device to use " + provName + " Encrypted DNS over " + encValue + "\n"; fileString += "PayloadDisplayName\n"; @@ -109,7 +150,12 @@ function saveDynamicDataToFile() { fileString += "PayloadVersion\n"; fileString += "1\n"; fileString += "ProhibitDisablement\n"; - fileString += "\n"; + if (document.getElementById("lockProfile").checked) { + fileString += "\n"; + } + else { + fileString += "\n"; + } fileString += "\n"; fileString += "\n"; fileString += "PayloadDescription\n"; @@ -165,4 +211,15 @@ function loadPremade() { dns1v6.value = getCookie("dns1v6"); dns2v6.value = getCookie("dns2v6"); serverUrl.value = getCookie("serverUrl"); +} +function accordion() { + var adv = document.getElementById("advanced_container"); + if (adv.className.indexOf("w3-show") == -1) { + adv.className += " w3-show"; + adv.previousElementSibling.className = adv.previousElementSibling.className.replace("w3-dark-grey", "w3-black"); + } + else { + adv.className = adv.className.replace(" w3-show", ""); + adv.previousElementSibling.className = adv.previousElementSibling.className.replace("w3-black", "w3-dark-grey"); + } } \ No newline at end of file diff --git a/tool.html b/tool.html index 17d72b9..309e3f9 100644 --- a/tool.html +++ b/tool.html @@ -52,7 +52,30 @@

- + +
+

+ + + Enter a comma-separated list of Wi-Fi networks (SSID) on which the encrypted DNS will be disabled. +

+

+ Interfaces to use encrypted DNS on: + + + + +
+ Untick to disable encrypted DNS when using WiFi/Cellular. +

+

+ + +
+ Prohibit users from removing the profile. Only available on supervised devices. +

+
+

\ No newline at end of file