diff --git a/ui/src/App.vue b/ui/src/App.vue index 13c3883..f055b3b 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -35,6 +35,7 @@ import LoginModal from "./components/LoginModal.vue"; export default class App extends Vue { image_url = ""; modal_visible = false; + private visible_days = 0; date = ""; declare $refs: { @@ -46,6 +47,13 @@ export default class App extends Vue { this.date = date; }); + this.$advent22.api_get_number( + "days/visible_days", + (visible_days: number) => { + this.visible_days = visible_days; + } + ); + this.$refs.login_modal.set_active(true); } diff --git a/ui/src/plugins/advent22.ts b/ui/src/plugins/advent22.ts index fb99514..8cfad6b 100644 --- a/ui/src/plugins/advent22.ts +++ b/ui/src/plugins/advent22.ts @@ -86,6 +86,20 @@ export class Advent22 { } ); } + + public api_get_number( + endpoint: string, + on_success: (data: number) => void, + ): void { + this.api_get( + /**Explodiert Möglicherweise */ + // oder auch nicht + endpoint, + (data: number) => { + on_success(data); + } + ); + } } export const Advent22Plugin: Plugin = {