<%
local api = require "luci.passwall2.api"
-%>
<script type="text/javascript">
	//<![CDATA[
	function clear_log(btn) {
		XHR.get('<%=api.url("server_clear_log")%>', null,
			function(x, data) {
				if(x && x.status == 200) {
					var log_textarea = document.getElementById('log_textarea');
					log_textarea.innerHTML = "";
					log_textarea.scrollTop = log_textarea.scrollHeight;
				}
			}
		);
	}
	XHR.poll(3, '<%=api.url("server_get_log")%>', null,
		function(x, data) {
			if(x && x.status == 200) {
				va