From 9804fffbf2412a7593f03b9258db732067196e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Fri, 16 Sep 2022 14:59:56 +0000 Subject: [PATCH] get calendars from API --- ui/src/App.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ui/src/App.vue b/ui/src/App.vue index 96eade5..a22a9de 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -169,6 +169,24 @@ export default class App extends Vue { }); // Update Calendar Aggregates + this.api_query_simple_list("aggregate/list", (data) => { + let promises = data.map((name: string) => + this.$axios.get(this.$ovdashboard.api_url("aggregate/get/" + name)) + ); + + Promise.all(promises) + .then((responses) => { + this.calendar_data = []; + + for (let i = 0; i < data.length; i++) { + this.calendar_data.push({ + title: data[i], + events: responses[i].data, + }); + } + }) + .catch(this.fail("Calendar Aggregates")); + }); // Update Calendar Config this.api_query_simple_object("calendar/config", (data) => {