Skip to content

Commit

Permalink
luci-app-commands: pass custom arguments as query string
Browse files Browse the repository at this point in the history
Commit 702c007 changed the request to be invoked via the Request.get function
instead of the deprecated XHR one. The request options object requires the
query string to be located inside of the subobject "query", otherwise they are
not picked up. This resulted in breaking the custom arguments functionality as
the input would simply be ignored.

Fixes #7255

Signed-off-by: Daniel Nilsson <[email protected]>
  • Loading branch information
dannil committed Sep 18, 2024
1 parent 5a30e6c commit dc70412
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion applications/luci-app-commands/ucode/template/commands.ut
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
legend.parentNode.style.display = 'block';
legend.style.display = 'inline';

L.Request.get(L.url('admin/system/commands/run', id), field ? { args: field.value } : null).then(function(reply) {
var options = field ? { query: { args: field.value } } : null;
L.Request.get(L.url('admin/system/commands/run', id), options).then(function(reply) {
var st = reply.json();

if (st.binary)
Expand Down

0 comments on commit dc70412

Please sign in to comment.