mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
AdminButton component
This commit is contained in:
parent
ce344e5043
commit
943c9b6c32
2 changed files with 33 additions and 13 deletions
|
@ -1,20 +1,15 @@
|
|||
<template>
|
||||
<div class="container">
|
||||
<LoginModal ref="login_modal" />
|
||||
|
||||
<div class="section">
|
||||
<h1 class="title has-text-centered is-uppercase">
|
||||
Adventskalender {{ date }}
|
||||
</h1>
|
||||
<h2 class="subtitle has-text-centered">Der Gelöt</h2>
|
||||
|
||||
<DoorMapEditor />
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<button class="button" @click.left="$refs.login_modal.set_active(true)">
|
||||
Login
|
||||
</button>
|
||||
<DoorMapEditor />
|
||||
<AdminButton />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -22,23 +17,19 @@
|
|||
<script lang="ts">
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
|
||||
import AdminButton from "./components/AdminButton.vue";
|
||||
import DoorMapEditor from "./components/DoorMapEditor.vue";
|
||||
import LoginModal from "./components/LoginModal.vue";
|
||||
|
||||
@Options({
|
||||
components: {
|
||||
DoorMapEditor,
|
||||
LoginModal,
|
||||
AdminButton,
|
||||
},
|
||||
})
|
||||
export default class extends Vue {
|
||||
private visible_days = 0;
|
||||
date = "";
|
||||
|
||||
declare $refs: {
|
||||
login_modal: LoginModal;
|
||||
};
|
||||
|
||||
public mounted() {
|
||||
this.$advent22
|
||||
.api_get<string>("days/date")
|
||||
|
|
29
ui/src/components/AdminButton.vue
Normal file
29
ui/src/components/AdminButton.vue
Normal file
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<LoginModal ref="login_modal" />
|
||||
|
||||
<BulmaButton
|
||||
class="button is-light"
|
||||
@click.left="$refs.login_modal.set_active(true)"
|
||||
icon="fa-solid fa-toggle-off"
|
||||
text="Admin"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
|
||||
import BulmaButton from "./bulma/Button.vue";
|
||||
import LoginModal from "./LoginModal.vue";
|
||||
|
||||
@Options({
|
||||
components: {
|
||||
BulmaButton,
|
||||
LoginModal,
|
||||
},
|
||||
})
|
||||
export default class extends Vue {
|
||||
declare $refs: {
|
||||
login_modal: LoginModal;
|
||||
};
|
||||
}
|
||||
</script>
|
Loading…
Reference in a new issue