ENH: Show Printer Thumbnail From Profile Folder

Change-Id: I1ebea7016bcf8725d80d450ea82ff85941cb0dc8
(cherry picked from commit 9cd50c690a70f103a9140fdb85cca7d2858874b0)
This commit is contained in:
zorro.zhang 2023-06-14 11:29:09 +08:00 committed by Lane.Wei
parent 5cd1c1b685
commit 26ec9ae385
4 changed files with 27 additions and 8 deletions

View file

@ -40,6 +40,11 @@ function HandleStudio( pVal )
}
}
function ShowPrinterThumb(pItem, strImg)
{
$(pItem).attr('src',strImg);
$(pItem).attr('onerror',null);
}
function HandleModelList( pVal )
{
@ -75,7 +80,10 @@ function HandleModelList( pVal )
'</div>'+
'</div>';
$('#Content').append(HtmlNewVendor);
if(sVV=='Bambu Lab')
$('#Content').html( HtmlNewVendor + $('#Content').html() );
else
$('#Content').append( HtmlNewVendor );
}
let ModelName=OneModel['model'];
@ -93,8 +101,9 @@ function HandleModelList( pVal )
}
let CoverImage="../../image/printer/"+OneModel['model']+"_cover.png";
let CoverImage2="../../../profiles/"+strVendor+"/"+OneModel['model']+"_cover.png";
ModelHtml[strVendor]+='<div class="PrinterBlock">'+
' <div class="PImg"><img src="'+CoverImage+'" /></div>'+
' <div class="PImg"><img src="'+CoverImage+'" onerror="ShowPrinterThumb(this,\''+CoverImage2+'\')" /></div>'+
' <div class="PName">'+OneModel['model']+'</div>'+ HtmlNozzel +'</div>';
}