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:
parent
18ee34def2
commit
d9dcefd2aa
1 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue