901 lines
40 KiB
HTML
901 lines
40 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>
|
|
|
|
<!-- Statistics Overview -->
|
|
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
|
|
<div class="dashboard-card p-6 text-center">
|
|
<div class="text-3xl font-bold text-mercedes-blue mb-2" id="total-jobs">-</div>
|
|
<div class="text-sm text-mercedes-gray dark:text-slate-400">Gesamt</div>
|
|
</div>
|
|
<div class="dashboard-card p-6 text-center">
|
|
<div class="text-3xl font-bold text-green-600 mb-2" id="active-jobs">-</div>
|
|
<div class="text-sm text-mercedes-gray dark:text-slate-400">Aktiv</div>
|
|
</div>
|
|
<div class="dashboard-card p-6 text-center">
|
|
<div class="text-3xl font-bold text-yellow-600 mb-2" id="queued-jobs">-</div>
|
|
<div class="text-sm text-mercedes-gray dark:text-slate-400">Warteschlange</div>
|
|
</div>
|
|
<div class="dashboard-card p-6 text-center">
|
|
<div class="text-3xl font-bold text-red-600 mb-2" id="failed-jobs">-</div>
|
|
<div class="text-sm text-mercedes-gray dark:text-slate-400">Fehlgeschlagen</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Enhanced Job Creation Form -->
|
|
<div class="dashboard-card p-8" id="job-form-container">
|
|
<div class="flex items-center justify-between mb-6">
|
|
<div>
|
|
<h2 class="text-2xl font-bold text-mercedes-black dark:text-white mb-2">
|
|
Neuen Druckauftrag erstellen
|
|
</h2>
|
|
<p class="text-mercedes-gray dark:text-slate-400">
|
|
Erstellen Sie schnell eine neue Reservierung oder starten Sie einen kompletten Druckauftrag
|
|
</p>
|
|
</div>
|
|
<button onclick="toggleFormExpansion()" id="form-toggle-btn"
|
|
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="M19 9l-7 7-7-7"/>
|
|
</svg>
|
|
<span>Erweitert</span>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Quick Action Buttons -->
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6" id="quick-actions">
|
|
<button onclick="showQuickReservation()"
|
|
class="p-6 border-2 border-dashed border-mercedes-silver hover:border-mercedes-blue rounded-xl transition-colors group">
|
|
<div class="text-center">
|
|
<svg class="w-8 h-8 mx-auto mb-3 text-mercedes-silver group-hover:text-mercedes-blue transition-colors" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>
|
|
<h3 class="font-semibold text-mercedes-black dark:text-white mb-1">Schnell-Reservierung</h3>
|
|
<p class="text-sm text-mercedes-gray dark:text-slate-400">Reservieren Sie einen Drucker für eine bestimmte Zeit</p>
|
|
</div>
|
|
</button>
|
|
<a href="{{ url_for('new_job_page') if url_for else '/jobs/new' }}"
|
|
class="p-6 border-2 border-dashed border-mercedes-silver hover:border-mercedes-blue rounded-xl transition-colors group">
|
|
<div class="text-center">
|
|
<svg class="w-8 h-8 mx-auto mb-3 text-mercedes-silver group-hover:text-mercedes-blue transition-colors" 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>
|
|
<h3 class="font-semibold text-mercedes-black dark:text-white mb-1">Vollständiger Auftrag</h3>
|
|
<p class="text-sm text-mercedes-gray dark:text-slate-400">Erstellen Sie einen kompletten Druckauftrag mit Datei</p>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Expanded Form (Hidden by default) -->
|
|
<div id="expanded-form" class="hidden">
|
|
<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-mercedes-black 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="mercedes-form-input block w-full px-4 py-3 rounded-lg">
|
|
<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>
|
|
|
|
<!-- Gewünschte Startzeit -->
|
|
<div>
|
|
<label for="start_time" class="block text-sm font-medium text-mercedes-black 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="mercedes-form-input block w-full px-4 py-3 rounded-lg">
|
|
</div>
|
|
|
|
<!-- Geschätzte Druckdauer -->
|
|
<div>
|
|
<label for="duration" class="block text-sm font-medium text-mercedes-black 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="mercedes-form-input block w-full px-4 py-3 rounded-lg"
|
|
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-mercedes-black 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="mercedes-form-input block w-full px-4 py-3 rounded-lg"
|
|
placeholder="Geben Sie einen beschreibenden Titel ein">
|
|
</div>
|
|
|
|
<!-- STL-Datei hochladen -->
|
|
<div>
|
|
<label for="stl_file" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
|
|
3D-Datei hochladen (optional)
|
|
</label>
|
|
<div class="file-upload-area flex items-center justify-center w-full h-32 cursor-pointer" id="file-upload-area">
|
|
<div class="text-center" id="upload-content">
|
|
<svg class="w-8 h-8 mb-3 text-mercedes-silver mx-auto" 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-mercedes-gray dark:text-slate-400">
|
|
<span class="font-semibold">Klicken Sie zum Hochladen</span> oder ziehen Sie die Datei hierher
|
|
</p>
|
|
<p class="text-xs text-mercedes-gray dark:text-slate-400">STL, OBJ, 3MF, GCODE bis zu 100MB</p>
|
|
</div>
|
|
<input id="stl_file" name="stl_file" type="file" accept=".stl,.obj,.3mf,.gcode" class="hidden" />
|
|
</div>
|
|
<div id="file-preview" class="mt-2 text-sm text-mercedes-gray dark:text-slate-400 hidden"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Submit Button -->
|
|
<div class="flex items-center justify-end pt-6 border-t border-mercedes-silver">
|
|
<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>
|
|
</div>
|
|
|
|
<!-- Enhanced Job List -->
|
|
<div class="dashboard-card p-6">
|
|
<div class="flex items-center justify-between mb-6">
|
|
<div>
|
|
<h2 class="text-2xl font-bold text-mercedes-black dark:text-white mb-2">
|
|
Ihre Druckaufträge
|
|
</h2>
|
|
<p class="text-mercedes-gray dark:text-slate-400">
|
|
Übersicht über alle aktiven, geplanten und abgeschlossenen Aufträge
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Batch Actions (Hidden by default) -->
|
|
<div id="batch-actions" class="hidden flex items-center gap-3">
|
|
<span class="text-sm text-mercedes-gray dark:text-slate-400">
|
|
<span id="selected-count">0</span> ausgewählt
|
|
</span>
|
|
<button onclick="batchStart()" class="job-action-btn job-action-start">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.828 14.828a4 4 0 01-5.656 0M9 10h1.586a1 1 0 01.707.293l2.414 2.414a1 1 0 00.707.293H15M9 10V9a2 2 0 012-2h2a2 2 0 012 2v1M9 10v4a2 2 0 002 2h2a2 2 0 002-2v-4"/>
|
|
</svg>
|
|
Starten
|
|
</button>
|
|
<button onclick="batchPause()" class="job-action-btn job-action-pause">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 9v6m4-6v6"/>
|
|
</svg>
|
|
Pausieren
|
|
</button>
|
|
<button onclick="batchDelete()" class="job-action-btn job-action-delete">
|
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
|
|
</svg>
|
|
Löschen
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Loading State -->
|
|
<div id="jobs-loading" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
<div class="job-card p-6">
|
|
<div class="loading-skeleton h-4 w-3/4 mb-3"></div>
|
|
<div class="loading-skeleton h-3 w-1/2 mb-4"></div>
|
|
<div class="loading-skeleton h-2 w-full mb-3"></div>
|
|
<div class="loading-skeleton h-8 w-1/3"></div>
|
|
</div>
|
|
<div class="job-card p-6">
|
|
<div class="loading-skeleton h-4 w-3/4 mb-3"></div>
|
|
<div class="loading-skeleton h-3 w-1/2 mb-4"></div>
|
|
<div class="loading-skeleton h-2 w-full mb-3"></div>
|
|
<div class="loading-skeleton h-8 w-1/3"></div>
|
|
</div>
|
|
<div class="job-card p-6">
|
|
<div class="loading-skeleton h-4 w-3/4 mb-3"></div>
|
|
<div class="loading-skeleton h-3 w-1/2 mb-4"></div>
|
|
<div class="loading-skeleton h-2 w-full mb-3"></div>
|
|
<div class="loading-skeleton h-8 w-1/3"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Jobs Container -->
|
|
<div id="jobs-container" class="hidden">
|
|
<div id="jobs-grid" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
<!-- Jobs werden dynamisch geladen -->
|
|
</div>
|
|
|
|
<!-- Empty State -->
|
|
<div id="no-jobs-message" class="hidden col-span-full py-12 text-center">
|
|
<div class="max-w-sm mx-auto">
|
|
<div class="text-mercedes-silver mb-4">
|
|
<svg class="w-16 h-16 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-xl font-semibold text-mercedes-black dark:text-white mb-2">Keine Aufträge gefunden</h3>
|
|
<p class="text-mercedes-gray dark:text-slate-400 mb-6">Sie haben derzeit keine Druckaufträge, die den Filterkriterien entsprechen.</p>
|
|
<a href="{{ url_for('new_job_page') if url_for else '/jobs/new' }}"
|
|
class="btn-primary inline-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>
|
|
Ersten Auftrag erstellen
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Pagination -->
|
|
<div id="pagination-container" class="hidden mt-8 flex items-center justify-between">
|
|
<div class="text-sm text-mercedes-gray dark:text-slate-400">
|
|
Zeige <span id="page-info">1-10 von 25</span> Aufträgen
|
|
</div>
|
|
<div class="flex items-center gap-2">
|
|
<button id="prev-page" onclick="changePage(-1)"
|
|
class="px-3 py-2 text-sm border border-mercedes-silver rounded-lg hover:bg-mercedes-silver transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
|
|
Zurück
|
|
</button>
|
|
<div id="page-numbers" class="flex items-center gap-1">
|
|
<!-- Wird dynamisch gefüllt -->
|
|
</div>
|
|
<button id="next-page" onclick="changePage(1)"
|
|
class="px-3 py-2 text-sm border border-mercedes-silver rounded-lg hover:bg-mercedes-silver transition-colors disabled:opacity-50 disabled:cursor-not-allowed">
|
|
Weiter
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Enhanced 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="mercedes-modal max-w-4xl 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-2xl font-bold text-mercedes-black dark:text-white mb-2">Job Details</h3>
|
|
<p class="text-mercedes-gray dark:text-slate-400">Detaillierte Informationen und Steuerungsoptionen</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-mercedes-gray 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" class="space-y-6">
|
|
<!-- Inhalt wird dynamisch geladen -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Reservation Modal -->
|
|
<div id="quickReservationModal" 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="mercedes-modal max-w-md w-full p-8 transform transition-all duration-300 scale-95 opacity-0">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<div>
|
|
<h3 class="text-xl font-bold text-mercedes-black dark:text-white mb-2">Schnell-Reservierung</h3>
|
|
<p class="text-mercedes-gray dark:text-slate-400">Reservieren Sie einen Drucker für eine bestimmte Zeit</p>
|
|
</div>
|
|
<button onclick="closeQuickReservationModal()" class="p-2 hover:bg-gray-100 dark:hover:bg-slate-700 rounded-lg transition-colors">
|
|
<svg class="w-6 h-6 text-mercedes-gray 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="quickReservationForm" class="space-y-6">
|
|
<div>
|
|
<label for="quick-printer" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
|
|
Drucker auswählen *
|
|
</label>
|
|
<select id="quick-printer" name="printer_id" required class="mercedes-form-input block w-full px-4 py-3 rounded-lg">
|
|
<option value="">Drucker auswählen...</option>
|
|
<!-- Wird dynamisch gefüllt -->
|
|
</select>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-2 gap-4">
|
|
<div>
|
|
<label for="quick-start-time" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
|
|
Startzeit *
|
|
</label>
|
|
<input type="datetime-local" id="quick-start-time" name="start_time" required
|
|
class="mercedes-form-input block w-full px-4 py-3 rounded-lg">
|
|
</div>
|
|
|
|
<div>
|
|
<label for="quick-duration" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
|
|
Dauer (Min) *
|
|
</label>
|
|
<input type="number" id="quick-duration" name="duration" required min="15" max="480" value="60"
|
|
class="mercedes-form-input block w-full px-4 py-3 rounded-lg">
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label for="quick-title" class="block text-sm font-medium text-mercedes-black dark:text-slate-300 mb-2">
|
|
Reservierungstitel *
|
|
</label>
|
|
<input type="text" id="quick-title" name="title" required
|
|
class="mercedes-form-input block w-full px-4 py-3 rounded-lg"
|
|
placeholder="z.B. Prototyp erstellen">
|
|
</div>
|
|
|
|
<div class="flex items-center justify-end gap-3 pt-6 border-t border-mercedes-silver">
|
|
<button type="button" onclick="closeQuickReservationModal()" class="btn-secondary">
|
|
Abbrechen
|
|
</button>
|
|
<button type="submit" class="btn-primary">
|
|
Reservierung erstellen
|
|
</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 closeQuickReservationModal() {
|
|
hideModal('quickReservationModal');
|
|
}
|
|
</script>
|
|
{% endblock %} |