detail_logview.htm 1.9 KB

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