feat: caldav client
Some checks failed
TrafficCue CI / check (push) Failing after 2m22s
TrafficCue CI / build (push) Successful in 9m52s
TrafficCue CI / build-android (push) Successful in 26m47s

This commit is contained in:
2025-10-11 15:06:19 +02:00
parent 639b2c1aeb
commit a0ea5a83a5
6 changed files with 674 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
<script>
import {
CalendarSearchIcon,
CloudUploadIcon,
HandIcon,
MapIcon,
@@ -24,6 +25,7 @@
syncStores,
updateStore,
} from "$lib/services/stores.svelte";
import { invoke } from "@tauri-apps/api/core";
const dev = getDeveloperToggle();
@@ -54,6 +56,45 @@
await downloadPMTiles(url, name);
}}
/>
<SettingsButton
icon={CalendarSearchIcon}
text="Fetch calendars"
onclick={async () => {
const url = prompt("URL?");
if (!url) return;
const scheme = await invoke("dav_find_scheme", { url })
.catch((err) => {
alert("Error fetching scheme: " + err);
});
alert("Found scheme: " + scheme);
const username = prompt("Username?");
const password = prompt("Password?");
if (!username || !password) return;
const credentials = { scheme, username, password };
invoke("dav_fetch_calendars", { url, credentials }).then((calendars) => {
alert("Fetched calendars: " + JSON.stringify(calendars));
}).catch((err) => {
alert("Error fetching calendars: " + err);
});
}}
/>
<SettingsButton
icon={CalendarSearchIcon}
text="Fetch CalDAV events"
onclick={async () => {
const url = prompt("URL?");
const scheme = prompt("Scheme? (basic, digest)");
const username = prompt("Username?");
const password = prompt("Password?");
if (!url || !username || !password) return;
const credentials = { scheme, username, password };
invoke("dav_fetch_events", { calendar: { name: "Calendar", url }, credentials }).then((events) => {
alert("Fetched events: " + JSON.stringify(events));
}).catch((err) => {
alert("Error fetching events: " + err);
});
}}
/>
</section>
<section>