2 LuCI - Lua Configuration Interface
3 Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
17 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
18 <script type="text/javascript">//<![CDATA[
19 var stxhr = new XHR();
21 function update_status(field)
23 var tool = field.name;
24 var addr = field.value;
26 var legend = document.getElementById('diag-rc-legend');
27 var output = document.getElementById('diag-rc-output');
32 '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> ' +
33 '<%:Waiting for command to complete...%>'
36 legend.parentNode.style.display = 'block';
37 legend.style.display = 'inline';
39 stxhr.get('<%=luci.dispatcher.build_url("admin", "network")%>/diag_' + tool + '/' + addr, null,
44 legend.style.display = 'none';
45 output.innerHTML = String.format('<pre>%h</pre>', x.responseText);
49 legend.style.display = 'none';
50 output.innerHTML = '<span class="error"><%:Bad address specified!%></span>';
58 <form method="post" action="<%=pcdata(luci.http.getenv("REQUEST_URI"))%>">
60 <h2><a id="content" name="content"><%:Diagnostics%></a></h2>
62 <fieldset class="cbi-section">
63 <legend><%:Network Utilities%></legend>
67 <div style="width:30%; float:left; text-align:center">
68 <input style="width: 50%" type="text" value="openwrt.org" name="ping" />
69 <input type="button" value="Ping" class="cbi-button cbi-button-apply" onclick="update_status(this.form.ping)" />
72 <div style="width:30%; float:left; text-align:center">
73 <input style="width: 50%" type="text" value="openwrt.org" name="traceroute" />
74 <input type="button" value="Traceroute" class="cbi-button cbi-button-apply" onclick="update_status(this.form.traceroute)" />
77 <div style="width:30%; float:left; text-align:center">
78 <input style="width: 50%" type="text" value="openwrt.org" name="nslookup" />
79 <input type="button" value="Nslookup" class="cbi-button cbi-button-apply" onclick="update_status(this.form.nslookup)" />
82 <br style="clear:both" /><br />
87 <fieldset class="cbi-section" style="display:none">
88 <legend id="diag-rc-legend"><%:Collecting data...%></legend>
89 <span id="diag-rc-output"></span>