Skip to content

Commit

Permalink
Add wait for report with chart
Browse files Browse the repository at this point in the history
  • Loading branch information
korridor committed Nov 28, 2024
1 parent ccad1ad commit 9f672cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/Api/V1/TimeEntryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ public function aggregateExport(Organization $organization, TimeEntryAggregateEx
$footerHtml = Blade::render($footerViewFile);
$request = Gotenberg::chromium(config('services.gotenberg.url'))
->pdf()
->waitForExpression("window.status === 'ready'")
->pdfa('PDF/A-3b')
->paperSize('8.27', '11.7') // A4
->footer(Stream::string('footer', $footerHtml))
Expand Down
7 changes: 7 additions & 0 deletions resources/views/reports/time-entry-aggregate/pdf.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
font-weight: bold;
}
</style>
<script>
window.status = 'processing';
</script>
<script src="echarts.min.js"></script>
</head>
<body>
Expand Down Expand Up @@ -190,6 +193,10 @@
]
};
myChart.on('finished', () => {
window.status = 'ready';
})
// Display the chart using the configuration items and data just specified.
myChart.setOption(option);
</script>
Expand Down

0 comments on commit 9f672cb

Please sign in to comment.