2023-09-13 16:20:52 +00:00
|
|
|
<template>
|
|
|
|
<Calendar :doors="doors" />
|
2023-11-02 01:12:41 +00:00
|
|
|
<hr />
|
2023-11-03 17:07:25 +00:00
|
|
|
<div class="content" v-html="store.site_config.content" />
|
|
|
|
<template v-if="store.next_door_target !== null">
|
|
|
|
<hr />
|
|
|
|
<div class="content has-text-primary">
|
|
|
|
Zeit zum nächsten Türchen: <CountDown :until="store.next_door_target" />
|
|
|
|
</div>
|
|
|
|
</template>
|
2023-09-13 16:20:52 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { DoorsSaved } from "@/lib/api";
|
|
|
|
import { Door } from "@/lib/door";
|
2023-11-03 17:07:25 +00:00
|
|
|
import { advent22Store } from "@/plugins/store";
|
2023-09-13 16:20:52 +00:00
|
|
|
import { Options, Vue } from "vue-class-component";
|
|
|
|
|
|
|
|
import Calendar from "./Calendar.vue";
|
2023-11-03 17:07:25 +00:00
|
|
|
import CountDown from "./CountDown.vue";
|
2023-09-13 16:20:52 +00:00
|
|
|
|
|
|
|
@Options({
|
|
|
|
components: {
|
|
|
|
Calendar,
|
2023-11-03 17:07:25 +00:00
|
|
|
CountDown,
|
2023-09-13 16:20:52 +00:00
|
|
|
},
|
|
|
|
})
|
|
|
|
export default class extends Vue {
|
2023-11-03 17:07:25 +00:00
|
|
|
public readonly store = advent22Store();
|
2023-09-13 16:20:52 +00:00
|
|
|
public doors: Door[] = [];
|
|
|
|
|
|
|
|
public mounted(): void {
|
|
|
|
this.$advent22
|
|
|
|
.api_get<DoorsSaved>("user/doors")
|
|
|
|
.then((data) => {
|
|
|
|
this.doors.length = 0;
|
|
|
|
|
|
|
|
for (const value of data) {
|
|
|
|
this.doors.push(Door.load(value));
|
|
|
|
}
|
|
|
|
})
|
2023-11-02 00:41:42 +00:00
|
|
|
.catch(this.$advent22.alert_user_error);
|
2023-09-13 16:20:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|