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

59 lines
2.8 KiB
HTML
Raw Normal View History

{% extends 'users/_user.html' %}
{% load helpers %}
{% block title %}API Tokens{% endblock %}
{% block usercontent %}
<div class="row">
<div class="col-md-12">
{% for token in tokens %}
<div class="panel panel-{% if token.is_expired %}danger{% else %}default{% endif %}">
<div class="panel-heading">
2017-03-08 11:34:47 -05:00
<div class="pull-right">
2017-03-14 12:59:10 -04:00
<a href="{% url 'user:token_edit' pk=token.pk %}" class="btn btn-xs btn-warning">Edit</a>
<a href="{% url 'user:token_delete' pk=token.pk %}" class="btn btn-xs btn-danger">Delete</a>
2017-03-08 11:34:47 -05:00
</div>
<i class="fa fa-key"></i> {{ token.key }}
{% if token.is_expired %}
2017-03-08 11:34:47 -05:00
<span class="label label-danger">Expired</span>
{% endif %}
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-4">
2017-03-08 11:34:47 -05:00
<span title="{{ token.created }}">{{ token.created|date }}</span><br />
<small class="text-muted">Created</small>
</div>
<div class="col-md-4">
2017-03-08 11:34:47 -05:00
{% if token.expires %}
<span title="{{ token.expires }}">{{ token.expires|date }}</span><br />
{% else %}
<span>Never</span><br />
{% endif %}
<small class="text-muted">Expires</small>
</div>
<div class="col-md-4">
{% if token.write_enabled %}
<span class="label label-success">Enabled</span>
{% else %}
<span class="label label-danger">Disabled</span>
2017-03-08 11:34:47 -05:00
{% endif %}<br />
<small class="text-muted">Create/edit/delete operations</small>
</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 %}
2017-03-14 12:59:10 -04:00
<a href="{% url 'user:token_add' %}" class="btn btn-primary">
2017-03-08 11:34:47 -05:00
<span class="fa fa-plus" aria-hidden="true"></span>
Add a token
</a>
</div>
</div>
{% endblock %}