From 7f46c1761bf065a9a0063d0f11b26719faa4793b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?=
<40151420+ldericher@users.noreply.github.com>
Date: Sat, 24 Sep 2022 16:39:03 +0000
Subject: [PATCH] CalendarCarousel self update
---
ui/src/App.vue | 35 +-----------
.../components/calendar/CalendarCarousel.vue | 54 +++++++++++++++----
ui/src/ovd-vue.ts | 6 +--
3 files changed, 48 insertions(+), 47 deletions(-)
diff --git a/ui/src/App.vue b/ui/src/App.vue
index 93f1d43..538d7da 100644
--- a/ui/src/App.vue
+++ b/ui/src/App.vue
@@ -10,7 +10,7 @@
-
+
import { Component, Vue } from "@/ovd-vue";
-import { EventData } from "./components/calendar/EventModel";
-import { CalendarData } from "./components/calendar/CalendarModel";
import TitleBar from "./components/title/TitleBar.vue";
import Dashboard from "./components/Dashboard.vue";
@@ -50,8 +48,6 @@ import TickerBar from "./components/TickerBar.vue";
})
export default class App extends Vue {
// API data
- private calendar_data: CalendarData[] = require("@/assets/calendar_testdata.json");
- private calendar_speed = 10000;
private server_host = "https://oekzident.de";
private server_name = "OEKZident";
private dashboard_version = "0.0.1";
@@ -66,35 +62,6 @@ export default class App extends Vue {
}
protected update(): void {
- // Update Calendar Aggregates
- this.$ovdashboard.api_get_list("aggregate/list", (names) => {
- this.$ovdashboard.api_get_object_multi(
- names.map((name) => `aggregate/get/${name}`),
- (calendars) => {
- this.calendar_data = [];
-
- for (let i = 0; i < names.length; i++) {
- this.calendar_data.push({
- title: names[i],
- events: calendars[i],
- });
- }
- }
- );
- });
-
- // Update Calendar Config
- type CalendarConfig = {
- speed: number;
- };
-
- this.$ovdashboard.api_get_object(
- "calendar/config",
- (data) => {
- this.calendar_speed = data.speed;
- }
- );
-
// Update Server Config
type ServerConfig = {
host: string;
diff --git a/ui/src/components/calendar/CalendarCarousel.vue b/ui/src/components/calendar/CalendarCarousel.vue
index ec1c0c0..532c58f 100644
--- a/ui/src/components/calendar/CalendarCarousel.vue
+++ b/ui/src/components/calendar/CalendarCarousel.vue
@@ -15,9 +15,10 @@