@ -251,12 +251,12 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
}
onMarkdownReady ( container : HTMLElement ) : void {
// Download button handlers
const buttons = container . querySelectorAll ( '[data-action="download-gateway-docker-compose"]' ) ;
buttons . forEach ( btn = > {
btn . addEventListener ( 'click' , ( e ) = > {
e . preventDefault ( ) ;
if ( this . gatewayDockerComposeContent ) {
// Custom template from ZIP — download as Blob
const blob = new Blob ( [ this . gatewayDockerComposeContent ] , { type : 'application/x-yaml' } ) ;
const url = URL . createObjectURL ( blob ) ;
const link = document . createElement ( 'a' ) ;
@ -265,7 +265,6 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
link . click ( ) ;
URL . revokeObjectURL ( url ) ;
} else {
// Standard template — authenticated API call
const gateway = this . entityOutputs . get ( 'gateway' ) ;
if ( gateway ? . id ) {
this . deviceService . downloadGatewayDockerComposeFile ( gateway . id ) . subscribe ( ) ;
@ -273,6 +272,13 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
}
} ) ;
} ) ;
// Gallery image click-to-expand
const galleryImages = container . querySelectorAll ( '.tb-gallery-img' ) ;
galleryImages . forEach ( img = > {
img . addEventListener ( 'click' , ( ) = > {
img . classList . toggle ( 'tb-gallery-img-expanded' ) ;
} ) ;
} ) ;
}
resolveImagePath ( path : string ) : string {
@ -300,6 +306,17 @@ export class TbDeviceInstallDialogComponent extends DialogComponent<TbDeviceInst
if ( key === 'gateway.downloadButton' ) {
return '<a href="#" data-action="download-gateway-docker-compose" class="tb-download-btn">⬇ Download docker-compose.yml</a>' ;
}
// Image gallery: ${images.gallery(path1,path2,path3)}
const galleryMatch = key . match ( /^images\.gallery\((.+)\)$/ ) ;
if ( galleryMatch ) {
const paths = galleryMatch [ 1 ] . split ( ',' ) . map ( p = > p . trim ( ) ) ;
const images = paths
. map ( p = > this . zipImages . get ( p ) )
. filter ( src = > ! ! src )
. map ( src = > ` <img src=" ${ src } " class="tb-gallery-img" /> ` )
. join ( '' ) ;
return ` <div class="tb-gallery"> ${ images } </div> ` ;
}
const dotIdx = key . indexOf ( '.' ) ;
if ( dotIdx > 0 ) {
const alias = key . substring ( 0 , dotIdx ) ;