luci-app-commands: fix link generation
authorYousong Zhou <yszhou4tech@gmail.com>
Mon, 7 May 2018 14:07:15 +0000 (22:07 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Mon, 7 May 2018 14:28:40 +0000 (22:28 +0800)
Fixes openwrt/luci##824

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
applications/luci-app-commands/luasrc/view/commands.htm

index 3b36155..4285f25 100644 (file)
 
                if (legend && output)
                {
 
                if (legend && output)
                {
-                       var prefix = location.protocol + '//' + location.hostname +
-                                  (location.port ? ':' + location.port : '') +
-                                          location.pathname.split(';')[0] + 'command/';
+                       var prefix = location.protocol + '//' + location.host + '<%=url('command')%>/';
                        var suffix = (args ? '/' + args : '');
                        
                        var link = prefix + id + suffix;
                        var suffix = (args ? '/' + args : '');
                        
                        var link = prefix + id + suffix;