Skip to content

Commit c22e4d9

Browse files
Brett-S-OWBbenderl
authored andcommitted
Fix page routing
1 parent 455e66e commit c22e4d9

4 files changed

Lines changed: 77 additions & 77 deletions

File tree

Lines changed: 60 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,69 @@
11
<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>
443
</q-page>
544
</template>
645

7-
<style scoped></style>
8-
946
<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';
1155
1256
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;
1464
});
65+
66+
const mqttStore = useMqttStore();
67+
const chargePointIds = computed(() => mqttStore.chargePointIds);
68+
const batteryIds = computed(() => mqttStore.batteryIds);
1569
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<q-page class="row items-center justify-evenly">
3+
<system-information title="System Information"></system-information>
4+
</q-page>
5+
</template>
6+
7+
<style scoped></style>
8+
9+
<script setup lang="ts">
10+
import SystemInformation from 'src/components/SystemInformation.vue';
11+
12+
defineOptions({
13+
name: 'TestPage',
14+
});
15+
</script>

packages/modules/web_themes/standard/source/src/pages/TestPage.vue

Lines changed: 0 additions & 69 deletions
This file was deleted.

packages/modules/web_themes/standard/source/src/router/routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ const routes: RouteRecordRaw[] = [
44
{
55
path: '/info',
66
component: () => import('layouts/MainLayout.vue'),
7-
children: [{ path: '', component: () => import('pages/IndexPage.vue') }],
7+
children: [{ path: '', component: () => import('pages/InfoPage.vue') }],
88
},
99

1010
{
1111
path: '/',
1212
component: () => import('layouts/MainLayout.vue'),
13-
children: [{ path: '', component: () => import('pages/TestPage.vue') }],
13+
children: [{ path: '', component: () => import('pages/IndexPage.vue') }],
1414
},
1515

1616
// Always leave this as last one,

0 commit comments

Comments
 (0)