@@ -1374,7 +1413,11 @@ var LANG_DE={
update_check:'Auf Updates prüfen',update_checking:'Prüfe...',update_available:'verfügbar',update_none:'Bereits aktuell',
update_apply:'Jetzt installieren',update_applying:'Lade herunter...',update_restarting:'Starte neu...',update_error:'Fehler',
btn_connect:'⚡ Verbinden',btn_disconnect:'✕ Trennen',
- lbl_conn_error:'Verbindungsfehler:'
+ lbl_conn_error:'Verbindungsfehler:',
+ slot_edit_title:'Slot bearbeiten',slot_edit_color:'Farbe',slot_edit_material:'Material',
+ slot_edit_save:'💾 Speichern',slot_edit_custom:'z.B. PLA, PETG, ABS…',
+ slot_edit_ok:'AMS Slot',
+ log_dir_all:'Alle'
};
var LANG_EN={
header_status_standby:'Ready',header_status_printing:'Printing',header_status_complete:'Complete',header_status_error:'Error',
@@ -1402,7 +1445,11 @@ var LANG_EN={
update_check:'Check for Updates',update_checking:'Checking...',update_available:'available',update_none:'Already up to date',
update_apply:'Install Now',update_applying:'Downloading...',update_restarting:'Restarting...',update_error:'Error',
btn_connect:'⚡ Connect',btn_disconnect:'✕ Disconnect',
- lbl_conn_error:'Connection error:'
+ lbl_conn_error:'Connection error:',
+ slot_edit_title:'Edit Slot',slot_edit_color:'Color',slot_edit_material:'Material',
+ slot_edit_save:'💾 Save',slot_edit_custom:'e.g. PLA, PETG, ABS…',
+ slot_edit_ok:'AMS Slot',
+ log_dir_all:'All'
};
var currentLang='de';
var T=LANG_DE;
@@ -1479,6 +1526,12 @@ function applyLang(){
document.querySelectorAll('.lbl-unload').forEach(e=>e.textContent=T.lbl_unload);
// conn-btn text (nur wenn nicht im Übergangszustand)
updateConnBtn();
+ // Slot-Edit-Dialog
+ setText('lbl-slot-color',T.slot_edit_color);
+ setText('lbl-slot-material',T.slot_edit_material);
+ setText('btn-slot-edit-save',T.slot_edit_save);
+ var mi=document.getElementById('slot-edit-mat');if(mi)mi.setAttribute('placeholder',T.slot_edit_custom);
+ setText('logdir-all',T.log_dir_all);
}
function setText(id,txt){var el=document.getElementById(id);if(el)el.textContent=txt;}
(function(){
@@ -1510,6 +1563,8 @@ function showPanel(id){
var consoleLogs=[];
var logAutoScroll=true;
var logBadgeCount=0;
+var logDirFilter='all'; // 'all'|'rx'|'tx'
+var logTopicFilter=''; // '' = no topic filter
function clog(msg,cls){
cls=cls||'msg-info';
@@ -1535,12 +1590,37 @@ function _appendLog(entry,forceCls){
}
renderLog();
}
+function setLogDir(dir){
+ logDirFilter=dir;
+ document.querySelectorAll('.log-dir-btn').forEach(function(b){
+ b.style.background=b.id==='logdir-'+dir?'var(--accent)':'var(--raised)';
+ b.style.color=b.id==='logdir-'+dir?'#fff':'var(--txt2)';
+ });
+ renderLog();
+}
+function setLogTopic(topic){
+ var inp=document.getElementById('log-filter');
+ var active=inp.value===topic;
+ inp.value=active?'':topic;
+ document.querySelectorAll('.log-topic-btn').forEach(function(b){
+ var on=!active&&b.getAttribute('data-topic')===topic;
+ b.style.background=on?'var(--accent)':'var(--raised)';
+ b.style.color=on?'#fff':'var(--txt2)';
+ });
+ renderLog();
+}
function renderLog(){
var el=document.getElementById('console-log');
if(!el)return;
var filter=(document.getElementById('log-filter')||{}).value||'';
var fl=filter.toLowerCase();
- var rows=fl?consoleLogs.filter(l=>l.msg.toLowerCase().includes(fl)):consoleLogs;
+ var rows=consoleLogs.filter(function(l){
+ var m=l.msg;
+ if(logDirFilter==='rx'&&!/ RX[ (]/.test(m))return false;
+ if(logDirFilter==='tx'&&!/ TX[ (]/.test(m))return false;
+ if(fl&&!m.toLowerCase().includes(fl))return false;
+ return true;
+ });
el.innerHTML=rows.map(l=>`
${l.ts}${escHtml(l.msg)}
`).join('');
if(logAutoScroll)el.scrollTop=el.scrollHeight;
}
@@ -1657,6 +1737,7 @@ function applyState(){
// AMS
if(s.ams_slots&&s.ams_slots.length){
+ window._amsSlots=s.ams_slots;
var html='';
s.ams_slots.forEach(function(slot,i){
var empty=slot.status!==5;
@@ -1664,11 +1745,13 @@ function applyState(){
var col='rgb('+rgb[0]+','+rgb[1]+','+rgb[2]+')';
var active=slot.status===1||slot.active;
var pct=empty?T.ams_empty:(slot.consumables_percent!=null?slot.consumables_percent+'%':'–');
- html+='
'
+ var idx=slot.index!=null?slot.index:i;
+ html+='