Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colors theme: Bug fixes #1485

Merged
merged 2 commits into from
Mar 18, 2024
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 @@ -103,7 +103,7 @@ function processCounterMessages(topic: string, message: string) {
} else if (elements[3] == 'config') {
// console.warn('Ignored counter config message')
}
if (elements[3] == 'get') {
if (elements[3] == 'get' && id in counters) {
switch (elements[4]) {
case 'power':
counters[id].power = +message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
:full-width="props.fullWidth"
>
<template #title>
<span :style="cpNameStyle" @click="configmode = !configmode">
<span class="fa-solid fa-charging-station">&nbsp;</span>
{{ props.chargepoint.name }}</span
>
<span class="d-flex justify-content-center align-items-center">
<span :style="cpNameStyle" @click="configmode = !configmode">
<span class="fa-solid fa-charging-station">&nbsp;</span>
{{ props.chargepoint.name }}</span
>
<span
v-if="cp.faultState != 0"
class="badge rounded-pill errorbadge ms-3"
>Fehler</span
>
</span>
</template>

<template #buttons>
Expand Down Expand Up @@ -457,4 +464,9 @@ const editPrice = ref(false)
grid-template-columns: repeat(12, auto);
justify-content: space-between;
}
.errorbadge {
color: var(--color-bg);
background-color: var(--color-evu);
font-size: var(--font-small);
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
<span class="status-string">{{ cp.stateStr }}</span>
</ConfigItem>

<ConfigItem v-if="cp.faultState != 0" title="Fehler" class="grid-col-12">
<ConfigItem
v-if="cp.faultState != 0"
title="Fehler"
class="grid-col-12"
icon="fa-triangle-exclamation"
>
<span style="color: red"> {{ cp.faultStr }} </span>
</ConfigItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const displayDate = computed(() => {
console.warn('Graph Data empty.')
return '???'
} */
return (props.ignoreLive)?'heute':`${liveGraph.duration} min`
return props.ignoreLive ? 'heute' : `${liveGraph.duration} min`
case 'today':
return 'heute'
case 'day':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,18 @@
</span>
</div>
</template>

<figure id="powergraph" class="p-0 m-0" @click="changeStackOrder">
<div
v-if="graphData.data.length == 0"
class="d-flex justify-content-center waitsign rounded"
>
<span class="fa-solid fa-xl fa-spinner fa-spin"></span>
benderl marked this conversation as resolved.
Show resolved Hide resolved
</div>
<figure
v-show="graphData.data.length > 0"
id="powergraph"
class="p-0 m-0"
@click="changeStackOrder"
>
<svg :viewBox="'0 0 ' + width + ' ' + height">
<!-- Draw the source graph -->
<PGSourceGraph
Expand Down Expand Up @@ -159,4 +169,14 @@ function zoomGraph() {
font-size: var(--font-medium);
font-weight: normal;
}
.waitsign {
text-align: center;
font-size: var(--font-medium);
color: var(--color-fg);
border: 1px solid var(--color-bg);
padding: 2em;
margin: 2em;
margin-top: 4em;
background-color: var(--color-bg);
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const dayGraph = reactive({
command: 'getDailyLog',
data: { day: dateString },
})
// graphData.data = []
graphData.data = []
}
},
deactivate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function transformRow(currentRow: RawDayGraphDataItem): GraphDataItem {
currentItem.selfUsage = currentItem.pv - currentItem.evuOut
// House
if (currentRow.hc && currentRow.hc.all) {
currentItem.house = currentRow.hc.all.power_imported
currentItem.house = currentRow.hc.all.power_imported - currentItem.devices
benderl marked this conversation as resolved.
Show resolved Hide resolved
} else {
currentItem.house =
currentItem.evuIn +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import {
timeFormat,
axisLeft,
select,

} from 'd3'

const props = defineProps<{
Expand Down Expand Up @@ -79,8 +78,8 @@ const barwidth = computed(() => {
const xScale = computed(() => {
let xdomain = extent(plotdata.value, (d) => d[0]) as [Date, Date]
if (xdomain[1]) {
xdomain[1]= new Date (xdomain[1])
xdomain[1].setTime(xdomain[1].getTime()+3600000)
xdomain[1] = new Date(xdomain[1])
xdomain[1].setTime(xdomain[1].getTime() + 3600000)
}
return scaleTime()
.range([margin.left, width - margin.right])
Expand All @@ -103,11 +102,11 @@ const xAxisGenerator = computed(() => {
.ticks(plotdata.value.length)
.tickSize(5)
.tickSizeInner(-height)
.tickFormat((d) => (d.getHours() % 6 == 0)? timeFormat('%H:%M')(d) : '')
.tickFormat((d) => (d.getHours() % 6 == 0 ? timeFormat('%H:%M')(d) : ''))
})
const yAxisGenerator = computed(() => {
return axisLeft<number>(yScale.value)
.ticks(yDomain.value[1]-yDomain.value[0])
.ticks(yDomain.value[1] - yDomain.value[0])
.tickSize(0)
.tickSizeInner(-(width - margin.right - margin.left))
.tickFormat((d) => d.toString())
Expand Down Expand Up @@ -143,7 +142,9 @@ const draw = computed(() => {
xAxis
.selectAll('.tick line')
.attr('stroke', 'var(--color-bg)')
.attr('stroke-width',(d) => ((d as Date).getHours()%6==0)?'2' :'0.5')
.attr('stroke-width', (d) =>
(d as Date).getHours() % 6 == 0 ? '2' : '0.5',
benderl marked this conversation as resolved.
Show resolved Hide resolved
)
xAxis.select('.domain').attr('stroke', 'var(--color-bg')
// Y Axis
const yAxis = svg.append('g').attr('class', 'axis').call(yAxisGenerator.value)
Expand All @@ -155,7 +156,7 @@ const draw = computed(() => {
yAxis
.selectAll('.tick line')
.attr('stroke', 'var(--color-bg)')
.attr('stroke-width', (d) => (d as number % 5 == 0)? '2' : '0.5')
.attr('stroke-width', (d) => ((d as number) % 5 == 0 ? '2' : '0.5'))
benderl marked this conversation as resolved.
Show resolved Hide resolved

yAxis.select('.domain').attr('stroke', 'var(--color-bg)')

Expand Down

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions packages/modules/web_themes/colors/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<link rel="apple-touch-icon" sizes="57x57" href="/openWB/web/img/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/openWB/web/img/favicons/apple-touch-icon-60x60.png">
<title>openWB</title>
<script type="module" crossorigin src="/openWB/web/themes/colors/assets/index-a6d0268a.js"></script>
<link rel="modulepreload" crossorigin href="/openWB/web/themes/colors/assets/vendor-6c3d972a.js">
<link rel="stylesheet" href="/openWB/web/themes/colors/assets/index-53545bda.css">
<script type="module" crossorigin src="/openWB/web/themes/colors/assets/index-b7643030.js"></script>
<link rel="modulepreload" crossorigin href="/openWB/web/themes/colors/assets/vendor-20b697ee.js">
<link rel="stylesheet" href="/openWB/web/themes/colors/assets/index-67a02a84.css">
</head>

<body>
Expand Down