Add wait for report with chart

This commit is contained in:
Constantin Graf
2024-11-28 17:22:42 +01:00
committed by Constantin Graf
parent a4d8a02b80
commit 05da595470
2 changed files with 8 additions and 0 deletions

View File

@@ -409,6 +409,7 @@ class TimeEntryController extends Controller
$footerHtml = Blade::render($footerViewFile); $footerHtml = Blade::render($footerViewFile);
$request = Gotenberg::chromium(config('services.gotenberg.url')) $request = Gotenberg::chromium(config('services.gotenberg.url'))
->pdf() ->pdf()
->waitForExpression("window.status === 'ready'")
->pdfa('PDF/A-3b') ->pdfa('PDF/A-3b')
->paperSize('8.27', '11.7') // A4 ->paperSize('8.27', '11.7') // A4
->footer(Stream::string('footer', $footerHtml)) ->footer(Stream::string('footer', $footerHtml))

View File

@@ -37,6 +37,9 @@
font-weight: bold; font-weight: bold;
} }
</style> </style>
<script>
window.status = 'processing';
</script>
<script src="echarts.min.js"></script> <script src="echarts.min.js"></script>
</head> </head>
<body> <body>
@@ -190,6 +193,10 @@
] ]
}; };
myChart.on('finished', () => {
window.status = 'ready';
})
// Display the chart using the configuration items and data just specified. // Display the chart using the configuration items and data just specified.
myChart.setOption(option); myChart.setOption(option);
</script> </script>