diff options
author | Jo-Philipp Wich <jo@mein.io> | 2024-07-28 01:14:46 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2024-07-28 01:14:46 +0200 |
commit | 0f9c168fa643089abd073b59ffbfcc6abe220dea (patch) | |
tree | ce239b164da4430cca50e95ab397117f21dff975 /applications | |
parent | 385129bd51d7c88f71615ec0dc37039dbb1d2adf (diff) |
luci-app-commands: move URL building to client side
Replace server side dispatcher.build_url() with client side L.url() calls.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-app-commands/ucode/template/commands.ut | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/applications/luci-app-commands/ucode/template/commands.ut b/applications/luci-app-commands/ucode/template/commands.ut index 48850598d7..f11efe948c 100644 --- a/applications/luci-app-commands/ucode/template/commands.ut +++ b/applications/luci-app-commands/ucode/template/commands.ut @@ -51,7 +51,7 @@ legend.parentNode.style.display = 'block'; legend.style.display = 'inline'; - stxhr.get('{{ dispatcher.build_url('admin/system/commands/run') }}/' + id + (args ? '?args=' + args : ''), null, + stxhr.get(L.url('admin/system/commands/run', id) + (args ? '?args=' + args : ''), null, function(x, st) { if (st) @@ -88,7 +88,7 @@ if (field) args = encodeURIComponent(field.value); - location.href = '{{ dispatcher.build_url('admin/system/commands/download') }}/' + id + (args ? '/' + args : ''); + location.href = L.url('admin/system/commands/download', id) + (args ? '/' + args : ''); ev.preventDefault(); } @@ -105,7 +105,7 @@ if (legend && output) { - var prefix = location.protocol + '//' + location.host + '{{ dispatcher.build_url('command') }}/'; + var prefix = location.protocol + '//' + location.host + L.url('command') + '/'; var suffix = (args ? '?args=' + args : ''); var link = prefix + id + suffix; |