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

109 lines
3.9 KiB
HTML
Raw Normal View History

2016-03-01 11:23:03 -05:00
{% extends '_base.html' %}
{% load static from staticfiles %}
{% load secret_helpers %}
2016-03-01 11:23:03 -05:00
{% block title %}Secret: {{ secret }}{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-12">
<ol class="breadcrumb">
<li><a href="{% url 'secrets:secret_list' %}">Secrets</a></li>
<li><a href="{% url 'dcim:device' pk=secret.device.pk %}">{{ secret.device }}</a></li>
2016-03-01 11:23:03 -05:00
<li>{{ secret.role }}{% if secret.name %} ({{ secret.name }}){% endif %}</li>
</ol>
</div>
</div>
<div class="pull-right">
{% if perms.secrets.change_secret %}
<a href="{% url 'secrets:secret_edit' pk=secret.pk %}" class="btn btn-warning">
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
Edit this secret
</a>
{% endif %}
{% if perms.secrets.delete_secret %}
<a href="{% url 'secrets:secret_delete' pk=secret.pk %}" class="btn btn-danger">
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
Delete this secret
</a>
{% endif %}
</div>
<h1>{{ secret }}</h1>
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<strong>Secret Attributes</strong>
</div>
<table class="table table-hover panel-body">
<tr>
<td>Device</td>
2016-03-01 11:23:03 -05:00
<td>
<a href="{% url 'dcim:device' pk=secret.device.pk %}">{{ secret.device }}</a>
2016-03-01 11:23:03 -05:00
</td>
</tr>
<tr>
<td>Role</td>
<td>{{ secret.role }}</td>
</tr>
<tr>
<td>Name</td>
<td>
{% if secret.name %}
<span>{{ secret.name }}</span>
{% else %}
<span class="text-muted">N/A</span>
{% endif %}
</td>
</tr>
<tr>
<td>Created</td>
<td>{{ secret.created }}</td>
2016-03-01 11:23:03 -05:00
</tr>
<tr>
<td>Last Updated</td>
<td>{{ secret.last_updated }}</td>
2016-03-01 11:23:03 -05:00
</tr>
</table>
</div>
</div>
<div class="col-md-6">
{% if secret|decryptable_by:request.user %}
<div class="panel panel-default">
<div class="panel-heading">
<strong>Secret Data</strong>
</div>
<div class="panel-body">
<form id="secret_form">
{% csrf_token %}
</form>
<div class="row">
<div class="col-md-2">Secret</div>
<div class="col-md-8" id="secret_{{ secret.pk }}">********</div>
<div class="col-md-2 text-right">
<button class="btn btn-xs btn-success unlock-secret" secret-id="{{ secret.pk }}">
<i class="fa fa-lock"></i> Unlock
</button>
<button class="btn btn-xs btn-danger lock-secret collapse" secret-id="{{ secret.pk }}">
<i class="fa fa-unlock-alt"></i> Lock
</button>
</div>
2016-03-01 11:23:03 -05:00
</div>
</div>
</div>
{% else %}
<div class="alert alert-warning">
<i class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></i>
You do not have permission to decrypt this secret.
</div>
{% endif %}
2016-03-01 11:23:03 -05:00
</div>
</div>
{% include 'secrets/inc/private_key_modal.html' %}
{% endblock %}
{% block javascript %}
<script src="{% static 'js/secrets.js' %}"></script>
2016-03-01 11:23:03 -05:00
{% endblock %}