X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-commands%2Fluasrc%2Fview%2Fcommands.htm;h=f094e186d43346e61719bcdeba021f6b5ed0aa53;hp=83792a91fda95c476ada5684b1a339f8d7fc537f;hb=077ac32635dc0048a684ee0a40345a262e661ecc;hpb=1bb4822dca6113f73e3bc89e2acf15935e6f8e92 diff --git a/applications/luci-app-commands/luasrc/view/commands.htm b/applications/luci-app-commands/luasrc/view/commands.htm index 83792a91f..f094e186d 100644 --- a/applications/luci-app-commands/luasrc/view/commands.htm +++ b/applications/luci-app-commands/luasrc/view/commands.htm @@ -1,13 +1,6 @@ <%# -LuCI - Lua Configuration Interface -Copyright 2012 Jo-Philipp Wich - -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 - + Copyright 2012 Jo-Philipp Wich + Licensed to the public under the Apache License 2.0. -%> <% css = [[ @@ -65,7 +58,7 @@ You may obtain a copy of the License at legend.parentNode.style.display = 'block'; legend.style.display = 'inline'; - stxhr.get('<%=luci.dispatcher.build_url("admin", "system", "commands", "run")%>/' + id + (args ? '/' + args : ''), null, + stxhr.get('<%=url('admin/system/commands/run')%>/' + id + (args ? '/' + args : ''), null, function(x, st) { if (st) @@ -100,7 +93,7 @@ You may obtain a copy of the License at if (field) args = encodeURIComponent(field.value); - location.href = '<%=luci.dispatcher.build_url("admin", "system", "commands", "download")%>/' + id + (args ? '/' + args : ''); + location.href = '<%=url('admin/system/commands/download')%>/' + id + (args ? '/' + args : ''); } function command_link(id) @@ -115,16 +108,19 @@ You may obtain a copy of the License at if (legend && output) { - var link = location.protocol + '//' + location.hostname + + var prefix = location.protocol + '//' + location.hostname + (location.port ? ':' + location.port : '') + - location.pathname.split(';')[0] + 'command/' + - id + (args ? '/' + args : ''); - + location.pathname.split(';')[0] + '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( - '
<%:Access command with%> %s
', - link, link + '

<%:Download execution result%> %s

<%:Or display result%> %s

', + link, link, link_nodownload, link_nodownload ); location.hash = '#output'; @@ -142,7 +138,7 @@ You may obtain a copy of the License at
">
-

<%:Custom Commands%>

+

<%:Custom Commands%>

<% local _, command; for _, command in ipairs(commands) do %>