piccolo-orm / piccolo_admin

A powerful web admin for your database.
https://piccolo-orm.com/ecosystem/
MIT License
322 stars 39 forks source link

Allow custom links in the sidebar #307

Closed dantownsend closed 1 year ago

dantownsend commented 1 year ago

Discussed in https://github.com/piccolo-orm/piccolo_admin/discussions/306

We can add a new section in the sidebar containing user defined links:

piccolo_admin_links_prototype

The API would be pretty simple:

app = create_admin(
    ...,
    sidebar_links=[
        ('Charts', '/custom-endpoint'),
        ('Top Movies', '/#/movie?__order=-box_office'),
        ...
    ]
)

It's useful for many reasons:

Considerations:

Fidel-C commented 1 year ago

I think 'shortcuts' is more descriptive.

I suppose that the sidebar links will be visible to only the admin users and not show up at all in the swagger docs?

sinisaos commented 1 year ago

I suppose that the sidebar links will be visible to only the admin users and not show up at all in the swagger docs?

@Fidel-C Piccolo Admin is protected by session auth and only the authenticated admin user can see the admin interface and admin Swagger docs. Want to do PR for this? If not, I can make a working prototype.

Fidel-C commented 1 year ago

@sinisaos alright thanks for the answer.

sinisaos commented 1 year ago

@Fidel-C No problem. You didn't say anything about whether you will do PR or not? Do you want me to do initial PR?

Fidel-C commented 1 year ago

@Fidel-C No problem. You didn't say anything about whether you will do PR or not? Do you want me to do initial PR?

Sorry about that. I think you should.

sinisaos commented 1 year ago

@Fidel-C PR #308, so you can try it if you want.

sinisaos commented 1 year ago

@dantownsend You can close this because it's done.

dantownsend commented 1 year ago

@sinisaos Thanks