Commit e04c9ef0 authored by Luna Riegel's avatar Luna Riegel
Browse files

Add ConverterStatus component

parent 1090f529
<template>
<v-row no-gutters class="justify-center">
<VcsLabel> Konverterservice Status: </VcsLabel>
<VcsLabel class="status" v-text="status"/>
<VcsFormButton id="refreshBtn" icon="mdi-refresh" @click="checkHealth()" />
</v-row>
</template>
<script setup>
import { ref, computed, onMounted } from 'vue';
import {VcsFormButton, VcsLabel} from "@vcmap/ui";
import {VRow} from "vuetify/components";
const isHealthy = ref(null);
const status = computed(() => {
if (isHealthy.value === null) return 'Unbekannt';
return isHealthy.value ? 'Online' : 'Offline';
});
async function checkHealth() {
try {
const res = await fetch('/health');
isHealthy.value = res.ok;
} catch {
isHealthy.value = false;
}
}
onMounted(checkHealth);
</script>
......@@ -18,6 +18,9 @@
<v-row no-gutters class="justify-center">
<VcsFormButton id="convertBtn" @click="convert()" :disabled="disable"> Konvertieren </VcsFormButton>
</v-row>
<v-row no-gutters class="justify-center">
<converterStatus />
</v-row>
</v-container>
</v-card>
</v-sheet>
......@@ -39,6 +42,7 @@ import {
} from '@vcmap/ui';
import { VContainer, VRow, VForm, VCol } from 'vuetify/components';
import { name } from '../package.json';
import ConverterStatus from "./converterStatus.vue";
export const bimOptionsId = 'upload_ifc_id';
......@@ -59,6 +63,7 @@ export default {
VCol,
VContainer,
VcsSlider,
ConverterStatus,
},
setup(props, { emit }) {
const app = inject('vcsApp');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment