|
1 | 1 | <template> |
2 | | - <q-page class="row items-center justify-evenly"> |
3 | | - <system-information title="System Information"></system-information> |
| 2 | + <q-page class="column"> |
| 3 | + <!-- Top Carousel --> |
| 4 | + <div class="row justify-center"> |
| 5 | + <ChartCarousel /> |
| 6 | + </div> |
| 7 | + |
| 8 | + <!-- Navigation Tabs --> |
| 9 | + <q-tabs v-model="tab" dense class="q-tabs__content--align-justify"> |
| 10 | + <q-tab name="charge-points" title="Ladepunkte"> |
| 11 | + <q-icon name="ev_station" size="md" color="primary" /> |
| 12 | + </q-tab> |
| 13 | + <q-tab name="batteries" title="Speicher"> |
| 14 | + <q-icon name="battery_full" size="md" color="primary" /> |
| 15 | + </q-tab> |
| 16 | + <q-tab name="smartHome" title="SmartHome"> |
| 17 | + <q-icon name="home" size="md" color="primary" /> |
| 18 | + </q-tab> |
| 19 | + </q-tabs> |
| 20 | + <!-- Tab Panels --> |
| 21 | + <q-tab-panels v-model="tab" class="col"> |
| 22 | + <q-tab-panel name="charge-points" class="q-pa-none column"> |
| 23 | + <BaseCarousel :items="chargePointIds"> |
| 24 | + <template #item="{ item }"> |
| 25 | + <ChargePoint :charge-point-id="item" /> |
| 26 | + </template> |
| 27 | + </BaseCarousel> |
| 28 | + </q-tab-panel> |
| 29 | + <q-tab-panel name="batteries" class=""> |
| 30 | + <div v-if="showBatteryOverview" class="row justify-center"> |
| 31 | + <BatteryOverview /> |
| 32 | + </div> |
| 33 | + <BaseCarousel :items="batteryIds"> |
| 34 | + <template #item="{ item }"> |
| 35 | + <BatteryInformation :battery-id="item" /> |
| 36 | + </template> |
| 37 | + </BaseCarousel> |
| 38 | + </q-tab-panel> |
| 39 | + <q-tab-panel name="smartHome" class=""> |
| 40 | + <SmartHomeInformation /> |
| 41 | + </q-tab-panel> |
| 42 | + </q-tab-panels> |
4 | 43 | </q-page> |
5 | 44 | </template> |
6 | 45 |
|
7 | | -<style scoped></style> |
8 | | - |
9 | 46 | <script setup lang="ts"> |
10 | | -import SystemInformation from 'src/components/SystemInformation.vue'; |
| 47 | +import { ref, computed } from 'vue'; |
| 48 | +import { useMqttStore } from 'src/stores/mqtt-store'; |
| 49 | +import ChartCarousel from 'src/components/ChartCarousel.vue'; |
| 50 | +import BaseCarousel from 'src/components/BaseCarousel.vue'; |
| 51 | +import ChargePoint from 'src/components/ChargePoint.vue'; |
| 52 | +import BatteryInformation from 'src/components/BatteryInformation.vue'; |
| 53 | +import BatteryOverview from 'src/components/BatteryOverview.vue'; |
| 54 | +import SmartHomeInformation from 'src/components/SmartHomeInformation.vue'; |
11 | 55 |
|
12 | 56 | defineOptions({ |
13 | | - name: 'TestPage', |
| 57 | + name: 'IndexPage', |
| 58 | +}); |
| 59 | +
|
| 60 | +const tab = ref<string>('charge-points'); |
| 61 | +
|
| 62 | +const showBatteryOverview = computed(() => { |
| 63 | + return mqttStore.batteryIds.length > 1; |
14 | 64 | }); |
| 65 | +
|
| 66 | +const mqttStore = useMqttStore(); |
| 67 | +const chargePointIds = computed(() => mqttStore.chargePointIds); |
| 68 | +const batteryIds = computed(() => mqttStore.batteryIds); |
15 | 69 | </script> |
0 commit comments