1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

61 lines
2.9 KiB
HTML
Raw Normal View History

2020-05-06 13:25:17 -04:00
{% extends 'users/base.html' %}
{% load helpers %}
{% block title %}API Tokens{% endblock %}
{% block usercontent %}
<div class="row">
2021-04-30 15:55:37 -07:00
<div class="col col-md-12">
{% for token in tokens %}
2021-04-13 21:51:12 -07:00
<div class="card{% if token.is_expired %} bg-danger{% endif %}">
<div class="card-header">
<div class="float-end noprint">
<a class="m-1 btn btn-sm btn-success copy-token" data-clipboard-target="#token_{{ token.pk }}">Copy</a>
Merge branch 'feature' of https://github.com/netbox-community/netbox into feature # Conflicts: # netbox/dcim/tables/template_code.py # netbox/netbox/views/__init__.py # netbox/project-static/css/base.css # netbox/templates/base.html # netbox/templates/circuits/circuit.html # netbox/templates/circuits/circuittermination_edit.html # netbox/templates/circuits/inc/circuit_termination.html # netbox/templates/circuits/provider.html # netbox/templates/dcim/device.html # netbox/templates/dcim/device/base.html # netbox/templates/dcim/device_component.html # netbox/templates/dcim/devicetype.html # netbox/templates/dcim/inc/device_napalm_tabs.html # netbox/templates/dcim/rack.html # netbox/templates/dcim/site.html # netbox/templates/dcim/virtualchassis.html # netbox/templates/extras/configcontext.html # netbox/templates/extras/object_journal.html # netbox/templates/extras/tag.html # netbox/templates/generic/object.html # netbox/templates/generic/object_list.html # netbox/templates/home.html # netbox/templates/inc/nav_menu.html # netbox/templates/ipam/aggregate.html # netbox/templates/ipam/ipaddress.html # netbox/templates/ipam/prefix.html # netbox/templates/ipam/vlan.html # netbox/templates/ipam/vlangroup_edit.html # netbox/templates/ipam/vlangroup_vlans.html # netbox/templates/secrets/secret.html # netbox/templates/tenancy/tenant.html # netbox/templates/users/api_tokens.html # netbox/templates/virtualization/cluster.html # netbox/templates/virtualization/vminterface_edit.html # netbox/utilities/forms/fields.py # netbox/utilities/templates/buttons/export.html
2021-04-14 11:30:15 -07:00
<a href="{% url 'user:token_edit' pk=token.pk %}" class="m-1 btn btn-sm btn-warning">Edit</a>
<a href="{% url 'user:token_delete' pk=token.pk %}" class="m-1 btn btn-sm btn-danger">Delete</a>
2017-03-08 11:34:47 -05:00
</div>
<i class="mdi mdi-key"></i>
2020-05-06 13:25:17 -04:00
<samp><span id="token_{{ token.pk }}">{{ token.key }}</span></samp>
{% if token.is_expired %}
2021-04-18 16:42:28 -07:00
<span class="badge bg-danger">Expired</span>
{% endif %}
</div>
2021-04-13 21:51:12 -07:00
<div class="card-body">
<div class="row">
2021-04-30 15:55:37 -07:00
<div class="col col-md-4">
2020-05-06 13:25:17 -04:00
<small class="text-muted">Created</small><br />
{{ token.created|annotated_date }}
</div>
2021-04-30 15:55:37 -07:00
<div class="col col-md-4">
2020-05-06 13:25:17 -04:00
<small class="text-muted">Expires</small><br />
2017-03-08 11:34:47 -05:00
{% if token.expires %}
{{ token.expires|annotated_date }}
2017-03-08 11:34:47 -05:00
{% else %}
2020-05-06 13:25:17 -04:00
<span>Never</span>
2017-03-08 11:34:47 -05:00
{% endif %}
</div>
2021-04-30 15:55:37 -07:00
<div class="col col-md-4">
2021-04-18 16:42:28 -07:00
<small class="text-muted">Create/Edit/Delete Operations</small><br />
{% if token.write_enabled %}
2021-04-18 16:42:28 -07:00
<span class="badge bg-success">Enabled</span>
{% else %}
2021-04-18 16:42:28 -07:00
<span class="badge bg-danger">Disabled</span>
2020-05-06 13:25:17 -04:00
{% endif %}
</div>
</div>
{% if token.description %}
<br /><span>{{ token.description }}</span>
{% endif %}
</div>
</div>
2017-03-08 11:34:47 -05:00
{% empty %}
<p>You do not have any API tokens.</p>
{% endfor %}
2021-04-16 16:02:56 -07:00
<a href="{% url 'user:token_add' %}" class="btn btn-sm btn-primary my-3">
<span class="mdi mdi-plus-thick" aria-hidden="true"></span>
2021-04-16 16:02:56 -07:00
Add a Token
</a>
</div>
</div>
{% endblock %}