mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 12:41:04 +00:00
Origin marshalling (import + export) now prints leg slots as TO BE LOADED AT <board yard> with board/alight stations and keeps their containers out of the loaded tallies. Intercity Marshalling 2 no longer hides whole-route cargo whose allocation never left PLANNED (import flow confirms loading at schedule level), so the on-board view matches the physical consist before and after mid-corridor coupling.
26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
import { chromium } from '/home/tria/projects/hagernesh/edr-platform/node_modules/.pnpm/playwright-core@1.61.1/node_modules/playwright-core/index.mjs';
|
|
import { readFileSync } from 'node:fs';
|
|
import path from 'node:path';
|
|
|
|
const dir = path.dirname(new URL(import.meta.url).pathname);
|
|
let html = readFileSync(path.join(dir, 'portal-flows.html'), 'utf8');
|
|
|
|
html = html.replace(/\{\{([\w.-]+\.png)\}\}/g, (_, file) => {
|
|
const buf = readFileSync(path.join(dir, file));
|
|
return `data:image/png;base64,${buf.toString('base64')}`;
|
|
});
|
|
|
|
const browser = await chromium.launch({
|
|
executablePath: '/home/tria/.cache/ms-playwright/chromium-1237/chrome-linux64/chrome',
|
|
});
|
|
const page = await browser.newPage();
|
|
await page.setContent(html, { waitUntil: 'load' });
|
|
await page.pdf({
|
|
path: '/home/tria/projects/hagernesh/edr-platform/EDR-Freight-Priority-Flows-Portal.pdf',
|
|
format: 'A4',
|
|
printBackground: true,
|
|
margin: { top: '14mm', bottom: '16mm', left: '14mm', right: '14mm' },
|
|
});
|
|
await browser.close();
|
|
console.log('done');
|