luci-mod-admin-full: make diagnostics url customizable
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_network / diagnostics.htm
index d1bef2a..90d7117 100644 (file)
@@ -1,15 +1,6 @@
 <%#
-LuCI - Lua Configuration Interface
-Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-$Id$
-
+ Copyright 2010 Jo-Philipp Wich <jow@openwrt.org>
+ Licensed to the public under the Apache License 2.0.
 -%>
 
 <%+header%>
@@ -43,7 +34,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        legend.parentNode.style.display = 'block';
                        legend.style.display = 'inline';
 
-                       stxhr.get('<%=luci.dispatcher.build_url("admin", "network")%>/diag_' + tool + protocol + '/' + addr, null,
+                       stxhr.post('<%=url('admin/network')%>/diag_' + tool + protocol + '/' + addr, { token: '<%=token%>' },
                                function(x)
                                {
                                        if (x.responseText)
@@ -62,9 +53,9 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
        }
 //]]></script>
 
-<form method="post" action="<%=pcdata(luci.http.getenv("REQUEST_URI"))%>">
+<form method="post" action="<%=url('admin/network/diagnostics')%>">
        <div class="cbi-map">
-               <h2><a id="content" name="content"><%:Diagnostics%></a></h2>
+               <h2 name="content"><%:Diagnostics%></h2>
 
                <fieldset class="cbi-section">
                        <legend><%:Network Utilities%></legend>
@@ -72,7 +63,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        <br />
 
                        <div style="width:30%; float:left">
-                               <input style="margin: 5px 0" type="text" value="openwrt.org" name="ping" /><br />
+                               <input style="margin: 5px 0" type="text" value="<%=luci.config.diag.ping%>" name="ping" /><br />
                                <% if has_ping6 then %>
                                <select name="ping_proto" style="width:auto">
                                        <option value="" selected="selected"><%:IPv4%></option>
@@ -85,7 +76,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        </div>
 
                        <div style="width:33%; float:left">
-                               <input style="margin: 5px 0" type="text" value="openwrt.org" name="traceroute" /><br />
+                               <input style="margin: 5px 0" type="text" value="<%=luci.config.diag.route%>" name="traceroute" /><br />
                                <% if has_traceroute6 then %>
                                <select name="traceroute_proto" style="width:auto">
                                        <option value="" selected="selected"><%:IPv4%></option>
@@ -102,7 +93,7 @@ local has_traceroute6 = fs.access("/usr/bin/traceroute6")
                        </div>
 
                        <div style="width:33%; float:left;">
-                               <input style="margin: 5px 0" type="text" value="openwrt.org" name="nslookup" /><br />
+                               <input style="margin: 5px 0" type="text" value="<%=luci.config.diag.dns%>" name="nslookup" /><br />
                                <input type="button" value="<%:Nslookup%>" class="cbi-button cbi-button-apply" onclick="update_status(this.form.nslookup)" />
                        </div>