feat: add label preview functionality to barcode templates with backend rendering and UI modal
Build and Push Multi-Platform Images / build-and-push (push) Successful in 33s

This commit is contained in:
2026-05-07 23:52:39 +02:00
parent 71502df7b4
commit 71b447154d
4 changed files with 107 additions and 4 deletions
@@ -24,6 +24,19 @@ import { LabelPrintAgentService } from './label-print-agent.service';
export class LabelPrintAgentController {
constructor(private readonly service: LabelPrintAgentService) {}
@Post('preview')
@HttpCode(HttpStatus.OK)
@RequirePermissions(Permission.VIEW_SCANNER)
async preview(
@Body() body: { templateId: number; fieldValues?: Record<string, string> },
@Res({ passthrough: true }) res: Response,
): Promise<StreamableFile> {
const buf = await this.service.renderPreview(body.templateId, body.fieldValues ?? {});
const { Readable } = await import('stream');
res.setHeader('Content-Type', 'image/png');
return new StreamableFile(Readable.from(buf));
}
// Manuell einen Job anlegen (Frontend → Backend)
@Post('jobs')
@HttpCode(HttpStatus.CREATED)