492 lines
18 KiB
HTML
492 lines
18 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;
|
|
}
|
|
|
|
.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 */
|
|
.dropdown-menu {
|
|
border-radius: 10px;
|
|
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
|
|
border: none;
|
|
}
|
|
|
|
.dropdown-item {
|
|
padding: 10px 15px;
|
|
border-radius: 6px;
|
|
margin: 2px 5px;
|
|
transition: background-color 0.2s ease;
|
|
}
|
|
|
|
.dropdown-item:hover {
|
|
background-color: #f8f9fa;
|
|
}
|
|
|
|
.dropdown-item i {
|
|
width: 20px;
|
|
text-align: center;
|
|
}
|
|
|
|
.dropdown-toggle-split {
|
|
border-left: 1px solid rgba(255, 255, 255, 0.2);
|
|
}
|
|
|
|
/* Installation Button Group */
|
|
.btn-group .btn-success {
|
|
border-top-right-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
}
|
|
|
|
.btn-group .dropdown-toggle-split {
|
|
border-top-left-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
padding-left: 8px;
|
|
padding-right: 8px;
|
|
}
|
|
|
|
/* Deaktivierte Dropdown-Buttons */
|
|
.dropdown-toggle-split.disabled,
|
|
.dropdown-toggle-split:disabled {
|
|
cursor: not-allowed;
|
|
opacity: 0.6;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.dropdown-item.disabled {
|
|
opacity: 0.5;
|
|
pointer-events: none;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Tooltip für deaktivierte Buttons */
|
|
.btn[title]:disabled {
|
|
cursor: help;
|
|
}
|
|
|
|
/* Neue Kategorie-Statistiken */
|
|
.category-stat {
|
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
|
border: none;
|
|
min-height: 120px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
}
|
|
|
|
.category-stat:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|
}
|
|
|
|
.stat-number-cat {
|
|
font-size: 2em;
|
|
font-weight: bold;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.tech-stat {
|
|
border: 1px solid #e0e0e0;
|
|
transition: background-color 0.2s ease;
|
|
}
|
|
|
|
.tech-stat:hover {
|
|
background-color: rgba(0,0,0,0.05) !important;
|
|
}
|
|
|
|
/* Verbesserte Header-Stats */
|
|
.header-stats {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
|
padding: 30px !important;
|
|
border-radius: 15px !important;
|
|
margin-bottom: 30px !important;
|
|
box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
|
|
}
|
|
|
|
.stat-item {
|
|
text-align: center !important;
|
|
color: white !important;
|
|
padding: 15px !important;
|
|
}
|
|
|
|
.stat-number {
|
|
display: block !important;
|
|
font-size: 2.5em !important;
|
|
font-weight: bold !important;
|
|
margin-bottom: 5px !important;
|
|
}
|
|
|
|
.stat-item span:last-child {
|
|
font-size: 0.9em !important;
|
|
opacity: 0.9 !important;
|
|
}
|
|
</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('config') }}">
|
|
<i class="fas fa-cog"></i> Konfiguration
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<div class="navbar-nav">
|
|
<a class="nav-link btn btn-outline-primary" href="{{ url_for('refresh_projects') }}">
|
|
<i class="fas fa-sync-alt"></i> Aktualisieren
|
|
</a>
|
|
</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) {
|
|
const button = event.target;
|
|
const originalText = button.innerHTML;
|
|
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)}`
|
|
})
|
|
.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();
|
|
});
|
|
</script>
|
|
|
|
{% block scripts %}{% endblock %}
|
|
</body>
|
|
</html>
|