You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.9 KiB

  1. <!-- ++ BEGIN ++ Privoxy ++ detail_logview.htm ++ -->
  2. <script type="text/javascript">//<![CDATA[
  3. function onclick_logview(section, bottom) {
  4. // get elements
  5. var txt = document.getElementById("cbid.privoxy.privoxy._logview.txt"); // TextArea
  6. if ( !txt ) { return; } // security check
  7. var lvXHR = new XHR();
  8. lvXHR.get('<%=luci.dispatcher.build_url("admin", "services", "privoxy", "logview")%>', null,
  9. function(x) {
  10. if (x.responseText == "_nodata_")
  11. txt.value = "<%:File not found or empty%>";
  12. else
  13. txt.value = x.responseText;
  14. if (bottom)
  15. txt.scrollTop = txt.scrollHeight;
  16. else
  17. txt.scrollTop = 0; }
  18. );
  19. }
  20. //]]></script>
  21. <%+cbi/valueheader%>
  22. <br />
  23. <%
  24. -- one button on top, one at the buttom
  25. %>
  26. <input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="onclick_logview(this.name, false)"
  27. <%=
  28. attr("name", section) .. attr("id", cbid .. ".btn1") .. attr("value", self.inputtitle)
  29. %> />
  30. <br /><br />
  31. <%
  32. -- set a readable style taken from openwrt theme for textarea#syslog
  33. -- in openwrt theme there are problems with a width of 100 so we check for theme and set to lower value
  34. %>
  35. <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"
  36. <%=
  37. attr("name", cbid .. ".txt") .. attr("id", cbid .. ".txt") .. ifattr(self.rows, "rows")
  38. %> >
  39. <%-=pcdata(self:cfgvalue(section))-%>
  40. </textarea>
  41. <br /><br />
  42. <%
  43. -- one button on top, one at the buttom
  44. %>
  45. <input class="cbi-button cbi-input-button" style="align: center; width: 100%" type="button" onclick="onclick_logview(this.name, true)"
  46. <%= attr("name", section) .. attr("id", cbid .. ".btn2") .. attr("value", self.inputtitle) %> />
  47. <%+cbi/valuefooter%>
  48. <!-- ++ END ++ Privoxy ++ detail_logview.htm ++ -->