diff --git a/html/rfid.js b/html/rfid.js index 6bdcea2..d3a54a5 100644 --- a/html/rfid.js +++ b/html/rfid.js @@ -555,7 +555,10 @@ function updateNfcData(data) { } // HTML für die Datenanzeige erstellen - let html = ` + let html = ""; + + if(data.sm_id){ + html = `
Brand: ${data.brand || 'N/A'}
Type: ${data.type || 'N/A'} ${data.color_hex ? `` : ''}
- `; + `; - // Spoolman ID anzeigen - html += `Spoolman ID: ${data.sm_id || 'No Spoolman ID'}
`; + // Spoolman ID anzeigen + html += `Spoolman ID: ${data.sm_id || 'No Spoolman ID'}
`; + } + else if(data.location) + { + html = ` +Location: ${data.location || 'N/A'}
+ `; + } + else + { + html = ` +Unknown tag
+ `; + } + + // Nur wenn eine sm_id vorhanden ist, aktualisiere die Dropdowns if (data.sm_id) { @@ -626,11 +646,11 @@ function writeNfcTag() { // Erstelle das NFC-Datenpaket mit korrekten Datentypen const nfcData = { - //color_hex: selectedSpool.filament.color_hex || "FFFFFF", - //type: selectedSpool.filament.material, - //min_temp: minTemp, - //max_temp: maxTemp, - //brand: selectedSpool.filament.vendor.name, + color_hex: selectedSpool.filament.color_hex || "FFFFFF", + type: selectedSpool.filament.material, + min_temp: minTemp, + max_temp: maxTemp, + brand: selectedSpool.filament.vendor.name, sm_id: String(selectedSpool.id) // Konvertiere zu String }; diff --git a/html/rfid_bambu.html b/html/rfid_bambu.html index b3b2527..9fc3210 100644 --- a/html/rfid_bambu.html +++ b/html/rfid_bambu.html @@ -139,6 +139,18 @@