feat(RelaysView): add main view for all relays
This commit is contained in:
@@ -3,9 +3,9 @@ application:
|
|||||||
version: "0.1.0"
|
version: "0.1.0"
|
||||||
|
|
||||||
rate_limit:
|
rate_limit:
|
||||||
enabled: true
|
enabled: false
|
||||||
burst_size: 10
|
burst_size: 100
|
||||||
per_seconds: 60
|
per_seconds: 10
|
||||||
|
|
||||||
modbus:
|
modbus:
|
||||||
host: 192.168.1.200
|
host: 192.168.1.200
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-screen flex flex-col">
|
<div class="min-h-screen flex flex-col">
|
||||||
<StaHeader />
|
<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 />
|
<StaFooter />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -9,4 +11,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import StaHeader from './components/StaHeader.vue';
|
import StaHeader from './components/StaHeader.vue';
|
||||||
import StaFooter from './components/StaFooter.vue';
|
import StaFooter from './components/StaFooter.vue';
|
||||||
|
import RelaysView from './pages/RelaysView.vue';
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
class="sticky top-0 z-10 bg-background-900 border-b border-background-900 shadow-sm px-6 py-4"
|
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">
|
<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>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
24
src/pages/RelaysView.vue
Normal file
24
src/pages/RelaysView.vue
Normal 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>
|
||||||
Reference in New Issue
Block a user