@@ -348,18 +348,21 @@ class BasicLabelDesignerApp {
348348 <span class="visually-hidden">Settings</span>
349349 </button>
350350 <ul class="dropdown-menu">
351- <li><a id="printtest_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
352- Print test page
353- </a></li>
354- <li><a id="feedlabel_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
355- Feed blank label
356- </a></li>
357- <li><a id="configprinter_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
358- Set label config
359- </a></li>
360- <li><a id="printconfig_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
361- Print config on labels
362- </a></li>
351+ <li><a id="printerStatus_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
352+ Query printer status
353+ </a></li>
354+ <li><a id="printtest_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
355+ Print test page
356+ </a></li>
357+ <li><a id="feedlabel_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
358+ Feed blank label
359+ </a></li>
360+ <li><a id="configprinter_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
361+ Set label config
362+ </a></li>
363+ <li><a id="printconfig_${ idx } " data-printer-idx="${ idx } " class="dropdown-item" href="#">
364+ Print config on labels
365+ </a></li>
363366 </ul>
364367 </div>
365368 </div>
@@ -389,6 +392,14 @@ class BasicLabelDesignerApp {
389392 this . redrawPrinterButtonHighlights ( ) ;
390393 this . redrawLabelCanvas ( ) ;
391394 } ) ;
395+ document . getElementById ( `printerStatus_${ idx } ` ) !
396+ . addEventListener ( 'click' , async ( e ) => {
397+ e . preventDefault ( ) ;
398+ const printerIdx = ( e . currentTarget as HTMLAnchorElement ) . dataset . printerIdx as unknown as number ;
399+ const printer = this . printers [ printerIdx ] ;
400+ const doc = printer . getConfigDocument ( ) . queryStatus ( ) . finalize ( ) ;
401+ await printer . sendDocument ( doc ) ;
402+ } ) ;
392403 document . getElementById ( `printtest_${ idx } ` ) !
393404 . addEventListener ( 'click' , async ( e ) => {
394405 e . preventDefault ( ) ;
@@ -575,12 +586,19 @@ class BasicLabelDesignerApp {
575586 // And send the whole shebang to the printer!
576587 await printer . sendDocument ( doc ) ;
577588
589+ // Then get the updated printer info..
590+ await printer . sendDocument ( WebLabel . ReadyToPrintDocuments . configDocument ) ;
591+
592+ // Hide the config modal
578593 form . modalWithAutosense . checked = false ;
579594 form . modalZplWithSensorGraph . checked = false ;
580595 form . modalSubmit . removeAttribute ( "disabled" ) ;
581596 form . modalCancel . removeAttribute ( "disabled" ) ;
582597 this . activePrinterIndex = printerIdx ;
583598 this . configModalHandle . hide ( ) ;
599+
600+ // Redraw the buttons with the updated config
601+ this . redrawPrinterButtons ( ) ;
584602 }
585603}
586604
0 commit comments