56b1ab9970
Shares- und Identities-Seite nutzen jetzt ?tab= Query-Parameter statt clientseitigem JS. Der Server steuert aktiven Tab via Jinja2, kein <script>-Block mehr nötig. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
84 lines
3.9 KiB
HTML
84 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Shares – ZMB Webui{% endblock %}
|
||
{% block content %}
|
||
<h2>File Sharing</h2>
|
||
|
||
<!-- Tabs via HTMX -->
|
||
<div role="tablist" style="display:flex;gap:0.5rem;margin-bottom:1.5rem;border-bottom:1px solid var(--pico-muted-border-color);padding-bottom:0.5rem">
|
||
<a role="tab" href="/shares?tab=samba" hx-get="/shares?tab=samba" hx-target="body" hx-push-url="true"
|
||
class="outline{% if tab != 'samba' %} secondary{% endif %}">Samba (SMB)</a>
|
||
<a role="tab" href="/shares?tab=nfs" hx-get="/shares?tab=nfs" hx-target="body" hx-push-url="true"
|
||
class="outline{% if tab != 'nfs' %} secondary{% endif %}">NFS</a>
|
||
<a role="tab" href="/shares?tab=config" hx-get="/shares?tab=config" hx-target="body" hx-push-url="true"
|
||
class="outline{% if tab != 'config' %} secondary{% endif %}">Samba Config</a>
|
||
</div>
|
||
|
||
<!-- Samba Shares -->
|
||
<div id="panel-samba"{% if tab != 'samba' %} style="display:none"{% endif %}>
|
||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem">
|
||
<h3 style="margin:0">Samba Shares</h3>
|
||
<button onclick="document.getElementById('new-samba-form').style.display='block'">+ Neu</button>
|
||
</div>
|
||
|
||
<div id="new-samba-form" style="display:none;margin-bottom:1rem">
|
||
<article>
|
||
<h4>Neuer Samba Share</h4>
|
||
<form hx-post="/api/shares/samba" hx-target="#samba-list" hx-swap="innerHTML"
|
||
hx-on::after-request="this.reset();document.getElementById('new-samba-form').style.display='none'">
|
||
<div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:1rem">
|
||
<div><label>Name</label><input name="name" required placeholder="myshare"></div>
|
||
<div><label>Pfad</label><input name="path" required placeholder="/tank/share"></div>
|
||
<div><label>Kommentar</label><input name="comment" placeholder="Beschreibung"></div>
|
||
</div>
|
||
<div class="actions"><button type="submit">Erstellen</button><button type="button" class="outline secondary" onclick="document.getElementById('new-samba-form').style.display='none'">Abbrechen</button></div>
|
||
</form>
|
||
</article>
|
||
</div>
|
||
|
||
<div id="samba-list"
|
||
hx-get="/fragments/samba-shares"
|
||
hx-trigger="load">
|
||
<p aria-busy="true">Lade...</p>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- NFS -->
|
||
<div id="panel-nfs"{% if tab != 'nfs' %} style="display:none"{% endif %}>
|
||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem">
|
||
<h3 style="margin:0">NFS Exports</h3>
|
||
<button onclick="document.getElementById('new-nfs-form').style.display='block'">+ Neu</button>
|
||
</div>
|
||
|
||
<div id="new-nfs-form" style="display:none;margin-bottom:1rem">
|
||
<article>
|
||
<h4>Neuer NFS Export</h4>
|
||
<form hx-post="/api/shares/nfs" hx-target="#nfs-list" hx-swap="innerHTML"
|
||
hx-on::after-request="this.reset();document.getElementById('new-nfs-form').style.display='none'">
|
||
<div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:1rem">
|
||
<div><label>Pfad</label><input name="path" required placeholder="/tank/share"></div>
|
||
<div><label>Clients</label><input name="clients" required placeholder="*(rw,sync,no_subtree_check)"></div>
|
||
<div><label>Kommentar</label><input name="comment" placeholder="Beschreibung"></div>
|
||
</div>
|
||
<div class="actions"><button type="submit">Erstellen</button><button type="button" class="outline secondary" onclick="document.getElementById('new-nfs-form').style.display='none'">Abbrechen</button></div>
|
||
</form>
|
||
</article>
|
||
</div>
|
||
|
||
<div id="nfs-list"
|
||
hx-get="/fragments/nfs-shares"
|
||
hx-trigger="load">
|
||
<p aria-busy="true">Lade...</p>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Samba Config -->
|
||
<div id="panel-config"{% if tab != 'config' %} style="display:none"{% endif %}>
|
||
<div id="samba-config"
|
||
hx-get="/fragments/samba-config"
|
||
hx-trigger="load">
|
||
<p aria-busy="true">Lade...</p>
|
||
</div>
|
||
</div>
|
||
|
||
{% endblock %}
|