show ams trays with colors
This commit is contained in:
parent
130c51f09f
commit
8f629ce535
1 changed files with 22 additions and 2 deletions
|
|
@ -220,7 +220,7 @@ self.kiri.load(api => {
|
||||||
print_error,
|
print_error,
|
||||||
print_type,
|
print_type,
|
||||||
sdcard,
|
sdcard,
|
||||||
spd_lvl, // 1,2,3,4 (2 = default)
|
spd_lvl, // speed 1,2,3,4 (2 = default)
|
||||||
total_layer_num,
|
total_layer_num,
|
||||||
upload
|
upload
|
||||||
} = print || {};
|
} = print || {};
|
||||||
|
|
@ -231,6 +231,7 @@ self.kiri.load(api => {
|
||||||
});
|
});
|
||||||
}).flat();
|
}).flat();
|
||||||
if (trays && trays.length) {
|
if (trays && trays.length) {
|
||||||
|
console.log(trays);
|
||||||
let options = trays.map(tray => h.option({
|
let options = trays.map(tray => h.option({
|
||||||
_: tray.id,
|
_: tray.id,
|
||||||
_selected: tray_now === tray.id,
|
_selected: tray_now === tray.id,
|
||||||
|
|
@ -240,6 +241,24 @@ self.kiri.load(api => {
|
||||||
h.option({ _: 'none', value: '255' }),
|
h.option({ _: 'none', value: '255' }),
|
||||||
...options
|
...options
|
||||||
]);
|
]);
|
||||||
|
let tdiv = $('bbl_ams_trays');
|
||||||
|
tdiv.setAttribute("style",[
|
||||||
|
"gap: 5px;",
|
||||||
|
"display:grid",
|
||||||
|
`grid-template-columns:repeat(4,1fr)`,
|
||||||
|
`grid-template-rows:repeat(${ams.ams.length},auto)`
|
||||||
|
].join(';'))
|
||||||
|
h.bind(tdiv, trays.map(tray => h.button({
|
||||||
|
_: tray.tray_type,
|
||||||
|
class:"a-center",
|
||||||
|
style: [
|
||||||
|
tray_now === tray.id ? `border-color: red` : undefined,
|
||||||
|
tray.tray_color ? undefined : `border-style: dashed`,
|
||||||
|
`background-color:#${tray.tray_color||'000'}`,
|
||||||
|
`min-height:10px`,
|
||||||
|
`aspect-ratio:1`
|
||||||
|
].filter(v => v).join(';')
|
||||||
|
})))
|
||||||
} else {
|
} else {
|
||||||
$('bbl_ams_tray').innerHTML = '';
|
$('bbl_ams_tray').innerHTML = '';
|
||||||
}
|
}
|
||||||
|
|
@ -645,8 +664,9 @@ self.kiri.load(api => {
|
||||||
target: parseInt(new_tray)
|
target: parseInt(new_tray)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} })
|
} }),
|
||||||
]),
|
]),
|
||||||
|
h.div({ id: "bbl_ams_trays" })
|
||||||
]),
|
]),
|
||||||
h.div({ class: "t-body t-inset f-col gap3 pad4 grow" }, [
|
h.div({ class: "t-body t-inset f-col gap3 pad4 grow" }, [
|
||||||
h.label({ class: "set-header dev-sel" }, [
|
h.label({ class: "set-header dev-sel" }, [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue