Compare commits
No commits in common. "8b820aef770e520acdc8216193c06867f5f47281" and "1c096df3956192a2bb35ee72fe3cd96ba6498d75" have entirely different histories.
8b820aef77
...
1c096df395
@ -22,11 +22,8 @@ app.get('/ipad.png', async (req, res) => {
|
|||||||
frontend_url.searchParams.set('tool', req.query.tool);
|
frontend_url.searchParams.set('tool', req.query.tool);
|
||||||
}
|
}
|
||||||
await puppet_page.goto(frontend_url.toString());
|
await puppet_page.goto(frontend_url.toString());
|
||||||
// TODO: handle timeout better (ie present a better error to the frontend)
|
// TODO: handle timeout
|
||||||
await puppet_page.waitForSelector('#loadingSpinner', {
|
await puppet_page.waitForNetworkIdle({ timeout: 5000 });
|
||||||
hidden: true,
|
|
||||||
timeout: 10,
|
|
||||||
});
|
|
||||||
const screenshot = await puppet_page.screenshot();
|
const screenshot = await puppet_page.screenshot();
|
||||||
await puppet_page.close();
|
await puppet_page.close();
|
||||||
res.send(screenshot);
|
res.send(screenshot);
|
||||||
|
@ -31,19 +31,17 @@ calendarImg.addEventListener('load', () => {
|
|||||||
|
|
||||||
calendarImg.addEventListener('error', (event) => {
|
calendarImg.addEventListener('error', (event) => {
|
||||||
spinner.style.display = 'none';
|
spinner.style.display = 'none';
|
||||||
|
console.error('Error fetching calendar image: ', event);
|
||||||
errorModal.style.display = '';
|
errorModal.style.display = '';
|
||||||
const message = errorModal.querySelector('.modal-message')!;
|
const message = errorModal.querySelector('.modal-message')!;
|
||||||
message.textContent = `Failed to fetch events. Displayed events may not be accurate.`;
|
message.textContent = `Failed to fetch events: ${event.message}. Displayed events may not be accurate.`;
|
||||||
});
|
});
|
||||||
|
|
||||||
function refresh() {
|
function refresh() {
|
||||||
spinner.style.display = '';
|
spinner.style.display = '';
|
||||||
|
|
||||||
const url = new URL('/ipad.png', window.location.href);
|
const url = new URL('/ipad.png', window.location.href);
|
||||||
url.searchParams.set(
|
url.searchParams.set('viewport', `${window.innerWidth}x${window.innerHeight}x${window.devicePixelRatio}`);
|
||||||
'viewport',
|
|
||||||
`${window.innerWidth}x${window.innerHeight}x${window.devicePixelRatio}`
|
|
||||||
);
|
|
||||||
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
if (urlParams.has('tool')) {
|
if (urlParams.has('tool')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user