<%
local api = require "luci.passwall.api"
-%>
<div class="cbi-section cbi-tblsection">
	<div id="dns_div">
		<ul><b style="color:red"><%:About DNS issues:%></b>
			<li style="color:red">1. <span><%:Some browsers may have built-in DNS, be sure to close. Example: Chrome. Settings - Security and Privacy - Security - Use secure DNS disabled.%></span></li>
			<li style="color:red">2. <span><%:Sometimes after restart, you can not internet, especially the GFW mode. At this time, close all browsers (important), Windows Client, please `ipconfig /flushdns`. Please close the WiFi on the phone, cut the flight mode and then cut back.%></span></li>
			<li style="color:red">3. <span><%:The client DNS and the default gateway must point to this router.%></span></li>
			<li style="color:red">4. <span><%:If you have a wrong DNS process, the consequences are at your own risk!%></span></li>
		</ul>
	</div>
	<div id="div2"></div>
</div>

<script>
	var origin = window.location.origin;
	var reset_url = origin + "<%=api.url("reset_config")%>";
	var hide_url = origin + "<%=api.url("hide")%>";
	var show_url = origin + "<%=api.url("show")%>";

	function reset(url) {
		if (confirm('<%:Are you sure to reset?%>') == true) {
			window.location.href = reset_url;
		}
	}

	function hide(url) {
		if (confirm('<%:Are you sure to hide?%>') == true) {
			window.location.href = hide_url;
		}
	}

	var dom = document.getElementById("div2");
	if (dom) {
		var li = "";
		li += "<%:You can use load balancing for failover.%>" + "<br />";
		li += "<%:Restore the default configuration method. Input example in the address bar:%>" + "<a href='#' onclick='reset()'>" + reset_url + "</a>" + "<br />";
		li += "<%:Hide menu method, input example in the address bar:%>" + "<a href='#' onclick='hide()'>" + hide_url + "</a>" + "<br />";
		li += "<%:After the hidden to the display, input example in the address bar:%>" + "<a href='#'>" + show_url + "</a>" + "<br />";
		dom.innerHTML = li;
	}
</script>
