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 <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2022-09-19 14:19:24 +02:00
parent 18ee34def2
commit d9dcefd2aa

View file

@ -776,6 +776,24 @@ function run_action(request_path, lang, tree, resolved, action) {
})); }));
break; 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': case 'alias':
dispatch(http, [ ...split(action.path, '/'), ...resolved.ctx.request_args ]); dispatch(http, [ ...split(action.path, '/'), ...resolved.ctx.request_args ]);
break; break;