mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-03 18:29:16 +02:00
added frontend and updated backend with docker, wrote some initial instructions
This commit is contained in:
49
frontend/src/components/CalendarLink.vue
Normal file
49
frontend/src/components/CalendarLink.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script lang="ts" setup>
|
||||
import tokenStore from "../store/tokenStore.ts";
|
||||
import { useToast } from "primevue/usetoast";
|
||||
import { onMounted } from "vue";
|
||||
import router from "../router";
|
||||
const toast = useToast();
|
||||
|
||||
const show = () => {
|
||||
toast.add({
|
||||
severity: "info",
|
||||
summary: "Info",
|
||||
detail: "Link copied to clipboard",
|
||||
life: 3000,
|
||||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
rerouteIfTokenIsEmpty();
|
||||
});
|
||||
|
||||
function rerouteIfTokenIsEmpty() {
|
||||
if (tokenStore().token == "") {
|
||||
router.push("/");
|
||||
}
|
||||
}
|
||||
|
||||
function copyToClipboard() {
|
||||
const text = "http://localhost:8090/api/feed?token=" + tokenStore().token;
|
||||
// Copy the text inside the text field
|
||||
navigator.clipboard.writeText(text);
|
||||
show();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Toast />
|
||||
<div class="flex flex-column">
|
||||
<div class="flex align-items-center justify-content-center h-4rem m-2">
|
||||
<h2>
|
||||
{{ "http://localhost:8090/api/feed?token=" + tokenStore().token }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="flex align-items-center justify-content-center h-4rem m-2">
|
||||
<Button @click="copyToClipboard">Copy iCal Link</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
Reference in New Issue
Block a user