Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,22 @@ const legendLarge = computed(() => {
return legendItems.value.length > 20;
});

const batteryConfigured = computed(() => {
return mqttStore.batteryConfigured;
});

const updateLegendItems = () => {
if (!props.chart) return;
const items =
let items =
props.chart.options.plugins?.legend?.labels?.generateLabels?.(
props.chart,
) || [];
if (!batteryConfigured.value) {
items = items.filter(
(item: LegendItemWithCategory) =>
item.text !== 'Speicher ges.' && item.text !== 'Speicher SoC',
);
}
(items as LegendItemWithCategory[]).forEach((item) => {
if (item.text && localDataStore.isDatasetHidden(item.text)) {
item.hidden = true;
Expand Down
12 changes: 9 additions & 3 deletions packages/modules/web_themes/koala/source/src/pages/IndexPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<q-tab name="vehicles" title="Fahrzeuge">
<q-icon name="directions_car" size="md" color="primary" />
</q-tab>
<q-tab name="batteries" title="Speicher">
<q-tab v-if="batteryConfigured" name="batteries" title="Speicher">
<q-icon name="battery_full" size="md" color="primary" />
</q-tab>
<!-- <q-tab name="smart-home" title="SmartHome">
Expand All @@ -32,7 +32,7 @@
<VehicleInformation />
</q-tab-panel>
<!-- Batteries -->
<q-tab-panel name="batteries">
<q-tab-panel v-if="batteryConfigured" name="batteries">
<BatteryInformation />
</q-tab-panel>
<!-- Smart Home -->
Expand All @@ -45,7 +45,8 @@
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { computed, ref } from 'vue';
import { useMqttStore } from 'src/stores/mqtt-store';
import ChartCarousel from 'src/components/ChartCarousel.vue';
import ChargePointInformation from 'src/components/ChargePointInformation.vue';
import BatteryInformation from 'src/components/BatteryInformation.vue';
Expand All @@ -57,6 +58,11 @@ defineOptions({
});

const tab = ref<string>('charge-points');
const mqttStore = useMqttStore();

const batteryConfigured = computed(() => {
return mqttStore.batteryConfigured;
});
</script>

<style scoped>
Expand Down