55 lines
1.9 KiB
HTML
55 lines
1.9 KiB
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
<div class="card">
|
|
<h2 style="margin-top:0">Administration — Upload de playbooks</h2>
|
|
<form method="post" enctype="multipart/form-data">
|
|
<div class="grid">
|
|
<div>
|
|
<label>Domaine</label>
|
|
<input type="text" name="domain" placeholder="ex: ipam, discovery, network" required>
|
|
</div>
|
|
<div>
|
|
{% if require_token %}
|
|
<label>Token Administrateur</label>
|
|
<input type="password" name="token" placeholder="ADMIN_TOKEN" required>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div style="margin-top:10px">
|
|
<input type="file" name="file" accept=".yml,.yaml" required>
|
|
</div>
|
|
<div class="row" style="margin-top:12px">
|
|
<button type="submit">Charger le playbook</button>
|
|
<a href="{{ url_for('user_home') }}" class="badge">Aller à la vue Utilisateurs</a>
|
|
</div>
|
|
<div class="small" style="margin-top:8px">Seuls les fichiers .yml/.yaml sont acceptés. Le fichier est stocké par domaine et visible dans la vue Utilisateurs.</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h3 style="margin-top:0">Playbooks disponibles</h3>
|
|
{% if grouped %}
|
|
{% for domain, items in grouped.items() %}
|
|
<h4>{{ domain }} <span class="badge">{{ items|length }} playbook(s)</span></h4>
|
|
<table class="table">
|
|
<tr><th>Nom</th><th>Taille</th><th>Modifié</th><th>SHA256</th><th>Actions</th></tr>
|
|
{% for pb in items %}
|
|
<tr>
|
|
<td>{{ pb.name }}</td>
|
|
<td>{{ pb.size_h }}</td>
|
|
<td>{{ pb.mtime_h }}</td>
|
|
<td class="small">{{ pb.sha256[:16] }}…</td>
|
|
<td>
|
|
<a class="badge" href="{{ url_for('user_run', domain=domain, name=pb.name) }}">Ouvrir</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
<hr/>
|
|
{% endfor %}
|
|
{% else %}
|
|
<div class="small">Aucun playbook pour le moment.</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|