mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #11528: Show edit/delete buttons in user tokens table
This commit is contained in:
@ -5,6 +5,8 @@
|
||||
### Bug Fixes
|
||||
|
||||
* [#11487](https://github.com/netbox-community/netbox/issues/11487) - Remove "set null" option from non-writable custom fields during bulk edit
|
||||
* [#11491](https://github.com/netbox-community/netbox/issues/11491) - Show edit/delete buttons in user tokens table
|
||||
* [#11528](https://github.com/netbox-community/netbox/issues/11528) - Permit import of devices using uploaded file
|
||||
* [#11555](https://github.com/netbox-community/netbox/issues/11555) - Avoid inadvertent interpretation of search query as regular expression under global search (previously [#11516](https://github.com/netbox-community/netbox/issues/11516))
|
||||
* [#11562](https://github.com/netbox-community/netbox/issues/11562) - Correct ordering of virtual chassis interfaces with duplicate names
|
||||
|
||||
|
@ -19,6 +19,14 @@ COPY_BUTTON = """
|
||||
"""
|
||||
|
||||
|
||||
class TokenActionsColumn(columns.ActionsColumn):
|
||||
# Subclass ActionsColumn to disregard permissions for edit & delete buttons
|
||||
actions = {
|
||||
'edit': columns.ActionsItem('Edit', 'pencil', None, 'warning'),
|
||||
'delete': columns.ActionsItem('Delete', 'trash-can-outline', None, 'danger'),
|
||||
}
|
||||
|
||||
|
||||
class TokenTable(NetBoxTable):
|
||||
key = columns.TemplateColumn(
|
||||
template_code=TOKEN
|
||||
@ -32,7 +40,7 @@ class TokenTable(NetBoxTable):
|
||||
allowed_ips = columns.TemplateColumn(
|
||||
template_code=ALLOWED_IPS
|
||||
)
|
||||
actions = columns.ActionsColumn(
|
||||
actions = TokenActionsColumn(
|
||||
actions=('edit', 'delete'),
|
||||
extra_buttons=COPY_BUTTON
|
||||
)
|
||||
|
Reference in New Issue
Block a user