mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
show door number in ConfigView
This commit is contained in:
parent
1d760f91db
commit
3a3dfcd94d
1 changed files with 12 additions and 10 deletions
|
@ -52,13 +52,12 @@
|
|||
<dt>Hintergrundbild</dt>
|
||||
<dd>{{ config_model.calendar.background }}</dd>
|
||||
|
||||
<dt>Türchen</dt>
|
||||
<dt>Türchen ({{ doors.length }} Stück)</dt>
|
||||
<dd>
|
||||
<template v-for="(part, day) in day_parts" :key="`door-${day}`">
|
||||
<template v-for="(door, index) in doors" :key="`door-${index}`">
|
||||
<span>
|
||||
<template v-if="Number(day) > 1">, </template>
|
||||
<span v-if="part == ''" class="tag is-warning">_</span>
|
||||
<template v-else>{{ part }}</template>
|
||||
<template v-if="door.day > 1">, </template>
|
||||
{{ door.day }}
|
||||
</span>
|
||||
</template>
|
||||
</dd>
|
||||
|
@ -125,7 +124,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ConfigModel, Credentials, DoorsSaved, NumStrDict } from "@/lib/api";
|
||||
import { ConfigModel, Credentials, DoorsSaved } from "@/lib/api";
|
||||
import { DateTime } from "luxon";
|
||||
import { Options, Vue } from "vue-class-component";
|
||||
|
||||
|
@ -165,7 +164,8 @@ export default class extends Vue {
|
|||
config_file: "sed diam nonumy",
|
||||
},
|
||||
};
|
||||
public day_parts: NumStrDict = {};
|
||||
public doors: DoorsSaved = [];
|
||||
public footer = "";
|
||||
public num_user_doors = 0;
|
||||
public next_door: number | null = null;
|
||||
public dav_credentials: Credentials = ["", ""];
|
||||
|
@ -181,14 +181,16 @@ export default class extends Vue {
|
|||
public on_open(ready: () => void, fail: () => void): void {
|
||||
Promise.all([
|
||||
this.$advent22.api_get<ConfigModel>("admin/config_model"),
|
||||
this.$advent22.api_get<NumStrDict>("admin/day_parts"),
|
||||
this.$advent22.api_get<DoorsSaved>("admin/doors"),
|
||||
this.$advent22.api_get<DoorsSaved>("user/doors"),
|
||||
this.$advent22.api_get<string>("user/footer"),
|
||||
this.$advent22.api_get<number | null>("user/next_door"),
|
||||
])
|
||||
.then(([config_model, day_parts, user_doors, next_door]) => {
|
||||
.then(([config_model, doors, user_doors, footer, next_door]) => {
|
||||
this.config_model = config_model;
|
||||
this.day_parts = day_parts;
|
||||
this.doors = doors;
|
||||
this.num_user_doors = user_doors.length;
|
||||
this.footer = footer;
|
||||
this.next_door = next_door;
|
||||
|
||||
ready();
|
||||
|
|
Loading…
Reference in a new issue