mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Make request available to menu plugin hooks, closes #1371
This commit is contained in:
parent
a3faf37883
commit
d23a267138
8 changed files with 44 additions and 23 deletions
|
|
@ -158,9 +158,12 @@ def menu_links(datasette, actor):
|
|||
|
||||
|
||||
@hookimpl
|
||||
def table_actions(datasette, database, table, actor):
|
||||
def table_actions(datasette, database, table, actor, request):
|
||||
async def inner():
|
||||
if actor:
|
||||
return [{"href": datasette.urls.instance(), "label": "From async"}]
|
||||
label = "From async"
|
||||
if request.args.get("_hello"):
|
||||
label += " " + request.args["_hello"]
|
||||
return [{"href": datasette.urls.instance(), "label": label}]
|
||||
|
||||
return inner
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue