Build and push server image / build-and-push (push) Successful in 50s
Calendar rule/grid lines were light gray, which dithers away to near-invisible on the 6-color e-ink palette -- now black. CalDAV accounts (Nextcloud, Fastmail, iCloud, ...) can now be linked alongside the existing single ICS subscription, since one account can expose several calendars. A frame's Calendar tab now lists calendars per person rather than one opt-in per person: your own row shows every calendar you have available with a full add/remove toggle, while other linked users' rows show only calendars they've included, toggleable off (mute) but not on -- only a calendar's owner can add it to a shared frame. FrameCalendar replaces the old single-boolean UserFrame.calendar_included; existing opt-ins are migrated forward.
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
// Settings page: "Discover calendars" against the CalDAV account already
|
|
// saved on this form (same idiom as frame_photos.js's Load Albums using
|
|
// the frame's already-saved Immich creds) -- so this only works after
|
|
// the CalDAV URL/username/password have been saved once.
|
|
|
|
const discoverBtn = document.getElementById('caldav-discover');
|
|
if (discoverBtn) {
|
|
discoverBtn.addEventListener('click', async () => {
|
|
const list = document.getElementById('caldav-calendar-list');
|
|
discoverBtn.disabled = true;
|
|
try {
|
|
const resp = await fetch('/api/settings/caldav-discover', { method: 'POST' });
|
|
if (!resp.ok) throw new Error(await apiError(resp));
|
|
const calendars = await resp.json();
|
|
list.innerHTML = '';
|
|
if (calendars.length === 0) {
|
|
list.innerHTML = '<li>No calendars found in this account.</li>';
|
|
} else {
|
|
for (const c of calendars) {
|
|
const li = document.createElement('li');
|
|
li.textContent = c.display_name;
|
|
list.appendChild(li);
|
|
}
|
|
}
|
|
showStatus(true, `Found ${calendars.length} calendar${calendars.length === 1 ? '' : 's'}.`);
|
|
} catch (e) {
|
|
showStatus(false, e.message);
|
|
} finally {
|
|
discoverBtn.disabled = false;
|
|
}
|
|
});
|
|
}
|