feat(RelaysView): add main view for all relays

This commit is contained in:
2026-05-14 23:48:10 +02:00
parent 3870eb644f
commit 4c96815106
4 changed files with 32 additions and 5 deletions

View File

@@ -3,9 +3,9 @@ application:
version: "0.1.0"
rate_limit:
enabled: true
burst_size: 10
per_seconds: 60
enabled: false
burst_size: 100
per_seconds: 10
modbus:
host: 192.168.1.200

View File

@@ -1,7 +1,9 @@
<template>
<div class="min-h-screen flex flex-col">
<StaHeader />
<main class="grow px-6 py-10 max-w-4xl mx-auto w-full"></main>
<main class="grow px-6 py-10 max-w-4xl mx-auto w-full">
<RelaysView />
</main>
<StaFooter />
</div>
</template>
@@ -9,4 +11,5 @@
<script setup lang="ts">
import StaHeader from './components/StaHeader.vue';
import StaFooter from './components/StaFooter.vue';
import RelaysView from './pages/RelaysView.vue';
</script>

View File

@@ -3,7 +3,7 @@
class="sticky top-0 z-10 bg-background-900 border-b border-background-900 shadow-sm px-6 py-4"
>
<nav class="flex items-center justify-between max-w-4xl mx-auto">
<span class="font-heading text-lg"> STA </span>
<span class="text-lg"> STA </span>
</nav>
</header>
</template>

24
src/pages/RelaysView.vue Normal file
View File

@@ -0,0 +1,24 @@
<template>
<div v-if="isLoading && !relays">
<ProgressSpinner class="--p-progressspinner-color-primary" />
</div>
<div v-else-if="error" class="bg-accent text-background py-4 px-3 rounded-md">
{{ error }}
</div>
<div v-else class="flex flex-row flex-wrap gap-2">
<div v-for="relay in relays">
{{ relay.id }}
</div>
</div>
<div class="flex flex-row flex-wrap"></div>
</template>
<script setup lang="ts">
import { useRelayPolling } from '../composables/useRelayPolling';
import { ProgressSpinner } from 'primevue';
const { relays, isLoading, error, refresh } = useRelayPolling();
refresh();
</script>
<style lang="less"></style>