<%
local api = require "luci.model.cbi.passwall.api.api"
-%>
<div class="cbi-section cbi-tblsection">
	<div id="tips_div"></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("tips_div");
	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>