ovdashboard/ui/src/App.vue

104 lines
2.4 KiB
Vue
Raw Normal View History

2022-09-09 16:23:04 +00:00
<template>
2022-09-09 16:38:12 +00:00
<v-app>
2022-09-15 15:04:01 +00:00
<v-layout column fill-height>
2022-09-24 01:37:26 +00:00
<TitleBar />
<Dashboard>
<template slot="message">
2022-09-24 02:19:38 +00:00
<div class="d-flex flex-column fill-height">
2022-09-24 16:31:36 +00:00
<Message />
2022-09-24 16:29:55 +00:00
<ImageCarousel class="mt-auto" />
2022-09-15 19:45:34 +00:00
</div>
</template>
<template slot="calendars">
2022-09-24 16:39:03 +00:00
<CalendarCarousel />
<DashboardInfo
:server_host="server_host"
:server_name="server_name"
:version="dashboard_version"
:lan_ip="dashboard_ip"
/>
</template>
2022-09-13 21:30:20 +00:00
</Dashboard>
2022-09-24 02:30:19 +00:00
<TickerBar />
2022-09-15 15:04:01 +00:00
</v-layout>
2022-09-09 16:38:12 +00:00
</v-app>
2022-09-09 16:23:04 +00:00
</template>
<script lang="ts">
2022-09-24 01:37:26 +00:00
import { Component, Vue } from "@/ovd-vue";
2022-09-15 19:30:48 +00:00
import TitleBar from "./components/title/TitleBar.vue";
2022-09-13 01:54:02 +00:00
import Dashboard from "./components/Dashboard.vue";
import ImageCarousel from "./components/ImageCarousel.vue";
2022-09-15 19:30:48 +00:00
import Message from "./components/Message.vue";
import CalendarCarousel from "./components/calendar/CalendarCarousel.vue";
import DashboardInfo from "./components/DashboardInfo.vue";
2022-09-12 13:01:58 +00:00
import TickerBar from "./components/TickerBar.vue";
2022-09-09 16:23:04 +00:00
2022-09-11 23:28:37 +00:00
@Component({
2022-09-09 16:23:04 +00:00
components: {
2022-09-15 19:30:48 +00:00
TitleBar,
2022-09-13 01:54:02 +00:00
Dashboard,
ImageCarousel,
2022-09-15 19:30:48 +00:00
Message,
CalendarCarousel,
DashboardInfo,
2022-09-12 13:01:58 +00:00
TickerBar,
2022-09-09 16:23:04 +00:00
},
2022-09-11 23:28:37 +00:00
})
export default class App extends Vue {
2022-09-16 14:29:55 +00:00
// API data
2022-09-15 16:25:58 +00:00
private server_host = "https://oekzident.de";
private server_name = "OEKZident";
private dashboard_version = "0.0.1";
private dashboard_ip = "0.0.0.0";
2022-09-15 18:01:10 +00:00
2022-09-24 01:37:26 +00:00
public created(): void {
super.created();
}
2022-09-16 14:02:18 +00:00
2022-09-24 01:37:26 +00:00
public beforeDestroy(): void {
super.beforeDestroy();
}
2022-09-16 14:02:18 +00:00
2022-09-24 01:37:26 +00:00
protected update(): void {
2022-09-16 14:02:18 +00:00
// Update Server Config
2022-09-16 21:45:59 +00:00
type ServerConfig = {
host: string;
name: string;
};
2022-09-16 22:02:23 +00:00
this.$ovdashboard.api_get_object<ServerConfig>(
2022-09-16 21:45:59 +00:00
"misc/config/server",
(data) => {
this.server_host = data.host;
this.server_name = data.name;
}
);
2022-09-16 14:02:18 +00:00
// Update Version
2022-09-16 22:02:23 +00:00
this.$ovdashboard.api_get_string("misc/version", (data) => {
2022-09-16 14:23:10 +00:00
this.dashboard_version = data;
});
2022-09-16 14:02:18 +00:00
// Update IP
2022-09-16 22:02:23 +00:00
this.$ovdashboard.api_get_string("misc/lanip", (data) => {
2022-09-16 14:23:10 +00:00
this.dashboard_ip = data;
});
2022-09-15 22:51:50 +00:00
}
2022-09-11 23:28:37 +00:00
}
2022-09-09 16:38:12 +00:00
</script>
2022-09-15 19:49:41 +00:00
<style>
/* Hide scrollbar for Chrome, Safari and Opera */
body::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
body {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
</style>