new file: file_manager.py modified: requirements.txt new file: sessions_db.json modified: templates/base.html new file: templates/file_manager.html new file: templates/file_manager_new.html new file: templates/login.html new file: templates/profile.html new file: templates/users_management.html new file: user_management.py new file: users_db.json
815 lines
29 KiB
HTML
815 lines
29 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}App Installer & Manager - by Simon Giehl{% endblock %}</title>
|
|
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
|
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
|
|
|
<!-- FontAwesome Icons - mit Fallback -->
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet"
|
|
integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw=="
|
|
crossorigin="anonymous" referrerpolicy="no-referrer">
|
|
|
|
<!-- Fallback für FontAwesome -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
|
|
|
|
<style>
|
|
body {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
}
|
|
|
|
.container-fluid {
|
|
background: rgba(255, 255, 255, 0.95);
|
|
backdrop-filter: blur(10px);
|
|
border-radius: 15px;
|
|
margin: 20px;
|
|
padding: 30px;
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.navbar {
|
|
background: rgba(255, 255, 255, 0.9) !important;
|
|
backdrop-filter: blur(10px);
|
|
border-radius: 10px;
|
|
margin-bottom: 20px;
|
|
position: relative;
|
|
z-index: 10001 !important; /* Höchste Priorität für Navbar */
|
|
}
|
|
|
|
.card {
|
|
border: none;
|
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
|
border-radius: 10px;
|
|
transition: transform 0.2s ease-in-out;
|
|
}
|
|
|
|
.card:hover {
|
|
transform: translateY(-5px);
|
|
}
|
|
|
|
.btn {
|
|
border-radius: 8px;
|
|
padding: 8px 16px;
|
|
margin: 2px;
|
|
}
|
|
|
|
.status-badge {
|
|
border-radius: 20px;
|
|
padding: 5px 12px;
|
|
font-size: 0.8em;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.status-running {
|
|
background: #d4edda;
|
|
color: #155724;
|
|
}
|
|
|
|
.status-stopped {
|
|
background: #f8d7da;
|
|
color: #721c24;
|
|
}
|
|
|
|
.status-unknown {
|
|
background: #fff3cd;
|
|
color: #856404;
|
|
}
|
|
|
|
.project-card {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.flash-messages {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.header-stats {
|
|
background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
|
|
color: white;
|
|
padding: 20px;
|
|
border-radius: 10px;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
.stat-item {
|
|
text-align: center;
|
|
}
|
|
|
|
.stat-number {
|
|
font-size: 2em;
|
|
font-weight: bold;
|
|
display: block;
|
|
}
|
|
|
|
.action-buttons {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 5px;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.action-buttons {
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
|
|
/* Dropdown-Menü Styles - Maximale Z-Index Priorität */
|
|
.dropdown-menu {
|
|
border-radius: 10px;
|
|
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
|
|
border: none;
|
|
z-index: 999999 !important;
|
|
position: absolute !important;
|
|
}
|
|
|
|
.dropdown {
|
|
z-index: 999998 !important;
|
|
position: relative !important;
|
|
}
|
|
|
|
/* Navbar Dropdown spezifisch */
|
|
.navbar .dropdown-menu {
|
|
z-index: 1000000 !important;
|
|
position: absolute !important;
|
|
}
|
|
|
|
.navbar .dropdown {
|
|
z-index: 999999 !important;
|
|
position: relative !important;
|
|
}
|
|
|
|
/* Dropdown-Menu-End spezifische Styles */
|
|
.dropdown-menu-end {
|
|
right: 0 !important;
|
|
left: auto !important;
|
|
}
|
|
|
|
/* Global Dropdown-Fix */
|
|
.dropdown-menu.show {
|
|
z-index: 1000000 !important;
|
|
}
|
|
|
|
/* Verhindere andere Elemente über Dropdowns */
|
|
.card {
|
|
z-index: 1;
|
|
position: relative;
|
|
}
|
|
|
|
.modal {
|
|
z-index: 10050 !important; /* Modals über Dropdowns */
|
|
}
|
|
|
|
.modal-backdrop {
|
|
z-index: 10040 !important;
|
|
}
|
|
|
|
/* Spezifische Fixes für überlappende Elemente */
|
|
.container-fluid {
|
|
z-index: 1;
|
|
position: relative;
|
|
}
|
|
|
|
/* Alle anderen Elemente sollen unter Dropdowns bleiben */
|
|
.project-card, .header-stats, .btn, .alert {
|
|
z-index: 1 !important;
|
|
position: relative;
|
|
}
|
|
|
|
/* Sicherstellen, dass Dropdown-Parent korrekt positioniert ist */
|
|
.nav-item.dropdown {
|
|
position: relative !important;
|
|
}
|
|
|
|
/* Dropdown-Menü-Animation und bessere Unterstützung */
|
|
.dropdown-menu {
|
|
transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
|
|
}
|
|
|
|
.dropdown-menu:not(.show) {
|
|
opacity: 0;
|
|
transform: translateY(-10px);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.dropdown-menu.show {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
pointer-events: auto;
|
|
}
|
|
|
|
/* Hover-Effekte für Dropdown-Items */
|
|
.dropdown-item:hover {
|
|
background-color: rgba(0, 123, 255, 0.1);
|
|
transition: background-color 0.15s ease-in-out;
|
|
}
|
|
|
|
/* Mobile-spezifische Dropdown-Styles */
|
|
@media (max-width: 768px) {
|
|
.navbar .dropdown-menu {
|
|
position: static !important;
|
|
z-index: 1000000 !important;
|
|
box-shadow: none;
|
|
border: 1px solid rgba(0,0,0,0.15);
|
|
margin-top: 0.5rem;
|
|
}
|
|
}
|
|
|
|
.project-card {
|
|
transition: all 0.3s ease;
|
|
border-radius: 12px;
|
|
overflow: hidden;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.project-card:hover {
|
|
transform: translateY(-8px);
|
|
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|
}
|
|
|
|
.project-card .card-header {
|
|
border-bottom: none;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.project-card .card-footer {
|
|
border-top: 1px solid rgba(0,0,0,0.125);
|
|
background-color: rgba(0,0,0,0.03);
|
|
}
|
|
|
|
/* Status-Badge-Verbesserungen */
|
|
.status-badge {
|
|
border-radius: 20px;
|
|
padding: 6px 12px;
|
|
font-size: 0.75em;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.status-running {
|
|
background: linear-gradient(45deg, #28a745, #20c997);
|
|
color: white;
|
|
}
|
|
|
|
.status-stopped {
|
|
background: linear-gradient(45deg, #dc3545, #e74c3c);
|
|
color: white;
|
|
}
|
|
|
|
.status-unknown {
|
|
background: linear-gradient(45deg, #ffc107, #fd7e14);
|
|
color: white;
|
|
}
|
|
|
|
/* Tab-Navigation */
|
|
.nav-pills .nav-link {
|
|
border-radius: 25px;
|
|
margin: 0 5px;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.nav-pills .nav-link:hover {
|
|
background-color: #e9ecef;
|
|
}
|
|
|
|
.nav-pills .nav-link.active {
|
|
background: linear-gradient(45deg, #007bff, #0056b3);
|
|
box-shadow: 0 4px 15px rgba(0,123,255,0.3);
|
|
}
|
|
|
|
/* Aktions-Buttons */
|
|
.action-buttons {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 6px;
|
|
justify-content: center;
|
|
}
|
|
|
|
.action-buttons .btn {
|
|
border-radius: 20px;
|
|
padding: 6px 12px;
|
|
font-size: 0.8em;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.action-buttons .btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
|
|
}
|
|
|
|
/* Schnellaktionen */
|
|
.quick-actions .btn {
|
|
border-radius: 12px;
|
|
padding: 12px;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.quick-actions .btn:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 6px 15px rgba(0,0,0,0.15);
|
|
}
|
|
|
|
/* Progress Modal */
|
|
.progress {
|
|
height: 8px;
|
|
border-radius: 4px;
|
|
background-color: #f0f0f0;
|
|
}
|
|
|
|
.progress-bar {
|
|
border-radius: 4px;
|
|
}
|
|
|
|
/* Notification Styles */
|
|
.alert {
|
|
border-radius: 10px;
|
|
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
/* Responsive Verbesserungen */
|
|
@media (max-width: 768px) {
|
|
.action-buttons {
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.action-buttons .btn {
|
|
flex: 1;
|
|
margin: 2px;
|
|
padding: 8px 4px;
|
|
font-size: 0.7em;
|
|
}
|
|
|
|
.category-stat {
|
|
min-height: 100px;
|
|
}
|
|
|
|
.stat-number-cat {
|
|
font-size: 1.5em;
|
|
}
|
|
|
|
.tech-stat {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.nav-pills .nav-link {
|
|
margin: 2px 0;
|
|
font-size: 0.85em;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 576px) {
|
|
.header-stats .stat-item {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.stat-number {
|
|
font-size: 1.5em;
|
|
}
|
|
|
|
.project-card {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.action-buttons .btn {
|
|
padding: 6px 8px;
|
|
font-size: 0.65em;
|
|
}
|
|
}
|
|
|
|
/* Animationen */
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(20px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.project-card {
|
|
animation: fadeIn 0.5s ease forwards;
|
|
}
|
|
|
|
.project-card:nth-child(1) { animation-delay: 0.1s; }
|
|
.project-card:nth-child(2) { animation-delay: 0.2s; }
|
|
.project-card:nth-child(3) { animation-delay: 0.3s; }
|
|
.project-card:nth-child(4) { animation-delay: 0.4s; }
|
|
.project-card:nth-child(5) { animation-delay: 0.5s; }
|
|
.project-card:nth-child(6) { animation-delay: 0.6s; }
|
|
|
|
/* Hover-Effekte für Kategorie-Badges */
|
|
.badge {
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.badge:hover {
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
/* Loading States */
|
|
.btn.loading {
|
|
position: relative;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.btn.loading::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
width: 16px;
|
|
height: 16px;
|
|
margin-top: -8px;
|
|
margin-left: -8px;
|
|
border: 2px solid transparent;
|
|
border-top: 2px solid #fff;
|
|
border-radius: 50%;
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
0% { transform: rotate(0deg); }
|
|
100% { transform: rotate(360deg); }
|
|
}
|
|
|
|
/* Dark Mode Unterstützung */
|
|
@media (prefers-color-scheme: dark) {
|
|
.tech-stat {
|
|
background-color: #2d3748 !important;
|
|
color: white !important;
|
|
}
|
|
|
|
.project-card .card-footer {
|
|
background-color: rgba(255,255,255,0.05);
|
|
}
|
|
|
|
.category-stat {
|
|
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
|
|
}
|
|
}
|
|
|
|
/* Benutzerdefinierte Scrollbar */
|
|
.tab-content {
|
|
max-height: 80vh;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.tab-content::-webkit-scrollbar {
|
|
width: 8px;
|
|
}
|
|
|
|
.tab-content::-webkit-scrollbar-track {
|
|
background: #f1f1f1;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.tab-content::-webkit-scrollbar-thumb {
|
|
background: #888;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.tab-content::-webkit-scrollbar-thumb:hover {
|
|
background: #555;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<nav class="navbar navbar-expand-lg navbar-light">
|
|
<div class="container-fluid">
|
|
<a class="navbar-brand" href="{{ url_for('index') }}">
|
|
<i class="fas fa-rocket me-2"></i>App Manager
|
|
</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav me-auto">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('index') }}">
|
|
<i class="fas fa-home"></i> Dashboard
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('available_projects') }}">
|
|
<i class="fas fa-download"></i> Verfügbare Apps
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('docker_status') }}">
|
|
<i class="fas fa-cube"></i> Docker Status
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('file_manager_view') }}">
|
|
<i class="fas fa-folder-open"></i> File Manager
|
|
</a>
|
|
</li>
|
|
<!-- Admin/Moderator Navigation -->
|
|
{% if session.user_role in ['admin', 'moderator'] %}
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle" href="#" id="adminDropdown" role="button" data-bs-toggle="dropdown">
|
|
<i class="fas fa-cogs"></i> Verwaltung
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li><a class="dropdown-item" href="{{ url_for('config') }}">
|
|
<i class="fas fa-cog me-2"></i>System-Konfiguration
|
|
</a></li>
|
|
{% if session.user_role == 'admin' %}
|
|
<li><a class="dropdown-item" href="{{ url_for('users_management') }}">
|
|
<i class="fas fa-users me-2"></i>Benutzerverwaltung
|
|
</a></li>
|
|
{% endif %}
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a class="dropdown-item" href="#">
|
|
<i class="fas fa-chart-line me-2"></i>System-Monitoring
|
|
</a></li>
|
|
<li><a class="dropdown-item" href="#">
|
|
<i class="fas fa-download me-2"></i>Backups
|
|
</a></li>
|
|
</ul>
|
|
</li>
|
|
{% else %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ url_for('config') }}">
|
|
<i class="fas fa-cog"></i> Konfiguration
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
|
|
<!-- User Menu -->
|
|
<div class="navbar-nav">
|
|
{% if session.username %}
|
|
<div class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle d-flex align-items-center" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown">
|
|
<div class="user-avatar-small me-2" style="width: 30px; height: 30px; border-radius: 50%; background: #667eea; color: white; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: bold;">
|
|
{{ session.username[0].upper() }}
|
|
</div>
|
|
{{ session.username }}
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-end">
|
|
<li class="dropdown-header">
|
|
<small class="text-muted">
|
|
Angemeldet als <strong>{{ session.user_role.title() }}</strong>
|
|
</small>
|
|
</li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a class="dropdown-item" href="{{ url_for('profile') }}">
|
|
<i class="fas fa-user me-2"></i>Mein Profil
|
|
</a></li>
|
|
<li><a class="dropdown-item" href="#">
|
|
<i class="fas fa-cog me-2"></i>Einstellungen
|
|
</a></li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a class="dropdown-item text-danger" href="{{ url_for('logout') }}">
|
|
<i class="fas fa-sign-out-alt me-2"></i>Abmelden
|
|
</a></li>
|
|
</ul>
|
|
</div>
|
|
{% else %}
|
|
<a class="nav-link btn btn-outline-primary" href="{{ url_for('login') }}">
|
|
<i class="fas fa-sign-in-alt"></i> Anmelden
|
|
</a>
|
|
{% endif %}
|
|
|
|
<!-- Refresh Button für angemeldete Benutzer -->
|
|
{% if session.username %}
|
|
<a class="nav-link btn btn-outline-secondary ms-2" href="{{ url_for('refresh_projects') }}">
|
|
<i class="fas fa-sync-alt"></i> Aktualisieren
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="container-fluid">
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
<div class="flash-messages">
|
|
{% for category, message in messages %}
|
|
<div class="alert alert-{{ 'danger' if category == 'error' else 'success' if category == 'success' else 'info' }} alert-dismissible fade show" role="alert">
|
|
{{ message }}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
|
|
<!-- Footer -->
|
|
<footer class="mt-5 py-4 text-center" style="background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); border-radius: 15px 15px 0 0; margin: 20px;">
|
|
<div class="container">
|
|
<p class="mb-1 text-muted">
|
|
<i class="fas fa-rocket me-2"></i><strong>App Installer & Manager</strong>
|
|
</p>
|
|
<p class="mb-0 small text-muted">
|
|
Entwickelt von <strong>Simon Giehl</strong> © 2025 |
|
|
<i class="fab fa-docker me-1"></i>Docker-basiertes Projektmanagement
|
|
</p>
|
|
</div>
|
|
</footer>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
// Auto-refresh status alle 30 Sekunden
|
|
setInterval(function() {
|
|
if (window.location.pathname === '/') {
|
|
location.reload();
|
|
}
|
|
}, 30000);
|
|
|
|
// Installationsfortschritt
|
|
function installProject(url, name, method = 'clone') {
|
|
const button = event.target;
|
|
const originalText = button.innerHTML;
|
|
|
|
// Spezifischer Loading-Text basierend auf Methode
|
|
if (method === 'image' || method === 'docker_registry' || method === 'docker_url') {
|
|
button.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Docker lädt...';
|
|
} else if (method === 'docker_build' || method === 'dockerfile') {
|
|
button.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Wird gebaut...';
|
|
} else {
|
|
button.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Installiere...';
|
|
}
|
|
button.disabled = true;
|
|
|
|
fetch('/install_project', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
body: `project_url=${encodeURIComponent(url)}&project_name=${encodeURIComponent(name)}&installation_method=${encodeURIComponent(method)}`
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
if (data.success) {
|
|
button.innerHTML = '<i class="fas fa-check"></i> Installiert';
|
|
button.className = 'btn btn-success btn-sm';
|
|
setTimeout(() => {
|
|
location.reload();
|
|
}, 2000);
|
|
} else {
|
|
button.innerHTML = originalText;
|
|
button.disabled = false;
|
|
alert('Fehler: ' + data.message);
|
|
}
|
|
})
|
|
.catch(error => {
|
|
button.innerHTML = originalText;
|
|
button.disabled = false;
|
|
alert('Netzwerkfehler: ' + error);
|
|
});
|
|
}
|
|
|
|
// Bestätigungsdialog für gefährliche Aktionen
|
|
function confirmAction(action, projectName) {
|
|
if (action === 'remove') {
|
|
return confirm(`Möchten Sie das Projekt "${projectName}" wirklich vollständig entfernen? Diese Aktion kann nicht rückgängig gemacht werden.`);
|
|
}
|
|
return true;
|
|
}
|
|
|
|
// Icon Fallback System
|
|
function checkAndFixIcons() {
|
|
// Prüfe ob FontAwesome geladen wurde
|
|
const testIcon = document.createElement('i');
|
|
testIcon.className = 'fas fa-home';
|
|
testIcon.style.visibility = 'hidden';
|
|
testIcon.style.position = 'absolute';
|
|
document.body.appendChild(testIcon);
|
|
|
|
setTimeout(() => {
|
|
const computed = window.getComputedStyle(testIcon);
|
|
const fontFamily = computed.getPropertyValue('font-family');
|
|
|
|
if (!fontFamily.includes('Font Awesome')) {
|
|
console.warn('FontAwesome nicht geladen - verwende Bootstrap Icons als Fallback');
|
|
replaceFontAwesome();
|
|
}
|
|
|
|
document.body.removeChild(testIcon);
|
|
}, 100);
|
|
}
|
|
|
|
function replaceFontAwesome() {
|
|
// FontAwesome zu Bootstrap Icons Mapping
|
|
const iconMap = {
|
|
'fas fa-home': 'bi bi-house-fill',
|
|
'fas fa-plus': 'bi bi-plus',
|
|
'fas fa-play': 'bi bi-play-fill',
|
|
'fas fa-stop': 'bi bi-stop-fill',
|
|
'fas fa-trash': 'bi bi-trash-fill',
|
|
'fas fa-cog': 'bi bi-gear-fill',
|
|
'fas fa-docker': 'bi bi-app-indicator',
|
|
'fas fa-cube': 'bi bi-cube',
|
|
'fas fa-check': 'bi bi-check',
|
|
'fas fa-times': 'bi bi-x',
|
|
'fas fa-spinner fa-spin': 'bi bi-arrow-clockwise',
|
|
'fas fa-exclamation-triangle': 'bi bi-exclamation-triangle-fill',
|
|
'fas fa-info-circle': 'bi bi-info-circle-fill',
|
|
'fas fa-download': 'bi bi-download',
|
|
'fas fa-upload': 'bi bi-upload',
|
|
'fas fa-sync-alt': 'bi bi-arrow-repeat',
|
|
'fas fa-server': 'bi bi-server',
|
|
'fas fa-box': 'bi bi-box',
|
|
'fas fa-layer-group': 'bi bi-layers',
|
|
'fas fa-terminal': 'bi bi-terminal',
|
|
'fas fa-rocket': 'bi bi-rocket',
|
|
'fas fa-stethoscope': 'bi bi-heart-pulse',
|
|
'fas fa-clipboard-list': 'bi bi-clipboard-check',
|
|
'fas fa-bolt': 'bi bi-lightning',
|
|
'fas fa-redo': 'bi bi-arrow-clockwise',
|
|
'fas fa-external-link-alt': 'bi bi-box-arrow-up-right',
|
|
'fas fa-clipboard-check': 'bi bi-clipboard-check',
|
|
'fas fa-question-circle': 'bi bi-question-circle',
|
|
'fas fa-book': 'bi bi-book',
|
|
'fas fa-wrench': 'bi bi-wrench',
|
|
'fas fa-file-export': 'bi bi-file-earmark-arrow-down',
|
|
'fas fa-broom': 'bi bi-brush'
|
|
};
|
|
|
|
// Erweiterte Ersetzung für komplexe Selektoren
|
|
const complexSelectors = [
|
|
'i[class*="fas fa-"]',
|
|
'i[class*="far fa-"]',
|
|
'i[class*="fab fa-"]'
|
|
];
|
|
|
|
complexSelectors.forEach(selector => {
|
|
const elements = document.querySelectorAll(selector);
|
|
elements.forEach(el => {
|
|
const classes = el.className.split(' ');
|
|
const faClasses = classes.filter(cls => cls.startsWith('fa'));
|
|
const faString = faClasses.join(' ');
|
|
|
|
if (iconMap[faString]) {
|
|
// Ersetze nur die FontAwesome-Klassen, behalte andere bei
|
|
const otherClasses = classes.filter(cls => !cls.startsWith('fa'));
|
|
const newClasses = [iconMap[faString], ...otherClasses];
|
|
el.className = newClasses.join(' ');
|
|
} else if (faClasses.length > 0) {
|
|
// Fallback für nicht gemappte Icons
|
|
console.warn(`Unbekanntes FontAwesome Icon: ${faString}`);
|
|
const otherClasses = classes.filter(cls => !cls.startsWith('fa'));
|
|
el.className = ['bi bi-question-circle', ...otherClasses].join(' ');
|
|
}
|
|
});
|
|
});
|
|
}
|
|
|
|
// System Status Check für bessere UX
|
|
function checkSystemHealth() {
|
|
if (window.location.pathname !== '/config') {
|
|
return; // Nur auf bestimmten Seiten ausführen
|
|
}
|
|
|
|
fetch('/api/system_status')
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
// Update UI basierend auf System Status
|
|
if (!data.docker.available) {
|
|
showSystemAlert('Docker ist nicht verfügbar. <a href="/docker_status">Diagnose ausführen</a>');
|
|
}
|
|
})
|
|
.catch(error => {
|
|
console.log('System Health Check fehlgeschlagen:', error);
|
|
});
|
|
}
|
|
|
|
function showSystemAlert(message) {
|
|
const alertDiv = document.createElement('div');
|
|
alertDiv.className = 'alert alert-warning alert-dismissible fade show';
|
|
alertDiv.innerHTML = `
|
|
${message}
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|
`;
|
|
|
|
const container = document.querySelector('.container-fluid');
|
|
if (container) {
|
|
container.insertBefore(alertDiv, container.firstChild);
|
|
}
|
|
}
|
|
|
|
// Initialize on page load
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
checkAndFixIcons();
|
|
checkSystemHealth();
|
|
// Dropdowns funktionieren automatisch mit Bootstrap - keine zusätzliche Initialisierung nötig
|
|
});
|
|
|
|
// Bootstrap Dropdowns funktionieren automatisch ohne zusätzliches JavaScript
|
|
</script>
|
|
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|