Files
Projektarbeit-MYP/backend/app/templates/jobs.html

774 lines
33 KiB
HTML

{% extends "base.html" %}
{% block title %}Druckaufträge - Mercedes-Benz MYP Platform{% endblock %}
{% block extra_css %}
<style>
/* Mercedes-Benz Corporate Design */
.text-mercedes-black { color: #000000; }
.text-mercedes-gray { color: #6b7280; }
.text-mercedes-silver { color: #9ca3af; }
.text-mercedes-blue { color: #0073ce; }
.text-mercedes-green { color: #008c32; }
.text-mercedes-red { color: #dc2626; }
.bg-mercedes-black { background-color: #000000; }
.bg-mercedes-silver { background-color: #e5e7eb; }
.bg-mercedes-blue { background-color: #0073ce; }
.bg-mercedes-green { background-color: #008c32; }
.border-mercedes-silver { border-color: #d1d5db; }
.border-mercedes-blue { border-color: #0073ce; }
.hover\:border-mercedes-blue:hover { border-color: #0073ce; }
.focus\:ring-mercedes-blue:focus {
--tw-ring-color: #0073ce;
--tw-ring-opacity: 0.5;
}
.focus\:border-mercedes-blue:focus { border-color: #0073ce; }
/* Enhanced Job Cards */
.job-card {
background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
border: 1px solid #e2e8f0;
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
border-radius: 16px;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.dark .job-card {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #334155;
box-shadow:
0 4px 6px -1px rgba(0, 0, 0, 0.3),
0 2px 4px -1px rgba(0, 0, 0, 0.2);
}
.job-card:hover {
transform: translateY(-4px);
box-shadow:
0 20px 25px -5px rgba(0, 0, 0, 0.1),
0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.dark .job-card:hover {
box-shadow:
0 20px 25px -5px rgba(0, 0, 0, 0.3),
0 10px 10px -5px rgba(0, 0, 0, 0.2);
}
/* Job Status Indicators */
.status-running {
background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
border-left: 4px solid #3b82f6;
color: #1d4ed8;
}
.status-queued {
background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
border-left: 4px solid #f59e0b;
color: #d97706;
}
.status-completed {
background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
border-left: 4px solid #10b981;
color: #059669;
}
.status-failed {
background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
border-left: 4px solid #ef4444;
color: #dc2626;
}
.status-paused {
background: linear-gradient(90deg, rgba(107, 114, 128, 0.1) 0%, rgba(75, 85, 99, 0.05) 100%);
border-left: 4px solid #6b7280;
color: #4b5563;
}
/* Progress Bars */
.progress-container {
background: #f3f4f6;
height: 8px;
border-radius: 4px;
overflow: hidden;
position: relative;
}
.dark .progress-container {
background: #374151;
}
.progress-bar {
background: linear-gradient(90deg, #0073ce 0%, #1e40af 100%);
height: 100%;
border-radius: 4px;
transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}
.dark .progress-bar {
background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
}
.progress-bar::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
animation: progress-shine 2s infinite;
}
@keyframes progress-shine {
0% { transform: translateX(-100%); }
100% { transform: translateX(100%); }
}
/* Enhanced Filters */
.filter-section {
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
border: 1px solid #e2e8f0;
border-radius: 12px;
padding: 1.5rem;
transition: all 0.3s ease;
}
.dark .filter-section {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #334155;
}
.filter-section:hover {
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
/* Enhanced Form Elements */
.mercedes-form-input {
transition: all 0.2s ease;
border: 1px solid #d1d5db;
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(10px);
}
.mercedes-form-input:focus {
border-color: #0073ce;
box-shadow:
0 0 0 3px rgba(0, 115, 206, 0.1),
0 4px 6px -1px rgba(0, 0, 0, 0.1);
transform: translateY(-1px);
background: rgba(255, 255, 255, 1);
}
.dark .mercedes-form-input {
background: rgba(30, 41, 59, 0.8);
border-color: #475569;
color: #f8fafc;
}
.dark .mercedes-form-input:focus {
border-color: #0ea5e9;
box-shadow:
0 0 0 3px rgba(14, 165, 233, 0.1),
0 4px 6px -1px rgba(0, 0, 0, 0.3);
background: rgba(30, 41, 59, 1);
}
/* Enhanced File Upload */
.file-upload-area {
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
border: 2px dashed #cbd5e1;
border-radius: 12px;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.dark .file-upload-area {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #475569;
}
.file-upload-area:hover {
border-color: #0073ce;
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
transform: scale(1.02);
}
.dark .file-upload-area:hover {
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}
.file-upload-area.drag-over {
border-color: #0073ce;
background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
transform: scale(1.05);
box-shadow: 0 8px 25px rgba(0, 115, 206, 0.15);
}
.dark .file-upload-area.drag-over {
background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}
/* Job Actions Buttons */
.job-action-btn {
padding: 0.375rem 0.75rem;
border-radius: 8px;
font-weight: 500;
font-size: 0.875rem;
transition: all 0.2s ease;
display: inline-flex;
align-items: center;
gap: 0.375rem;
}
.job-action-btn:hover {
transform: translateY(-1px);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.job-action-start {
background: #16a34a;
color: white;
}
.job-action-pause {
background: #f59e0b;
color: white;
}
.job-action-stop {
background: #ef4444;
color: white;
}
.job-action-delete {
background: #dc2626;
color: white;
}
.job-action-view {
background: #0073ce;
color: white;
}
/* Enhanced Modals */
.mercedes-modal {
background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
border: 1px solid #e2e8f0;
box-shadow:
0 25px 50px -12px rgba(0, 0, 0, 0.25),
0 4px 6px -1px rgba(0, 0, 0, 0.1);
border-radius: 16px;
backdrop-filter: blur(10px);
}
.dark .mercedes-modal {
background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
border-color: #334155;
box-shadow:
0 25px 50px -12px rgba(0, 0, 0, 0.5),
0 4px 6px -1px rgba(0, 0, 0, 0.3);
}
/* Loading States */
.loading-skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: loading 2s infinite;
border-radius: 8px;
}
.dark .loading-skeleton {
background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
background-size: 200% 100%;
}
@keyframes loading {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* Real-time Status Updates */
.status-pulse {
animation: pulse-status 2s infinite;
}
@keyframes pulse-status {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
/* Success Animations */
.success-checkmark {
animation: checkmark 0.6s ease-in-out;
}
@keyframes checkmark {
0% {
transform: scale(0);
opacity: 0;
}
50% {
transform: scale(1.2);
opacity: 1;
}
100% {
transform: scale(1);
opacity: 1;
}
}
/* Responsive Design */
@media (max-width: 768px) {
.job-card {
margin: 0 0.5rem;
}
.filter-section {
padding: 1rem;
}
.job-action-btn {
font-size: 0.75rem;
padding: 0.25rem 0.5rem;
}
}
/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Focus States */
.job-card:focus-within {
outline: 2px solid #0073ce;
outline-offset: 2px;
}
.job-action-btn:focus {
outline: 2px solid #0073ce;
outline-offset: 2px;
}
</style>
{% endblock %}
{% block content %}
<div class="space-y-8">
<!-- Enhanced Page Header -->
<div class="dashboard-card p-6">
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-6">
<div class="flex items-center gap-6">
<div class="w-16 h-16 flex-shrink-0 bg-mercedes-blue text-white rounded-xl flex items-center justify-center">
<svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"/>
</svg>
</div>
<div>
<h1 class="text-4xl font-bold text-mercedes-black dark:text-white tracking-tight">Druckaufträge</h1>
<p class="text-mercedes-gray dark:text-slate-400 mt-1 text-lg">Verwalten Sie Ihre 3D-Druckjobs mit höchster Präzision</p>
<div class="flex items-center mt-2 text-sm text-mercedes-blue">
<svg class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
</svg>
Live-Updates alle 30 Sekunden
</div>
</div>
</div>
<div class="flex flex-wrap gap-3">
<button onclick="refreshJobs()" id="refresh-button"
class="btn-secondary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>
</svg>
<span>Aktualisieren</span>
</button>
<button onclick="toggleBatchMode()" id="batch-toggle"
class="btn-secondary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<span>Mehrfachauswahl</span>
</button>
<a href="{{ url_for('new_job_page') if url_for else '/jobs/new' }}"
class="btn-primary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
<span>Neuer Auftrag</span>
</a>
</div>
</div>
</div>
<!-- Enhanced Filter and Search Section -->
<div class="filter-section">
<div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
<!-- Search -->
<div>
<label for="search-input" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
<svg class="w-4 h-4 inline mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
Suchen
</label>
<input type="text" id="search-input" placeholder="Job-Name, ID oder Beschreibung..."
class="mercedes-form-input block w-full px-4 py-3 rounded-lg">
</div>
<!-- Status Filter -->
<div>
<label for="status-filter" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
<svg class="w-4 h-4 inline mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.414A1 1 0 013 6.707V4z"/>
</svg>
Status
</label>
<select id="status-filter" class="mercedes-form-input block w-full px-4 py-3 rounded-lg">
<option value="">Alle Status</option>
<option value="running">Läuft</option>
<option value="queued">Warteschlange</option>
<option value="completed">Abgeschlossen</option>
<option value="failed">Fehlgeschlagen</option>
<option value="paused">Pausiert</option>
</select>
</div>
<!-- Printer Filter -->
<div>
<label for="printer-filter" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
<svg class="w-4 h-4 inline mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
</svg>
Drucker
</label>
<select id="printer-filter" class="mercedes-form-input block w-full px-4 py-3 rounded-lg">
<option value="">Alle Drucker</option>
<!-- Wird dynamisch gefüllt -->
</select>
</div>
<!-- Date Range -->
<div>
<label for="date-filter" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
<svg class="w-4 h-4 inline mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
Zeitraum
</label>
<select id="date-filter" class="mercedes-form-input block w-full px-4 py-3 rounded-lg">
<option value="">Alle Zeiten</option>
<option value="today">Heute</option>
<option value="week">Diese Woche</option>
<option value="month">Dieser Monat</option>
<option value="custom">Benutzerdefiniert</option>
</select>
</div>
</div>
<!-- Advanced Filter Options -->
<div class="mt-4 flex flex-wrap items-center justify-between gap-4">
<div class="flex flex-wrap gap-2">
<button onclick="clearFilters()" class="text-sm text-mercedes-blue hover:text-blue-700 transition-colors">
<svg class="w-4 h-4 inline mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
Filter zurücksetzen
</button>
<span class="text-sm text-mercedes-gray dark:text-slate-400">|</span>
<button onclick="toggleAdvancedFilters()" class="text-sm text-mercedes-blue hover:text-blue-700 transition-colors">
<svg class="w-4 h-4 inline mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4"/>
</svg>
Erweiterte Filter
</button>
</div>
<div class="flex items-center gap-4">
<div class="text-sm text-mercedes-gray dark:text-slate-400">
<span id="results-count">0</span> Aufträge gefunden
</div>
<div class="flex items-center gap-2">
<label for="sort-by" class="text-sm text-mercedes-gray dark:text-slate-400">Sortieren:</label>
<select id="sort-by" class="text-sm border border-mercedes-silver rounded px-2 py-1">
<option value="created_desc">Neueste zuerst</option>
<option value="created_asc">Älteste zuerst</option>
<option value="status">Status</option>
<option value="printer">Drucker</option>
<option value="progress">Fortschritt</option>
</select>
</div>
</div>
</div>
</div>
<!-- Neue Reservierung anlegen -->
<div class="dashboard-card p-6">
<div class="mb-6">
<h2 class="text-xl font-bold text-slate-900 dark:text-white mb-2">
Neue Reservierung anlegen
</h2>
<p class="text-slate-500 dark:text-slate-400">
Erstellen Sie einen neuen Druckauftrag mit professionellen Einstellungen
</p>
</div>
<!-- Queue-Status-Anzeige -->
<div id="queue-status-info" class="mb-6"></div>
<form id="newJobForm" class="space-y-6">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Drucker auswählen -->
<div>
<label for="printer_id" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Drucker auswählen <span class="text-red-500">*</span>
</label>
<select id="printer_id" name="printer_id" required
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
<option value="">Drucker auswählen...</option>
<!-- Wird durch JavaScript gefüllt -->
</select>
<div id="printer-status-info" class="mt-2 text-center">
<!-- Status-Info wird dynamisch gefüllt -->
</div>
<div id="printer-status-warning" class="mt-4 hidden">
<div class="bg-orange-50 dark:bg-orange-900/30 border border-orange-200 dark:border-orange-800 rounded-lg p-4">
<div class="flex">
<div class="flex-shrink-0">
<svg class="h-5 w-5 text-orange-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
</div>
<div class="ml-3">
<h3 class="text-sm font-medium text-orange-800 dark:text-orange-400 mb-2">
Warteschlangen-Modus: Offline-Drucker ausgewählt
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-2 text-sm text-orange-700 dark:text-orange-300">
<div class="flex items-center gap-2">
<div class="w-2 h-2 bg-red-500 rounded-full"></div>
<span>Drucker ist derzeit OFFLINE</span>
</div>
<div class="flex items-center gap-2">
<div class="w-2 h-2 bg-yellow-500 rounded-full"></div>
<span>Job wird in WARTESCHLANGE eingereiht</span>
</div>
<div class="flex items-center gap-2">
<div class="w-2 h-2 bg-blue-500 rounded-full"></div>
<span>System überwacht alle 2 Minuten</span>
</div>
<div class="flex items-center gap-2">
<div class="w-2 h-2 bg-green-500 rounded-full"></div>
<span>Start AUTOMATISCH bei Verfügbarkeit</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Gewünschte Startzeit -->
<div>
<label for="start_time" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Gewünschte Startzeit <span class="text-red-500">*</span>
</label>
<input type="datetime-local" id="start_time" name="start_time" required
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
</div>
<!-- Geschätzte Druckdauer -->
<div>
<label for="duration" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Geschätzte Druckdauer (Minuten) <span class="text-red-500">*</span>
</label>
<input type="number" id="duration" name="duration" required min="1" max="7200"
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder="60">
</div>
</div>
<div class="grid grid-cols-1 gap-6">
<!-- Job-Titel -->
<div>
<label for="job_title" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Job-Titel <span class="text-red-500">*</span>
</label>
<input type="text" id="job_title" name="job_title" required
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder="Geben Sie einen beschreibenden Titel ein">
</div>
<!-- STL-Datei hochladen -->
<div>
<label for="stl_file" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
STL-Datei hochladen (optional)
</label>
<div class="flex items-center justify-center w-full">
<label for="stl_file" class="flex flex-col items-center justify-center w-full h-32 border-2 border-gray-300 dark:border-slate-600 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:bg-slate-700/30 hover:bg-gray-100 dark:hover:bg-slate-700/50 transition-colors">
<div class="flex flex-col items-center justify-center pt-5 pb-6">
<svg class="w-8 h-8 mb-3 text-gray-400 dark:text-gray-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"/>
</svg>
<p class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">Klicken Sie zum Hochladen</span> oder ziehen Sie die Datei hierher</p>
<p class="text-xs text-gray-500 dark:text-gray-400">STL-Dateien bis zu 50MB</p>
</div>
<input id="stl_file" name="stl_file" type="file" accept=".stl" class="hidden" />
</label>
</div>
<div id="file-name" class="mt-2 text-sm text-slate-500 dark:text-slate-400 hidden"></div>
</div>
</div>
<!-- Submit Button -->
<div class="flex items-center justify-end pt-6 border-t border-gray-200 dark:border-slate-600">
<button type="submit" class="btn-primary flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
<span>Reservierung erstellen</span>
</button>
</div>
</form>
</div>
<!-- Aktive und geplante Jobs -->
<div class="dashboard-card p-6">
<div class="mb-6">
<h2 class="text-xl font-bold text-slate-900 dark:text-white mb-2">
Aktive und geplante Jobs
</h2>
<p class="text-slate-500 dark:text-slate-400">
Übersicht Ihrer laufenden und geplanten Druckaufträge mit Echtzeit-Status
</p>
</div>
<div id="active-jobs-container" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Jobs werden dynamisch mit JavaScript geladen -->
<div class="col-span-full py-12 text-center" id="no-jobs-message">
<div class="max-w-sm mx-auto">
<div class="text-slate-400 dark:text-slate-500 mb-4">
<svg class="w-12 h-12 mx-auto" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
</svg>
</div>
<h3 class="text-lg font-semibold text-slate-900 dark:text-white mb-2">Keine aktiven Jobs</h3>
<p class="text-slate-500 dark:text-slate-400">Sie haben derzeit keine aktiven oder geplanten Druckjobs.</p>
</div>
</div>
</div>
</div>
</div>
<!-- Job Details Modal -->
<div id="jobDetailsModal" class="fixed inset-0 bg-black/60 backdrop-blur-sm hidden z-50">
<div class="flex items-center justify-center min-h-screen p-4">
<div class="dashboard-card max-w-2xl w-full p-8 transform transition-all duration-300 scale-95 opacity-0" id="jobModalContent">
<div class="flex justify-between items-center mb-6">
<div>
<h3 class="text-xl font-bold text-slate-900 dark:text-white mb-2">Job Details</h3>
<p class="text-slate-500 dark:text-slate-400">Detaillierte Informationen zu Ihrem Druckauftrag</p>
</div>
<button onclick="closeJobModal()" class="p-2 hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg transition-colors">
<svg class="w-6 h-6 text-slate-500 dark:text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div id="jobDetailsContent">
<!-- Inhalt wird dynamisch geladen -->
</div>
</div>
</div>
</div>
<!-- Job verlängern Modal -->
<div id="extendJobModal" class="fixed inset-0 bg-black/60 backdrop-blur-sm hidden z-50">
<div class="flex items-center justify-center min-h-screen p-4">
<div class="dashboard-card max-w-md w-full p-8 transform transition-all duration-300 scale-95 opacity-0" id="extendModalContent">
<div class="flex justify-between items-center mb-6">
<div>
<h3 class="text-xl font-bold text-slate-900 dark:text-white mb-2">Druckzeit verlängern</h3>
<p class="text-slate-500 dark:text-slate-400">Geben Sie die zusätzlichen Minuten an</p>
</div>
<button onclick="closeExtendModal()" class="p-2 hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg transition-colors">
<svg class="w-6 h-6 text-slate-500 dark:text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<form id="extendJobForm" class="space-y-6">
<input type="hidden" id="extend_job_id" name="job_id">
<div>
<label for="extra_minutes" class="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">
Zusätzliche Minuten
</label>
<input type="number" id="extra_minutes" name="extra_minutes" required min="1" max="720" value="30"
class="block w-full px-3 py-2 border border-gray-300 dark:border-slate-600 rounded-lg bg-white dark:bg-slate-800 text-slate-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
placeholder="30">
</div>
<div class="flex items-center justify-end gap-3 pt-6 border-t border-gray-200 dark:border-slate-600">
<button type="button" onclick="closeExtendModal()" class="btn-secondary">
Abbrechen
</button>
<button type="submit" class="btn-primary">
Verlängern
</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script>
// Globale Variable für Admin-Status
window.isAdmin = {% if current_user.is_admin %}true{% else %}false{% endif %};
// Modal Animations
function showModal(modalId) {
const modal = document.getElementById(modalId);
const content = modal.querySelector('.dashboard-card');
modal.classList.remove('hidden');
setTimeout(() => {
content.classList.remove('scale-95', 'opacity-0');
content.classList.add('scale-100', 'opacity-100');
}, 10);
}
function hideModal(modalId) {
const modal = document.getElementById(modalId);
const content = modal.querySelector('.dashboard-card');
content.classList.remove('scale-100', 'opacity-100');
content.classList.add('scale-95', 'opacity-0');
setTimeout(() => {
modal.classList.add('hidden');
}, 200);
}
function closeJobModal() {
hideModal('jobDetailsModal');
}
function closeExtendModal() {
hideModal('extendJobModal');
}
</script>
{% endblock %}