2026-04-24 09:31:50 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="de">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>Prompt Templates</title>
|
refactor: split serve.py and index.html into single-responsibility modules
Backend:
- path_validator.py: PathValidator-Klasse für Pfad-Validierung
- file_ops.py: read_file, write_file, directory_exists, file_exists
- content_types.py: get_content_type mit EXTENSION_MAP
- handler.py: Handler-Klasse mit do_GET/do_PUT, nutzt above modules
- serve.py: Entry-Point (main, find_free_port), setzt Handler.validator/directory
Frontend:
- css/variables.css: CSS-Variablen (--bg-*, --text-*, --accent, etc.)
- css/styles.css: Alle CSS-Regeln (modal, card, template-grid, etc.)
- js/utils.js: esc, showToast, copyContentToClipboard
- js/modal.js: showModal, closeModal, closeEditModal, wasViewModalOpen
- js/editor.js: editModalContent, createJsonEditUI, extractJsonFromForm
- js/api.js: viewTemplate, copyContent, loadTemplates, saveEditedContent
- js/templates.js: renderTemplates, applyFilters, parseTypeFromHash
- js/main.js: Event-Listener, Hash-Filter, Initialisierung
- index.html: Inline-CSS/JS entfernt, <link>/<script src>-Tags hinzugefügt
Smoke test: SO_REUSEADDR für schnelle Port-Wiederverwendung
2026-05-03 14:40:44 +02:00
|
|
|
<link rel="stylesheet" href="css/variables.css">
|
|
|
|
|
<link rel="stylesheet" href="css/styles.css">
|
2026-04-24 09:31:50 +02:00
|
|
|
</head>
|
|
|
|
|
<body>
|
2026-04-24 10:46:15 +02:00
|
|
|
<!-- Modal -->
|
fix: 26 kritische + 29 wichtige Sicherheits- und Robustheitsprobleme behoben
- serve.py: URL-Encoding fix, Body-Limit (10MB), Port-Reuse, TOCTOU-Race, Logging
- index.html: XSS in renderTemplates geheilt, Escape-Key für Edit-Modal, Accessibility
- templates.json: Pfade ohne ../, leere Descriptions ergänzt
- validate.py: categories/ entfernt, CLI-Flags umbenannt, zu mutually_exclusive_group
- smoke_test.sh: set -euo pipefail, Port-Validation, Timeout 5s, code-Fallback
- cleanup_server.sh: lsof statt pgrep, Graceful-Term + SIGKILL-Fallback
- agent_verify.sh: set -euo pipefail, ROOT-Pfade, dynamischer Port, grep-Crash fix
- AGENTS.md: history/ entfernt, Pfad-Schema präzisiert
- README.md: categories/ entfernt, Web-Ansicht + API-Endpunkte hinzugefügt
2026-05-03 14:00:55 +02:00
|
|
|
<div class="modal-overlay" id="modal" role="dialog" aria-label="Template anzeigen">
|
2026-04-24 10:46:15 +02:00
|
|
|
<div class="modal">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h2 id="modal-title">Template</h2>
|
|
|
|
|
<button class="modal-close" onclick="closeModal()">×</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<div class="code-block" id="modal-content">Lädt...</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-actions">
|
|
|
|
|
<button class="btn" onclick="copyModalContent()">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
|
|
|
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
|
|
|
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>
|
|
|
|
|
</svg>
|
|
|
|
|
Inhalt kopieren
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn" onclick="closeModal()">Schließen</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-04-24 10:50:00 +02:00
|
|
|
<!-- Edit Modal -->
|
fix: 26 kritische + 29 wichtige Sicherheits- und Robustheitsprobleme behoben
- serve.py: URL-Encoding fix, Body-Limit (10MB), Port-Reuse, TOCTOU-Race, Logging
- index.html: XSS in renderTemplates geheilt, Escape-Key für Edit-Modal, Accessibility
- templates.json: Pfade ohne ../, leere Descriptions ergänzt
- validate.py: categories/ entfernt, CLI-Flags umbenannt, zu mutually_exclusive_group
- smoke_test.sh: set -euo pipefail, Port-Validation, Timeout 5s, code-Fallback
- cleanup_server.sh: lsof statt pgrep, Graceful-Term + SIGKILL-Fallback
- agent_verify.sh: set -euo pipefail, ROOT-Pfade, dynamischer Port, grep-Crash fix
- AGENTS.md: history/ entfernt, Pfad-Schema präzisiert
- README.md: categories/ entfernt, Web-Ansicht + API-Endpunkte hinzugefügt
2026-05-03 14:00:55 +02:00
|
|
|
<div class="modal-overlay" id="edit-modal" role="dialog" aria-label="Template bearbeiten">
|
2026-04-24 10:50:00 +02:00
|
|
|
<div class="modal" style="max-width: 800px;">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h2 id="edit-title">Template bearbeiten</h2>
|
|
|
|
|
<button class="modal-close" onclick="closeEditModal()">×</button>
|
|
|
|
|
</div>
|
2026-04-24 11:58:18 +02:00
|
|
|
<div class="modal-body" id="edit-content-content" style="min-height: 300px; padding: 16px; overflow-y: auto;"></div>
|
2026-04-24 10:50:00 +02:00
|
|
|
<div class="modal-actions">
|
|
|
|
|
<button class="btn btn-primary" onclick="saveEditedContent()">Speichern</button>
|
|
|
|
|
<button class="btn" onclick="closeEditModal()">Abbrechen</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-04-24 10:46:15 +02:00
|
|
|
<!-- Toast -->
|
2026-05-03 20:09:36 +02:00
|
|
|
<div class="toast" id="toast" role="status" aria-live="polite"></div>
|
2026-04-24 10:46:15 +02:00
|
|
|
|
2026-05-03 15:34:29 +02:00
|
|
|
<!-- Tune Modal -->
|
|
|
|
|
<div class="modal-overlay" id="tune-modal" role="dialog" aria-label="Prompt tunen">
|
|
|
|
|
<div class="modal" style="max-width: 1200px;">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h2 id="tune-title">Prompt tunen</h2>
|
|
|
|
|
<button class="modal-close" onclick="closeTuneModal()">×</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body" id="tune-content" style="display: flex; flex-direction: column; gap: 16px; min-height: 400px; overflow-y: auto;"></div>
|
|
|
|
|
<div class="modal-actions">
|
|
|
|
|
<button class="btn btn-primary" id="tune-generate-btn" onclick="generateTunedTemplate()">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
|
|
|
<path d="M12 2v4m0 12v4m8-8h-4M6 12H2m14.5-7.5L16 5.5m-8 8L5.5 16m13-10.5L16 8m-8 8L5.5 16"/>
|
|
|
|
|
</svg>
|
|
|
|
|
Generieren
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn" id="tune-apply-btn" onclick="applyTunedContent()" style="display:none;">
|
|
|
|
|
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
|
|
|
<path d="M20 6L9 17l-5-5"/>
|
|
|
|
|
</svg>
|
|
|
|
|
Übernehmen
|
|
|
|
|
</button>
|
|
|
|
|
<button class="btn" onclick="closeTuneModal()">Schließen</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-04-24 09:31:50 +02:00
|
|
|
<div class="header">
|
|
|
|
|
<h1>Prompt Templates</h1>
|
|
|
|
|
<span class="badge">Git Managed</span>
|
fix: 26 kritische + 29 wichtige Sicherheits- und Robustheitsprobleme behoben
- serve.py: URL-Encoding fix, Body-Limit (10MB), Port-Reuse, TOCTOU-Race, Logging
- index.html: XSS in renderTemplates geheilt, Escape-Key für Edit-Modal, Accessibility
- templates.json: Pfade ohne ../, leere Descriptions ergänzt
- validate.py: categories/ entfernt, CLI-Flags umbenannt, zu mutually_exclusive_group
- smoke_test.sh: set -euo pipefail, Port-Validation, Timeout 5s, code-Fallback
- cleanup_server.sh: lsof statt pgrep, Graceful-Term + SIGKILL-Fallback
- agent_verify.sh: set -euo pipefail, ROOT-Pfade, dynamischer Port, grep-Crash fix
- AGENTS.md: history/ entfernt, Pfad-Schema präzisiert
- README.md: categories/ entfernt, Web-Ansicht + API-Endpunkte hinzugefügt
2026-05-03 14:00:55 +02:00
|
|
|
<div class="actions"></div>
|
2026-04-24 09:31:50 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
|
<nav class="nav">
|
|
|
|
|
<a href="#" class="active">Alle</a>
|
|
|
|
|
<a href="#?type=system">System</a>
|
|
|
|
|
<a href="#?type=user">User</a>
|
|
|
|
|
<a href="#?type=custom">Custom</a>
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<div class="filter-bar">
|
2026-05-03 20:09:36 +02:00
|
|
|
<input type="text" id="search" placeholder="Suche Templates... (Name, Beschreibung, Tags)" aria-label="Templates durchsuchen">
|
2026-04-24 09:31:50 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
<h2>Templates</h2>
|
|
|
|
|
<span id="count">0 Template(s)</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
<div class="template-grid" id="templates"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="card" style="margin-top: 16px;">
|
|
|
|
|
<div class="card-header">
|
|
|
|
|
<h2>Usage Beispiel</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-body">
|
2026-04-24 10:46:15 +02:00
|
|
|
<div class="code-block"># Validierung
|
2026-04-24 09:31:50 +02:00
|
|
|
$ python scripts/validate.py templates/system/commit_analysis.json
|
|
|
|
|
|
|
|
|
|
# Alle validieren
|
2026-04-24 10:46:15 +02:00
|
|
|
$ python scripts/validate.py --all
|
|
|
|
|
|
|
|
|
|
# Server starten
|
|
|
|
|
$ python web/serve.py</div>
|
2026-04-24 09:31:50 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
refactor: split serve.py and index.html into single-responsibility modules
Backend:
- path_validator.py: PathValidator-Klasse für Pfad-Validierung
- file_ops.py: read_file, write_file, directory_exists, file_exists
- content_types.py: get_content_type mit EXTENSION_MAP
- handler.py: Handler-Klasse mit do_GET/do_PUT, nutzt above modules
- serve.py: Entry-Point (main, find_free_port), setzt Handler.validator/directory
Frontend:
- css/variables.css: CSS-Variablen (--bg-*, --text-*, --accent, etc.)
- css/styles.css: Alle CSS-Regeln (modal, card, template-grid, etc.)
- js/utils.js: esc, showToast, copyContentToClipboard
- js/modal.js: showModal, closeModal, closeEditModal, wasViewModalOpen
- js/editor.js: editModalContent, createJsonEditUI, extractJsonFromForm
- js/api.js: viewTemplate, copyContent, loadTemplates, saveEditedContent
- js/templates.js: renderTemplates, applyFilters, parseTypeFromHash
- js/main.js: Event-Listener, Hash-Filter, Initialisierung
- index.html: Inline-CSS/JS entfernt, <link>/<script src>-Tags hinzugefügt
Smoke test: SO_REUSEADDR für schnelle Port-Wiederverwendung
2026-05-03 14:40:44 +02:00
|
|
|
<!-- Load external JS modules in dependency order -->
|
|
|
|
|
<script src="js/utils.js"></script>
|
|
|
|
|
<script src="js/modal.js"></script>
|
|
|
|
|
<script src="js/editor.js"></script>
|
|
|
|
|
<script src="js/api.js"></script>
|
|
|
|
|
<script src="js/templates.js"></script>
|
|
|
|
|
<script src="js/main.js"></script>
|
2026-04-24 09:31:50 +02:00
|
|
|
</body>
|
|
|
|
|
</html>
|