advent22/ui/src/components/ConfigView.vue

190 lines
4.8 KiB
Vue
Raw Normal View History

2023-09-10 03:10:22 +00:00
<template>
2023-09-10 03:38:24 +00:00
<BulmaDrawer header="Konfiguration">
2023-09-10 03:25:12 +00:00
<div class="card-content">
2023-09-10 03:38:24 +00:00
<div class="columns">
<div class="column is-one-third">
<div class="content">
<h4>Rätsel</h4>
<dl>
<dt>Titel</dt>
<dd>Adventskalender 2023</dd>
<dt>Lösung</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.puzzle.solution }}</dd>
2023-09-10 03:10:22 +00:00
<dt>Reihenfolge</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.puzzle.shuffled }}</dd>
2023-09-10 03:10:22 +00:00
<dt>Offene Türchen</dt>
<dd>10</dd>
2023-09-10 03:10:22 +00:00
<dt>Nächstes Türchen in</dt>
<dd>dd-hh-mm-ss</dd>
2023-09-10 03:10:22 +00:00
<dt>Erstes Türchen</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.puzzle.begin }}</dd>
2023-09-10 03:10:22 +00:00
<dt>Letztes Türchen</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.puzzle.end }}</dd>
2023-09-10 03:10:22 +00:00
<dt>Rätsel schließt</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.puzzle.closing }}</dd>
2023-09-10 03:10:22 +00:00
<dt>Zufalls-Seed</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.puzzle.seed }}</dd>
</dl>
</div>
2023-09-10 03:10:22 +00:00
</div>
<div class="column is-one-third">
<div class="content">
<h4>Kalender</h4>
<dl>
<dt>Definition</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.calendar.config_file }}</dd>
<dt>Hintergrundbild</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.calendar.background }}</dd>
<dt>Türchen</dt>
2023-09-11 02:36:51 +00:00
<dd>
2023-09-11 22:24:01 +00:00
{{ admin_config_model.calendar.doors }}
2023-09-11 02:36:51 +00:00
<span class="tag is-danger ml-2">
<span class="icon">
<font-awesome-icon icon="fa-solid fa-bolt" />
</span>
</span>
</dd>
</dl>
<h4>Bilder</h4>
<dl>
<dt>Größe</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.image.size }} px</dd>
<dt>Rand</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.image.border }} px</dd>
<dt>Schriftarten</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.image.fonts }}</dd>
<dd>files/foobar.ttf (Größe 33)</dd>
</dl>
</div>
2023-09-10 03:10:22 +00:00
</div>
<div class="column is-one-third">
<div class="content">
<h4>WebDAV</h4>
<dl>
<dt>URL</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.webdav.url }}</dd>
<dt>Zugangsdaten</dt>
2023-09-11 02:36:51 +00:00
<dd>
<span>***</span>
<span class="tag button is-primary ml-2">
<span class="icon">
<font-awesome-icon icon="fa-solid fa-eye" />
</span>
</span>
</dd>
<dt>Cache-Dauer</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.webdav.cache_ttl }} s</dd>
<dt>Konfigurationsdatei</dt>
2023-09-11 22:24:01 +00:00
<dd>{{ admin_config_model.webdav.config_file }}</dd>
<dt>UI-Admin</dt>
2023-09-11 02:36:51 +00:00
<dd>
<span>***</span>
<span class="tag button is-primary ml-2">
<span class="icon">
<font-awesome-icon icon="fa-solid fa-eye" />
</span>
</span>
</dd>
</dl>
</div>
2023-09-10 03:10:22 +00:00
</div>
</div>
</div>
2023-09-10 03:38:24 +00:00
</BulmaDrawer>
2023-09-10 03:10:22 +00:00
</template>
<script lang="ts">
import { Options, Vue } from "vue-class-component";
import BulmaDrawer from "./bulma/Drawer.vue";
2023-09-11 22:24:01 +00:00
interface ConfigModel {
puzzle: {
solution: string;
shuffled: string;
begin: string;
end: string;
closing: string;
seed: string;
};
calendar: {
config_file: string;
background: string;
doors: number[];
};
image: {
size: number;
border: number;
fonts: (string | number)[];
};
webdav: {
url: string;
cache_ttl: number;
config_file: string;
};
}
2023-09-10 03:10:22 +00:00
@Options({
components: {
BulmaDrawer,
},
})
2023-09-11 22:24:01 +00:00
export default class extends Vue {
public admin_config_model: ConfigModel = {
puzzle: {
solution: "ABCDEFGHIJKLMNOPQRSTUVWX",
shuffled: "AGFCINBEWLKQMXDURPOSJVHT",
begin: "01.12.2023",
end: "24.12.2023",
closing: "01.04.2024",
seed: "",
},
calendar: {
config_file: "default.toml",
background: "adventskalender.jpg",
doors: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
},
image: {
size: 500,
border: 30,
fonts: ["files/Lena.ttf", 50],
},
webdav: {
url: "https://example.com/remote.php/webdav/advent22",
cache_ttl: 30,
config_file: "config.toml",
},
};
public mounted(): void {
this.$advent22
.api_get<ConfigModel>("admin/config_model")
.then((data) => (this.admin_config_model = data))
.catch(console.log);
}
}
2023-09-10 03:10:22 +00:00
</script>
2023-09-10 20:08:13 +00:00
<style scoped>
dd {
overflow-x: auto;
}
</style>