diff --git a/sys0-code/test/overview.php b/sys0-code/test/overview.php index ad687d4..11b5f78 100644 --- a/sys0-code/test/overview.php +++ b/sys0-code/test/overview.php @@ -256,68 +256,30 @@ function updatePrinterData(data) { } if(printer.view==0 || printer.view==2){ -// Assuming `printerCardContainer` is the parent element where cards are appended -const printerCardContainer = document.getElementById('printerCardsContainer'); -let printerCard = document.getElementById(`printer-${printer.printer_id}`); - -if (!printerCard) { - // Create a new card element if it doesn't exist - printerCard = document.createElement('div'); - printerCard.id = `printer-${printer.printer_id}`; - printerCard.className = 'card'; - - // Optionally, add an iframe if it's part of the initial structure - const iframe = document.createElement('iframe'); - iframe.src = ''; // Set the source if needed - printerCard.appendChild(iframe); - - // Append the new card to the container - printerCardContainer.appendChild(printerCard); -} - -// Now handle updating the card content -if (own_id == printer.userid || cancel_all == "1") { - // Locate the iframe within the card - const iframe = printerCard.querySelector('iframe'); - if (!iframe) return; // If iframe doesn't exist, exit (though it should always exist now) - - // Construct the new HTML content - const data = ` -
| Status | ${printerStatus} |
| Genutzt von | ${printer.username} |
| Filamentfarbe | ${printer.filament_color} |
| Erwartete Druckzeit | ${printer.print_time_total} |
| Verbleibende Druckzeit | ${printer.print_time_left} |
| Vergangene Druckzeit | ${printer.print_time} |
| Datei | ${printer.file} ${printer.full_file} |
| Freigeben |
| Status | ${printerStatus} |
| Genutzt von | ${printer.username} |
| Filamentfarbe | ${printer.filament_color} |
| Erwartete Druckzeit | ${printer.print_time_total} |
| Verbleibende Druckzeit | ${printer.print_time_left} |
| Vergangene Druckzeit | ${printer.print_time} |
| Datei | ${printer.file} ${printer.full_file} |
| Freigeben |