From d9dcefd2aa45ff123aa536d5e883b17a6cd8a9b6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 19 Sep 2022 14:19:24 +0200 Subject: [PATCH] luci-base: dispatcher.uc: support `cbi` and `form` action types Some existing LuCI apps ship menu.d JSON files with `cbi` and `form` typed dispatch targets, support those as well. Signed-off-by: Jo-Philipp Wich --- modules/luci-base/ucode/dispatcher.uc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/luci-base/ucode/dispatcher.uc b/modules/luci-base/ucode/dispatcher.uc index 84eff71d3a..7ff8d49c12 100644 --- a/modules/luci-base/ucode/dispatcher.uc +++ b/modules/luci-base/ucode/dispatcher.uc @@ -776,6 +776,24 @@ function run_action(request_path, lang, tree, resolved, action) { })); break; + case 'cbi': + http.write(render(() => { + runtime.call('luci.dispatcher', 'invoke_cbi_action', + action.path, null, + ...resolved.ctx.request_args + ); + })); + break; + + case 'form': + http.write(render(() => { + runtime.call('luci.dispatcher', 'invoke_form_action', + action.path, + ...resolved.ctx.request_args + ); + })); + break; + case 'alias': dispatch(http, [ ...split(action.path, '/'), ...resolved.ctx.request_args ]); break;