From 077ac32635dc0048a684ee0a40345a262e661ecc Mon Sep 17 00:00:00 2001 From: t123yh Date: Wed, 3 Aug 2016 18:19:04 +0800 Subject: luci-app-commands: Allow executing without downloading on public links Signed-off-by: t123yh --- applications/luci-app-commands/luasrc/view/commands.htm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'applications/luci-app-commands/luasrc/view/commands.htm') diff --git a/applications/luci-app-commands/luasrc/view/commands.htm b/applications/luci-app-commands/luasrc/view/commands.htm index 73b9e6a2ce..f094e186d4 100644 --- a/applications/luci-app-commands/luasrc/view/commands.htm +++ b/applications/luci-app-commands/luasrc/view/commands.htm @@ -108,16 +108,19 @@ 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'; -- cgit v1.2.3