Server-Bibliothek
2026-07-23 548bab93e55f6e514557571d3c9da9b1c1d59c35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{% extends "base.html" %}
{% block title %}{{ sw.name }} – Server-Bibliothek{% endblock %}
{% block content %}
 
{% set badge = sw.letzte_pruefung | status %}
 
<div class="page-head">
  <div>
    <p class="eyebrow">{{ sw.kategorie or "Ohne Kategorie" }}</p>
    <h1>{{ sw.name }}</h1>
  </div>
  <div class="catalog-actions">
    {% if sw.installer_pfad %}
      <a href="{{ url_for('software_download', software_id=sw.id) }}" class="btn">Herunterladen</a>
    {% endif %}
    <a href="{{ url_for('zuweisung_neu', software_id=sw.id) }}" class="btn btn-secondary">+ Installation protokollieren</a>
    <a href="{{ url_for('software_bearbeiten', software_id=sw.id) }}" class="btn btn-secondary">Bearbeiten</a>
  </div>
</div>
 
<div class="detail-grid">
  <div>
    <div class="panel">
      <h2>Dokumentation / Einrichtung</h2>
      {% if sw.dokumentation %}
        <div class="docs-block">{{ sw.dokumentation }}</div>
      {% else %}
        <p class="hint">Noch keine Dokumentation hinterlegt.</p>
      {% endif %}
 
      {% if bilder %}
      <div class="doku-bilder-grid">
        {% for b in bilder %}
        <div class="doku-bild-kachel">
          <a href="{{ url_for('bild_anzeigen', software_id=sw.id, bild_id=b.id) }}" target="_blank">
            <img src="{{ url_for('bild_anzeigen', software_id=sw.id, bild_id=b.id) }}" alt="Doku-Bild zu {{ sw.name }}">
          </a>
          <form method="post" action="{{ url_for('bild_loeschen', software_id=sw.id, bild_id=b.id) }}"
                onsubmit="return confirm('Bild loeschen?');">
            <button type="submit" class="btn btn-danger btn-small">Löschen</button>
          </form>
        </div>
        {% endfor %}
      </div>
      {% endif %}
 
      <form method="post" action="{{ url_for('bild_hochladen', software_id=sw.id) }}"
            enctype="multipart/form-data" class="bild-upload-form">
        <input type="file" name="bild" accept="image/png,image/jpeg,image/gif,image/webp" required>
        <button type="submit" class="btn btn-secondary btn-small">Bild hochladen</button>
      </form>
    </div>
 
    <div class="panel">
      <h2>Installationsverlauf ({{ verlauf | length }})</h2>
      {% if verlauf %}
        <table class="data-table">
          <thead>
            <tr><th>Mitarbeiter</th><th>Rechner</th><th>Version</th><th>Datum</th><th>Von</th></tr>
          </thead>
          <tbody>
            {% for z in verlauf %}
            <tr>
              <td>
                {% if z.protokoll_id %}
                  <a href="{{ url_for('protokoll_detail', protokoll_id=z.protokoll_id) }}">{{ z.mitarbeiter }}</a>
                {% else %}
                  {{ z.mitarbeiter }}
                {% endif %}
              </td>
              <td>{{ z.rechnername or "–" }}</td>
              <td>{{ z.installierte_version or "–" }}</td>
              <td>{{ z.installiert_am }}</td>
              <td>{{ z.installiert_von or "–" }}</td>
            </tr>
            {% endfor %}
          </tbody>
        </table>
      {% else %}
        <p class="hint">Noch keine Installation fuer dieses Tool protokolliert.</p>
      {% endif %}
    </div>
 
    {% if sw.auto_update %}
    <div class="panel">
      <h2>Update-Protokoll</h2>
      {% if update_verlauf %}
        <table class="data-table">
          <thead>
            <tr><th>Zeitpunkt</th><th>Alte Version</th><th>Neue Version</th><th>Ergebnis</th></tr>
          </thead>
          <tbody>
            {% for log in update_verlauf %}
            <tr>
              <td>{{ log.zeitpunkt[:16].replace("T", " ") }}</td>
              <td>{{ log.alte_version or "–" }}</td>
              <td>{{ log.neue_version or "–" }}</td>
              <td>
                {% if log.erfolg %}
                  <span class="badge status-ok">{{ log.meldung }}</span>
                {% else %}
                  <span class="badge status-warnung">{{ log.meldung }}</span>
                {% endif %}
              </td>
            </tr>
            {% endfor %}
          </tbody>
        </table>
      {% else %}
        <p class="hint">Noch kein automatischer Check gelaufen.</p>
      {% endif %}
    </div>
    {% endif %}
  </div>
 
  <div>
    <div class="panel">
      <h2>Status</h2>
      <p><span class="badge {{ badge[1] }}">{{ badge[0] }}</span></p>
 
      {% if sw.auto_update and sw.update_quelle %}
        <p class="hint" style="margin-top:10px;">Automatische Aktualisierung aktiv ueber
          <strong>{{ {"winget": "winget", "github": "GitHub", "direkt": "Direkter Link"}[sw.update_quelle] or sw.update_quelle }}</strong>.</p>
        <form method="post" action="{{ url_for('software_update_jetzt', software_id=sw.id) }}" style="margin-top:8px;">
          <button type="submit" class="btn btn-small" style="width:100%;">Jetzt automatisch pruefen &amp; aktualisieren</button>
        </form>
      {% else %}
        <form method="post" action="{{ url_for('software_pruefen', software_id=sw.id) }}" style="margin-top:12px;">
          <button type="submit" class="btn btn-secondary btn-small" style="width:100%;">Jetzt als geprueft markieren</button>
        </form>
      {% endif %}
    </div>
 
    <div class="panel">
      <h2>Details</h2>
      <div class="kv-row"><span class="kv-label">Version</span><span class="kv-value">{{ sw.version or "–" }}</span></div>
      <div class="kv-row">
        <span class="kv-label">Ablageordner</span>
        <span class="kv-value" style="display:flex; align-items:center; gap:6px; justify-content:flex-end;">
          {{ sw.installer_pfad or "–" }}
          {% if sw.installer_pfad %}
          <button type="button" class="btn btn-secondary btn-small" style="padding:2px 8px;" onclick="pfadKopieren(this)" data-pfad="{{ sw.installer_pfad }}">Kopieren</button>
          {% endif %}
        </span>
      </div>
      <div class="kv-row"><span class="kv-label">Silent-Parameter</span><span class="kv-value">{{ sw.install_parameter or "–" }}</span></div>
      <div class="kv-row"><span class="kv-label">Angelegt am</span><span class="kv-value">{{ sw.erstellt_am[:10] }}</span></div>
    </div>
 
    <form method="post" action="{{ url_for('software_loeschen', software_id=sw.id) }}"
          onsubmit="return confirm('„{{ sw.name }}“ wirklich loeschen? Das kann nicht rueckgaengig gemacht werden.');">
      <button type="submit" class="btn btn-danger btn-small">Tool loeschen</button>
    </form>
  </div>
</div>
 
<script>
  function pfadKopieren(btn) {
    const pfad = btn.getAttribute("data-pfad");
    navigator.clipboard.writeText(pfad).then(function () {
      const alterText = btn.textContent;
      btn.textContent = "Kopiert!";
      setTimeout(function () { btn.textContent = alterText; }, 1500);
    });
  }
</script>
 
{% endblock %}