39 lines
1.5 KiB
Vue
39 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import { computed, onMounted } from "vue";
|
|
|
|
import PageHeader from "@/base/PageHeader.vue";
|
|
import { MetadataList } from "@/components/ui/metadata-list";
|
|
import { ReadError } from "@/components/ui/read-error";
|
|
import { Section } from "@/components/ui/section";
|
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
import { api } from "@/lib/api";
|
|
import { useSystemHealth } from "@/lib/system-health";
|
|
import { useRead } from "@/lib/use-read";
|
|
import HealthTables from "./HealthTables.vue";
|
|
import InstanceCard from "./InstanceCard.vue";
|
|
|
|
const { data: health, error, reload } = useSystemHealth();
|
|
const startup = useRead(() => api.bootstrap());
|
|
onMounted(startup.reload);
|
|
|
|
const bootstrapRows = computed(() =>
|
|
Object.entries(startup.data.value ?? {}).map(([label, value]) => ({ label, value: String(value), mono: true })),
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<PageHeader title="Status" />
|
|
<div>
|
|
<ReadError v-if="error && !health" :message="error" retry-label="Retry" class="mb-4" @retry="reload" />
|
|
<div v-else-if="!health" role="status" aria-label="Loading status" class="space-y-2"><Skeleton class="h-8 w-full" /><Skeleton class="h-8 w-full" /></div>
|
|
<template v-else>
|
|
<ReadError v-if="error" :message="error" retry-label="Retry" class="mb-4" @retry="reload" />
|
|
<InstanceCard :health="health" />
|
|
<HealthTables :checks="health.checks" :connectors="health.connectors" />
|
|
</template>
|
|
<Section v-if="bootstrapRows.length" title="Startup settings">
|
|
<MetadataList :rows="bootstrapRows" />
|
|
</Section>
|
|
</div>
|
|
</template>
|