feat: healthcheck backend and fix data types
also small various features
This commit is contained in:
@@ -31,8 +31,8 @@
|
||||
</NuxtLink>
|
||||
</nav>
|
||||
|
||||
<!-- Status indicator -->
|
||||
<div class="px-4 py-4 border-t border-gray-800">
|
||||
<!-- Status indicators -->
|
||||
<div class="px-4 py-4 border-t border-gray-800 space-y-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<span
|
||||
class="w-2 h-2 rounded-full shrink-0"
|
||||
@@ -42,6 +42,15 @@
|
||||
{{ captureRunning ? 'Захват активен' : 'Захват остановлен' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<span
|
||||
class="w-2 h-2 rounded-full shrink-0"
|
||||
:class="isOnline ? 'bg-green-400' : 'bg-red-500 animate-pulse'"
|
||||
/>
|
||||
<span class="text-xs" :class="isOnline ? 'text-gray-400' : 'text-red-400'">
|
||||
{{ isOnline ? 'Бэкенд онлайн' : 'Бэкенд недоступен' }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -71,6 +80,15 @@
|
||||
</UButton>
|
||||
</header>
|
||||
|
||||
<!-- Offline banner -->
|
||||
<div
|
||||
v-if="!isOnline"
|
||||
class="mx-6 mt-4 flex items-center gap-2 text-xs text-yellow-300 bg-yellow-950/50 border border-yellow-800/60 rounded-lg px-3 py-2 shrink-0"
|
||||
>
|
||||
<UIcon name="i-heroicons-signal-slash" class="w-4 h-4 shrink-0" />
|
||||
Бэкенд недоступен — отображаются данные из БД
|
||||
</div>
|
||||
|
||||
<!-- Page content -->
|
||||
<main class="flex-1 overflow-auto p-6">
|
||||
<slot />
|
||||
@@ -82,6 +100,7 @@
|
||||
<script setup lang="ts">
|
||||
const route = useRoute()
|
||||
const { status, stopCapture } = useCaptureStatus()
|
||||
const { isOnline } = useBackendStatus()
|
||||
|
||||
const captureRunning = computed(() => status.value?.running ?? false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user