logs.unturf.com/templates/manage_namespace.html.j2
Russell Ballestrini a8b0ee313d working with revocations
modified:   README.rst
	modified:   app.py
	modified:   templates/manage_namespace.html.j2
	modified:   test_agent.sh
2025-01-11 20:18:34 -05:00

67 lines
2.1 KiB
Django/Jinja

{% extends 'base.html.j2' %}
{% block title %}Manage Namespace{% endblock %}
{% block content %}
<h1>Manage Namespace: {{ namespace.name }}</h1>
<form method="POST" action="{{ request.route_url('update_namespace', namespace_short_id=namespace.short_id) }}">
<label>
<input type="checkbox" name="is_public" {% if namespace.is_public %}checked{% endif %}>
Make Namespace Public
</label><br><br>
<button type="submit">Update Namespace</button>
</form>
<h2>Invite User</h2>
<form method="POST" action="{{ request.route_url('invite_user', namespace_short_id=namespace.short_id) }}">
<label for="email">User Email:</label>
<input type="email" name="email" required><br><br>
<label for="role">Role:</label>
<select name="role" required>
<option value="owner">Owner</option>
<option value="editor">Editor</option>
<option value="reader">Reader</option>
</select><br><br>
<button type="submit">Invite User</button>
</form>
<h2>Users in Namespace</h2>
{% if users %}
<ul>
{% for item in users %}
<li>{{ item.user.username }} - {{ item.role|capitalize }}</li>
{% endfor %}
</ul>
{% else %}
<p>No users in this namespace.</p>
{% endif %}
<h2>Agents</h2>
{% if agents %}
<ul>
{% for agent in agents %}
<li>
{{ agent.name }}
<form method="POST" action="{{ request.route_url('revoke_agent', namespace_short_id=namespace.short_id) }}" style="display:inline;">
<input type="hidden" name="agent_id" value="{{ agent.id }}">
<button type="submit" onclick="return confirm('Revoke access for {{ agent.name }}?')">Revoke Access</button>
</form>
</li>
{% endfor %}
</ul>
{% else %}
<p>No agents found.</p>
{% endif %}
<h2>Generate JWT for Agent</h2>
<form method="POST" action="{{ request.route_url('generate_agent_jwt', namespace_short_id=namespace.short_id) }}">
<label for="agent_name">Agent Name:</label>
<input type="text" name="agent_name" required><br><br>
<button type="submit">Generate JWT</button>
</form>
{% endblock %}