highlight active printer compoments (heating, fans)

This commit is contained in:
Stewart Allen 2025-02-12 12:56:04 -05:00
commit f442ce6e41
2 changed files with 18 additions and 3 deletions

View file

@ -39,7 +39,7 @@ self.kiri.load(api => {
// printer_status(`error: ${error}`);
} else if (frame) {
if (selected?.rec?.serial !== serial) {
console.log({
false && console.log({
frame_serial_mismatch: serial,
current: selected?.rec?.serial
});
@ -231,7 +231,6 @@ self.kiri.load(api => {
});
}).flat();
if (trays && trays.length) {
console.log(trays);
let options = trays.map(tray => h.option({
_: tray.id,
_selected: tray_now === tray.id,
@ -250,7 +249,7 @@ self.kiri.load(api => {
].join(';'))
h.bind(tdiv, trays.map(tray => h.button({
_: tray.tray_type,
class:"a-center",
class:`a-center${tray.tray_color?'':' checker'}`,
style: [
tray_now === tray.id ? `border-color: red` : undefined,
tray.tray_color ? undefined : `border-style: dashed`,
@ -280,6 +279,13 @@ self.kiri.load(api => {
$('bbl_fan_2_on').checked = big_fan2_speed > 0 ? true : false;
$('bbl_fan_heatbreak').value = heatbreak_fan_speed || 0;
$('bbl_file_active').value = gcode_file || '';
ui.setClass($('bbl_noz_target'), 'bred', nozzle_target_temper > 0);
ui.setClass($('bbl_bed_target'), 'bred', bed_target_temper > 0);
ui.setClass($('bbl_fan_part'), 'bred', cooling_fan_speed > 0);
ui.setClass($('bbl_fan_1'), 'bred', big_fan1_speed > 0);
ui.setClass($('bbl_fan_2'), 'bred', big_fan2_speed > 0);
ui.setClass($('bbl_fan_heatbreak'), 'bred', heatbreak_fan_speed > 0);
ui.setClass($('bbl_file_active'), 'bred', gcode_file);
if (selected && files && filelist.selectedIndex === -1) {
h.bind(filelist, files.map(file => {
let name = file.name

View file

@ -629,6 +629,15 @@ details[open] summary::after {
.bt2 {
border: 2px solid transparent;
}
.bred {
border-color: red !important;
}
.checker {
background:
linear-gradient(135deg, transparent 45%, #555 45%, #555 55%, transparent 55%) !important;
background-size: 10px 10px;
background-position: 0 0, 5px 5px;
}
.contents {
display: contents;
}