mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
8a4639bc43
commit
2f7731e9e5
10 changed files with 166 additions and 14 deletions
|
|
@ -296,3 +296,15 @@ def forbidden(datasette, request, message):
|
|||
def menu_links(datasette, actor):
|
||||
if actor:
|
||||
return [{"href": datasette.urls.instance(), "label": "Hello"}]
|
||||
|
||||
|
||||
@hookimpl
|
||||
def table_actions(datasette, database, table, actor):
|
||||
if actor:
|
||||
return [
|
||||
{
|
||||
"href": datasette.urls.instance(),
|
||||
"label": "Database: {}".format(database),
|
||||
},
|
||||
{"href": datasette.urls.instance(), "label": "Table: {}".format(table)},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -155,3 +155,12 @@ def menu_links(datasette, actor):
|
|||
return [{"href": datasette.urls.instance(), "label": "Hello 2"}]
|
||||
|
||||
return inner
|
||||
|
||||
|
||||
@hookimpl
|
||||
def table_actions(datasette, database, table, actor):
|
||||
async def inner():
|
||||
if actor:
|
||||
return [{"href": datasette.urls.instance(), "label": "From async"}]
|
||||
|
||||
return inner
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue