fix + test api with resl client

This commit is contained in:
2025-02-06 15:10:51 +01:00
parent 2d172a3620
commit 861a0e58e5
20 changed files with 376 additions and 254 deletions

View File

@@ -1,49 +1,49 @@
{% extends 'layouts/blank.html' %} {% block content %}
<h1>Add User</h1>
<form method="post">
{% csrf_token %}
<div class="mb-3">
<label for="site" class="form-label">Site</label>
<input type="text" class="form-control" id="site" name="site" required />
</div>
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input
type="text"
class="form-control"
id="username"
name="username"
required
/>
</div>
<div class="mb-3">
<label for="clientId" class="form-label">Client ID</label>
<input
type="text"
class="form-control"
id="clientId"
name="clientId"
required
/>
</div>
<div class="mb-3">
<label for="topic" class="form-label">Topic</label>
<input type="text" class="form-control" id="topic" name="topic" required />
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input
type="password"
class="form-control"
id="password"
name="password"
required
/>
</div>
<button type="submit" class="btn btn-primary">Create</button>
</form>
<h1>Add User</h1>
<form method="post">
{% csrf_token %}
<div class="mb-3">
<label for="site" class="form-label">Site</label>
<input type="text" class="form-control" id="site" name="site" required />
</div>
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input
type="text"
class="form-control"
id="username"
name="username"
required
/>
</div>
<div class="mb-3">
<label for="clientId" class="form-label">Client ID</label>
<input
type="text"
class="form-control"
id="clientId"
name="clientId"
required
/>
</div>
<div class="mb-3">
<label for="topic" class="form-label">Topic</label>
<input type="text" class="form-control" id="topic" name="topic" required />
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input
type="password"
class="form-control"
id="password"
name="password"
required
/>
</div>
<button type="submit" class="btn btn-primary">Create</button>
</form>
<!-- Risultato della creazione -->
<div id="result"></div>
<!-- Risultato della creazione -->
<div id="result"></div>
{% endblock content%}

View File

@@ -48,5 +48,7 @@
/>
</div>
<button type="submit" class="btn btn-primary">Update</button>
<a href="{% url 'list_users' %}">
<button type="button" class="btn btn-secondary">Cancel</button>
</form>
{% endblock content %}

View File

@@ -14,7 +14,10 @@
<th>Username</th>
<th>Client ID</th>
<th>Topic</th>
<th>Action</th>
{% if ase_adm_group %}
<th>Actions</th>
<th> </th>
{% endif %}
</tr>
</thead>
<tbody>
@@ -28,31 +31,22 @@
</td>
<td>{{user.client_id}}</td>
<td>{{user.topic}}</td>
<td id="user-status">
{% if ase_adm_group %}
<td>
{% if user.status == "enabled" %}
<a
{% if ase_adm_group %}
href="{% url 'disable_user' user.slug %}"
{% endif %}>
<button class="btn btn-danger btn-sm"
{% if not ase_adm_group %}
disabled
{% endif %}
>Disable</button>
</a>
<a href="{% url 'disable_user' user.slug %}"
<button class="btn btn-warning btn-sm" >Disable</button>
</a>
{% else %}
<a
{% if ase_adm_group %}
href="{% url 'enable_user' user.slug %}"
{% endif %}>
<button class="btn btn-warning btn-sm"
{% if not ase_adm_group %}
disabled
{% endif %}
>Enable</button>
</a>
<a href="{% url 'enable_user' user.slug %}"
<button class="btn btn-info btn-sm" >Enable</button>
</a>
{% endif %}
<td><a href="{% url 'delete_user' user.slug %}">
<button class="btn btn-danger btn-sm">Delete</button>
</a></td>
</td>
{% endif %}
</tr>
{% empty %}
<tr>