mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Fix "add secret" link for VMs
This commit is contained in:
parent
0b33c53f47
commit
c986321402
@ -396,7 +396,19 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if perms.secrets.view_secret %}
|
{% if perms.secrets.view_secret %}
|
||||||
{% include 'secrets/inc/assigned_secrets.html' %}
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<strong>Secrets</strong>
|
||||||
|
</div>
|
||||||
|
{% include 'secrets/inc/assigned_secrets.html' %}
|
||||||
|
{% if perms.secrets.add_secret %}
|
||||||
|
<div class="panel-footer text-right noprint">
|
||||||
|
<a href="{% url 'secrets:secret_add' %}?device={{ device.pk }}&return_url={{ device.get_absolute_url }}" class="btn btn-xs btn-primary">
|
||||||
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add secret
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
|
@ -1,41 +1,26 @@
|
|||||||
<div class="panel panel-default">
|
{% if secrets %}
|
||||||
<div class="panel-heading">
|
<table class="table table-hover panel-body">
|
||||||
<strong>Secrets</strong>
|
{% for secret in secrets %}
|
||||||
|
<tr>
|
||||||
|
<td><a href="{% url 'secrets:secret' pk=secret.pk %}">{{ secret.role }}</a></td>
|
||||||
|
<td>{{ secret.name }}</td>
|
||||||
|
<td id="secret_{{ secret.pk }}">********</td>
|
||||||
|
<td class="text-right noprint">
|
||||||
|
<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-default copy-secret collapse" secret-id="{{ secret.pk }}" data-clipboard-target="#secret_{{ secret.pk }}">
|
||||||
|
<i class="fa fa-copy"></i> Copy
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-xs btn-danger lock-secret collapse" secret-id="{{ secret.pk }}">
|
||||||
|
<i class="fa fa-unlock-alt"></i> Lock
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
{% else %}
|
||||||
|
<div class="panel-body text-muted">
|
||||||
|
None found
|
||||||
</div>
|
</div>
|
||||||
{% if secrets %}
|
{% endif %}
|
||||||
<table class="table table-hover panel-body">
|
|
||||||
{% for secret in secrets %}
|
|
||||||
<tr>
|
|
||||||
<td><a href="{% url 'secrets:secret' pk=secret.pk %}">{{ secret.role }}</a></td>
|
|
||||||
<td>{{ secret.name }}</td>
|
|
||||||
<td id="secret_{{ secret.pk }}">********</td>
|
|
||||||
<td class="text-right noprint">
|
|
||||||
<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-default copy-secret collapse" secret-id="{{ secret.pk }}" data-clipboard-target="#secret_{{ secret.pk }}">
|
|
||||||
<i class="fa fa-copy"></i> Copy
|
|
||||||
</button>
|
|
||||||
<button class="btn btn-xs btn-danger lock-secret collapse" secret-id="{{ secret.pk }}">
|
|
||||||
<i class="fa fa-unlock-alt"></i> Lock
|
|
||||||
</button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</table>
|
|
||||||
{% else %}
|
|
||||||
<div class="panel-body text-muted">
|
|
||||||
None found
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% if perms.secrets.add_secret %}
|
|
||||||
<form id="secret_form">
|
|
||||||
{% csrf_token %}
|
|
||||||
</form>
|
|
||||||
<div class="panel-footer text-right noprint">
|
|
||||||
<a href="{% url 'secrets:secret_add' %}?device={{ device.pk }}&return_url={{ device.get_absolute_url }}" class="btn btn-xs btn-primary">
|
|
||||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add secret
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
|
@ -221,7 +221,19 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% if perms.secrets.view_secret %}
|
{% if perms.secrets.view_secret %}
|
||||||
{% include 'secrets/inc/assigned_secrets.html' %}
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<strong>Secrets</strong>
|
||||||
|
</div>
|
||||||
|
{% include 'secrets/inc/assigned_secrets.html' %}
|
||||||
|
{% if perms.secrets.add_secret %}
|
||||||
|
<div class="panel-footer text-right noprint">
|
||||||
|
<a href="{% url 'secrets:secret_add' %}?virtual_machine={{ virtualmachine.pk }}&return_url={{ virtualmachine.get_absolute_url }}" class="btn btn-xs btn-primary">
|
||||||
|
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add secret
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
|
Loading…
Reference in New Issue
Block a user