fixed make

This commit is contained in:
Seth Trowbridge 2025-11-03 15:22:18 -05:00
parent cbcf559bac
commit 2ca31bb21d

27
app.js
View File

@ -137,7 +137,8 @@ function Desks(inDesks)
for(const [pass, scan] of desk.pass) for(const [pass, scan] of desk.pass)
{ {
const drawDirtyAsCaution = scan.need_empty.length>0 && scan.need_empty.length<desk.need.length; // at least one but not all need fields are empty
const caution = scan.need_empty.length>0 && scan.need_empty.length<desk.need.length;
work.push(DOM.tr( work.push(DOM.tr(
DOM.td(pass.name), DOM.td(pass.name),
@ -158,7 +159,7 @@ function Desks(inDesks)
) )
); );
}), }),
DOM.td("->"), DOM.td(""),
desk.make.map((part, index, array)=> desk.make.map((part, index, array)=>
{ {
const partPass = part.pass.get(pass); const partPass = part.pass.get(pass);
@ -185,9 +186,27 @@ function Desks(inDesks)
} }
}; };
if(latest)
{
attributes.class = Tag("PartGood")
}
else
{
attributes.class = Tag("PartEmpty")
}
if( (desk.need.length==0 && !latest) || scan.make_dirty.includes(index)) if( (desk.need.length==0 && !latest) || scan.make_dirty.includes(index))
{ {
attributes.class = Tag("PartDirty")
if(!latest && caution)
{
attributes.class = Tag("PartCaution")
}
else
{
attributes.class = Tag("PartDirty");
}
} }
return DOM.td( return DOM.td(
@ -208,7 +227,7 @@ function Desks(inDesks)
DOM.tr( DOM.tr(
DOM.th(), DOM.th(),
desk.need.map((part, index)=>DOM.th(part.name)), desk.need.map((part, index)=>DOM.th(part.name)),
DOM.th(), DOM.th("→"),
desk.make.map((part, index)=>DOM.th(part.name)) desk.make.map((part, index)=>DOM.th(part.name))
) )
), ),