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