mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 04:32:51 -06:00
Merge pull request #3763 from hSaria/3761-token-copy-button
Fixes #3761: copy button for tokens
This commit is contained in:
commit
b46bfaebc1
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
* [#3152](https://github.com/netbox-community/netbox/issues/3152) - Include direct link to rack elevations on site view
|
* [#3152](https://github.com/netbox-community/netbox/issues/3152) - Include direct link to rack elevations on site view
|
||||||
* [#3441](https://github.com/netbox-community/netbox/issues/3441) - Move virtual machine results near devices in global search
|
* [#3441](https://github.com/netbox-community/netbox/issues/3441) - Move virtual machine results near devices in global search
|
||||||
|
* [#3761](https://github.com/netbox-community/netbox/issues/3761) - Added copy button for API tokens
|
||||||
|
|
||||||
## Bug Fixes
|
## Bug Fixes
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
<div class="panel panel-{% if token.is_expired %}danger{% else %}default{% endif %}">
|
<div class="panel panel-{% if token.is_expired %}danger{% else %}default{% endif %}">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div class="pull-right noprint">
|
<div class="pull-right noprint">
|
||||||
|
<a class="btn btn-xs btn-success copy-token" data-clipboard-target="#token_{{ token.pk }}">Copy</a>
|
||||||
{% if perms.users.change_token %}
|
{% if perms.users.change_token %}
|
||||||
<a href="{% url 'user:token_edit' pk=token.pk %}" class="btn btn-xs btn-warning">Edit</a>
|
<a href="{% url 'user:token_edit' pk=token.pk %}" class="btn btn-xs btn-warning">Edit</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -17,7 +18,8 @@
|
|||||||
<a href="{% url 'user:token_delete' pk=token.pk %}" class="btn btn-xs btn-danger">Delete</a>
|
<a href="{% url 'user:token_delete' pk=token.pk %}" class="btn btn-xs btn-danger">Delete</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<i class="fa fa-key"></i> {{ token.key }}
|
<i class="fa fa-key"></i>
|
||||||
|
<span id="token_{{ token.pk }}">{{ token.key }}</span>
|
||||||
{% if token.is_expired %}
|
{% if token.is_expired %}
|
||||||
<span class="label label-danger">Expired</span>
|
<span class="label label-danger">Expired</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -66,3 +68,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block javascript %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
new ClipboardJS('.copy-token');
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user