diff options
Diffstat (limited to 'applications/luci-app-commands/luasrc/view/commands.htm')
-rw-r--r-- | applications/luci-app-commands/luasrc/view/commands.htm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/applications/luci-app-commands/luasrc/view/commands.htm b/applications/luci-app-commands/luasrc/view/commands.htm index 73b9e6a2ce..d60a97c5b7 100644 --- a/applications/luci-app-commands/luasrc/view/commands.htm +++ b/applications/luci-app-commands/luasrc/view/commands.htm @@ -34,7 +34,6 @@ <%+header%> -<script type="text/javascript" src="<%=resource%>/cbi.js"></script> <script type="text/javascript">//<![CDATA[ var stxhr = new XHR(); @@ -108,16 +107,17 @@ if (legend && output) { - var link = location.protocol + '//' + location.hostname + - (location.port ? ':' + location.port : '') + - location.pathname.split(';')[0] + 'command/' + - id + (args ? '/' + args : ''); - + var prefix = location.protocol + '//' + location.host + '<%=url('command')%>/'; + var suffix = (args ? '/' + args : ''); + + var link = prefix + id + suffix; + var link_nodownload = prefix + id + "s" + suffix; + legend.style.display = 'none'; output.parentNode.style.display = 'block'; output.innerHTML = String.format( - '<div class="alert-message"><%:Access command with%> <a href="%s">%s</a></div>', - link, link + '<div class="alert-message"><p><%:Download execution result%> <a href="%s">%s</a></p><p><%:Or display result%> <a href="%s">%s</a></p></div>', + link, link, link_nodownload, link_nodownload ); location.hash = '#output'; @@ -133,7 +133,7 @@ uci:foreach("luci", "command", function(s) commands[#commands+1] = s end) %> -<form method="get" action="<%=pcdata(luci.http.getenv("REQUEST_URI"))%>"> +<form method="get" action="<%=pcdata(FULL_REQUEST_URI)%>"> <div class="cbi-map"> <h2 name="content"><%:Custom Commands%></h2> |