summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm
blob: 3e190709fbb09d93b3d00ed8da658deb5e501e76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

<!-- ++ BEGIN ++ Privoxy ++ detail_logview.htm ++ -->
<script type="text/javascript">//<![CDATA[
	function onclick_logview(section, bottom)  {
		// get elements
		var txt = document.getElementById("cbid.privoxy.privoxy._logview.txt");	// TextArea
		if ( !txt ) { return; }	// security check
		var lvXHR = new XHR();
		lvXHR.get('<%=luci.dispatcher.build_url("admin", "services", "privoxy", "logview")%>', null,
			function(x) {
				if (x.responseText == "_nodata_")
					txt.value = "<%:File not found or empty%>";
				else
					txt.value = x.responseText;
				if (bottom)
					txt.scrollTop = txt.scrollHeight;
				else
					txt.scrollTop = 0;			}
		);
	}
//]]></script>

<%+cbi/valueheader%>

<br />

<%
-- one button on top, one at the buttom
%>
<input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="onclick_logview(this.name, false)"
<%=
attr("name", section) .. attr("id", cbid .. ".btn1") .. attr("value", self.inputtitle)
%> />

<br /><br />

<%
-- set a readable style taken from openwrt theme for textarea#syslog
-- in openwrt theme there are problems with a width of 100 so we check for theme and set to lower value
%>
<textarea style="width: <%if media == "/luci-static/openwrt.org" then%>98.7%<%else%>100%<%end%> ; min-height: 500px; border: 3px solid #cccccc; padding: 5px; font-family: monospace; resize: none;" wrap="off" readonly="readonly"
<%=
attr("name", cbid .. ".txt") .. attr("id", cbid .. ".txt") .. ifattr(self.rows, "rows")
%> >
<%-=pcdata(self:cfgvalue(section))-%>
</textarea>
<br /><br />

<%
-- one button on top, one at the buttom
%>
<input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="onclick_logview(this.name, true)"
<%= attr("name", section) .. attr("id", cbid .. ".btn2") .. attr("value", self.inputtitle) %> />

<%+cbi/valuefooter%>
<!-- ++ END ++ Privoxy ++ detail_logview.htm ++ -->