| {% extends "base.html" %} |
|
|
| {% block title %}Edit {{ secret.key }} - PyRunner{% endblock %} |
|
|
| {% block content %} |
| <div class="flex"> |
| {% include "cpanel/_sidebar.html" %} |
|
|
| <div class="flex-1 p-8"> |
| |
| <div class="mb-8"> |
| <nav class="flex items-center space-x-2 text-sm text-code-muted mb-4"> |
| <a href="{% url 'cpanel:secret_list' %}" class="hover:text-code-accent">Secrets</a> |
| <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/> |
| </svg> |
| <span class="text-code-text">Edit {{ secret.key }}</span> |
| </nav> |
| <h1 class="text-2xl font-bold text-code-text">Edit Secret</h1> |
| <p class="text-code-muted">Update the value or description (key cannot be changed)</p> |
| </div> |
|
|
| |
| <div class="bg-code-surface border border-code-border rounded-xl p-6 max-w-2xl"> |
| <form method="post" autocomplete="off"> |
| {% csrf_token %} |
|
|
| |
| <div class="mb-6"> |
| <label class="block text-sm font-medium text-code-text mb-2">Key Name</label> |
| <div class="px-4 py-3 bg-code-bg border border-code-border rounded-lg font-mono text-code-accent"> |
| {{ secret.key }} |
| </div> |
| <p class="mt-1 text-sm text-code-muted">Key cannot be changed after creation</p> |
| </div> |
|
|
| |
| <div class="mb-6"> |
| <label class="block text-sm font-medium text-code-text mb-2">Current Value</label> |
| <div class="px-4 py-3 bg-code-bg border border-code-border rounded-lg font-mono text-code-muted"> |
| {{ secret.get_masked_value }} |
| </div> |
| </div> |
|
|
| |
| <div class="mb-6"> |
| <label for="id_value" class="block text-sm font-medium text-code-text mb-2"> |
| {{ form.value.label }} |
| </label> |
| {{ form.value }} |
| {% if form.value.help_text %} |
| <p class="mt-1 text-sm text-code-muted">{{ form.value.help_text }}</p> |
| {% endif %} |
| {% if form.value.errors %} |
| <p class="mt-1 text-sm text-code-red">{{ form.value.errors.0 }}</p> |
| {% endif %} |
| </div> |
|
|
| |
| <div class="mb-6"> |
| <label for="id_description" class="block text-sm font-medium text-code-text mb-2"> |
| {{ form.description.label }} |
| </label> |
| {{ form.description }} |
| {% if form.description.errors %} |
| <p class="mt-1 text-sm text-code-red">{{ form.description.errors.0 }}</p> |
| {% endif %} |
| </div> |
|
|
| |
| <div class="flex items-center justify-end space-x-4 pt-6 border-t border-code-border"> |
| <a href="{% url 'cpanel:secret_list' %}" |
| class="px-4 py-2 bg-code-surface border border-code-border hover:border-code-accent text-code-text rounded-lg transition-colors"> |
| Cancel |
| </a> |
| <button type="submit" |
| class="px-4 py-2 bg-code-accent hover:bg-code-accent/90 text-white font-semibold rounded-lg transition-colors"> |
| Save Changes |
| </button> |
| </div> |
| </form> |
| </div> |
| </div> |
| </div> |
| {% endblock %} |
|
|