From a7666c741d58b935719c9d4bbf145a0ffc4ed1d7 Mon Sep 17 00:00:00 2001 From: penner Date: Wed, 14 Dec 2022 02:39:32 +0000 Subject: [PATCH] Anmeldungsfeld --- ui/src/App.vue | 10 ++++++ ui/src/components/LoginModal.vue | 59 ++++++++++++++++++++++++++++++++ ui/src/plugins/advent22.ts | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 ui/src/components/LoginModal.vue diff --git a/ui/src/App.vue b/ui/src/App.vue index 3031681..13c3883 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -6,6 +6,7 @@

Der Gelöt

+ import { Options, Vue } from "vue-class-component"; + import CalendarDoor from "./components/CalendarDoor.vue"; import ImageModal from "./components/ImageModal.vue"; +import LoginModal from "./components/LoginModal.vue"; @Options({ components: { CalendarDoor, ImageModal, + LoginModal, }, }) export default class App extends Vue { @@ -33,10 +37,16 @@ export default class App extends Vue { modal_visible = false; date = ""; + declare $refs: { + login_modal: LoginModal; + }; + public mounted(): void { this.$advent22.api_get_string("days/date", (date: string) => { this.date = date; }); + + this.$refs.login_modal.set_active(true); } private paula(url: string): void { diff --git a/ui/src/components/LoginModal.vue b/ui/src/components/LoginModal.vue new file mode 100644 index 0000000..ab6a5be --- /dev/null +++ b/ui/src/components/LoginModal.vue @@ -0,0 +1,59 @@ + + + diff --git a/ui/src/plugins/advent22.ts b/ui/src/plugins/advent22.ts index 8bc7b2f..fb99514 100644 --- a/ui/src/plugins/advent22.ts +++ b/ui/src/plugins/advent22.ts @@ -30,7 +30,7 @@ export class Advent22 { return `${this.api_baseurl}/${endpoint}`; } - public api_auth_set(username: string, password: string) { + public set_api_auth(username: string, password: string) { this.api_auth = { username: username, password: password }; }