Skip to content

Commit 18aec51

Browse files
authored
Merge pull request openWB#1286 from cshagen/master
Colors theme: Fix border colors in chargepointlist and device list
2 parents 303ff82 + a1fe9c8 commit 18aec51

File tree

11 files changed

+133
-103
lines changed

11 files changed

+133
-103
lines changed

packages/modules/web_themes/colors/source/src/components/chargePointList/CPChargePoint.vue

+20-25
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,8 @@
111111
<!-- Car info -->
112112

113113
<div class="m-0 p-0 d-flex justify-content-between">
114-
<InfoItem
115-
v-if="chargepoint.isSocConfigured"
116-
heading="Ladestand:"
117-
>
118-
<BatterySymbol
119-
:soc="soc"
120-
class="me-2"
121-
/>
114+
<InfoItem v-if="chargepoint.isSocConfigured" heading="Ladestand:">
115+
<BatterySymbol :soc="soc" class="me-2" />
122116
<i
123117
v-if="chargepoint.isSocConfigured && chargepoint.isSocManual"
124118
class="fa-solid fa-sm fas fa-edit"
@@ -137,10 +131,7 @@
137131
@click="loadSoc"
138132
/>
139133
</InfoItem>
140-
<InfoItem
141-
v-if="chargepoint.isSocConfigured"
142-
heading="Reichweite:"
143-
>
134+
<InfoItem v-if="chargepoint.isSocConfigured" heading="Reichweite:">
144135
{{
145136
vehicles[props.chargepoint.connectedVehicle]
146137
? Math.round(
@@ -160,21 +151,26 @@
160151
</div>
161152
<div
162153
v-if="editSoc"
163-
class="socEditor rounded mt-2 d-flex flex-column align-items-end"
154+
class="socEditor rounded mt-2 d-flex flex-column align-items-center"
164155
>
165-
<ConfigItem title="Ladestand einstellen:" :fullwidth="true">
166-
<RangeInput
167-
id="manualSoc"
168-
v-model="manualSoc"
169-
:min="0"
170-
:max="100"
171-
:step="1"
172-
unit="%"
173-
/>
174-
</ConfigItem>
156+
<span class="d-flex m-1 p-0 socEditTitle"
157+
>Ladestand einstellen:</span
158+
>
159+
<span class="d-flex justify-content-stretch align-items-center">
160+
<span>
161+
<RangeInput
162+
id="manualSoc"
163+
v-model="manualSoc"
164+
:min="0"
165+
:max="100"
166+
:step="1"
167+
unit="%"
168+
/>
169+
</span>
170+
</span>
175171
<span
176172
type="button"
177-
class="fa-solid d-flex fa-lg me-2 mb-3 fa-circle-check"
173+
class="fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check"
178174
@click="setSoc"
179175
/>
180176
</div>
@@ -220,7 +216,6 @@ import RadioBarInput from '@/components/shared/RadioBarInput.vue'
220216
import WbWidgetFlex from '../shared/WbWidgetFlex.vue'
221217
import { updateServer } from '@/assets/js/sendMessages'
222218
import RangeInput from '../shared/RangeInput.vue'
223-
import ConfigItem from '../shared/ConfigItem.vue'
224219
225220
const props = defineProps<{
226221
chargepoint: ChargePoint

packages/modules/web_themes/colors/source/src/components/chargePointList/cpSimpleList/CPSListItem.vue

+23-14
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,23 @@
9191
</tr>
9292
<tr v-if="editSoc" class="socEditRow m-0 p-0">
9393
<td colspan="5" class="m-0 p-0 pb-2">
94-
<div class="socEditor rounded mt-2 d-flex flex-column align-items-end">
95-
<ConfigItem title="Ladestand einstellen:" :fullwidth="true">
96-
<RangeInput
97-
id="manualSoc"
98-
v-model="manualSoc"
99-
:min="0"
100-
:max="100"
101-
:step="1"
102-
unit="%"
103-
/>
104-
</ConfigItem>
94+
<div class="socEditor rounded mt-2 d-flex flex-column align-items-center">
95+
<span class="d-flex m-1 p-0 socEditTitle">Ladestand einstellen:</span>
96+
<span class="d-flex justify-content-stretch align-items-center">
97+
<span>
98+
<RangeInput
99+
id="manualSoc"
100+
v-model="manualSoc"
101+
:min="0"
102+
:max="100"
103+
:step="1"
104+
unit="%"
105+
/>
106+
</span>
107+
</span>
105108
<span
106109
type="button"
107-
class="fa-solid d-flex fa-lg me-2 mb-3 fa-circle-check"
110+
class="fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check"
108111
@click="setSoc"
109112
/>
110113
</div>
@@ -131,7 +134,6 @@ import { chargemodes, globalConfig } from '@/assets/js/themeConfig'
131134
import { formatWatt, formatWattH } from '@/assets/js/helpers'
132135
import CPChargeConfigPanel from '../cpConfig/CPChargeConfigPanel.vue'
133136
import BatterySymbol from '../../shared/BatterySymbol.vue'
134-
import ConfigItem from '@/components/shared/ConfigItem.vue'
135137
import RangeInput from '@/components/shared/RangeInput.vue'
136138
import { updateServer } from '@/assets/js/sendMessages'
137139
import ModalComponent from '@/components/shared/ModalComponent.vue'
@@ -236,7 +238,7 @@ const manualSoc = computed({
236238
<style scoped>
237239
.tablerow {
238240
margin: 14px;
239-
border-top: 0.1px solid var(--color-frame);
241+
border-top: 0.1px solid var(--color-scale);
240242
}
241243
242244
.tablecell {
@@ -283,14 +285,21 @@ const manualSoc = computed({
283285
.fa-clock {
284286
color: var(--color-battery);
285287
}
288+
286289
.socEditor {
287290
border: 1px solid var(--color-menu);
288291
background-color: var(--color-bg);
289292
}
293+
290294
.socEditRow td {
291295
background-color: var(--color-bg);
292296
}
297+
293298
.fa-circle-check {
294299
color: var(--color-menu);
295300
}
301+
302+
.socEditTitle {
303+
color: white;
304+
}
296305
</style>

packages/modules/web_themes/colors/source/src/components/powerGraph/model.ts

+26
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ export const liveGraph = reactive({
108108
this.initCounter = 0
109109
this.graphRefreshCounter = 0
110110
this.rawDataPacks = []
111+
resetPvValues()
112+
energyMeterNeedsRedraw.value = true
111113
},
112114
deactivate() {
113115
this.unsubscribeRefresh()
@@ -322,6 +324,9 @@ export function updateEnergyValues(
322324
})
323325
historicSummary.setEnergy('devices', 0)
324326
Object.entries(totals.sh).forEach(([id, values]) => {
327+
if (!historicSummary.keys().includes(id)) {
328+
historicSummary.addItem(id)
329+
}
325330
historicSummary.setEnergy(id, values.imported)
326331
const idNumber = id.substring(2)
327332
if (!shDevices[+idNumber].countAsHouse) {
@@ -376,6 +381,27 @@ export function updateEnergyValues(
376381
}
377382
energyMeterNeedsRedraw.value = true
378383
}
384+
function resetPvValues() {
385+
historicSummary.keys().map((cat) => {
386+
if (consumerCategories.includes(cat)) {
387+
usageSummary[cat].energy = historicSummary.items[cat].energy
388+
usageSummary[cat].energyPv = 0
389+
usageSummary[cat].energyBat = 0
390+
usageSummary[cat].pvPercentage = 0
391+
}
392+
})
393+
Object.values(chargePoints).map((cp) => {
394+
cp.energyPv = 0
395+
cp.energyBat = 0
396+
cp.pvPercentage = 0
397+
})
398+
Object.values(shDevices).map((device) => {
399+
device.energyPv = 0
400+
device.energyBat = 0
401+
device.pvPercentage = 0
402+
})
403+
}
404+
379405
export const xScaleMonth = computed(() => {
380406
const e = extent(graphData.data, (d) => d.date)
381407
if (e[1]) {

packages/modules/web_themes/colors/source/src/components/powerGraph/processMonthYearGraphData.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ function transformRow(inputRow: RawDayGraphDataItem): GraphDataItem {
155155
// Devices
156156
outputRow.devices = Object.entries(inputRow.sh).reduce<number>(
157157
(sum: number, item) => {
158+
if (!historicSummary.keys().includes(item[0])) {
159+
historicSummary.addItem(item[0])
160+
}
158161
if (item[1].energy_imported >= 0) {
159162
sum += item[1].energy_imported
160-
if (!historicSummary.keys().includes(item[0])) {
161-
historicSummary.addItem(item[0])
162-
}
163163
} else {
164164
console.warn(
165165
`Negative energy value for device ${item[0]} in row ${outputRow.date}. Ignoring this value`,

packages/modules/web_themes/colors/source/src/components/shared/WbSubwidget.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const widgetwidth = computed(() => {
3535
})
3636
</script>
3737
<style scoped>
38-
/* .wb-subwidget {
38+
.wb-subwidget {
3939
border-top: 0.5px solid var(--color-scale);
40-
} */
40+
}
4141
</style>

packages/modules/web_themes/colors/web/assets/index-4e3f10be.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/modules/web_themes/colors/web/assets/index-5b61a84c.css renamed to packages/modules/web_themes/colors/web/assets/index-8951a584.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/modules/web_themes/colors/web/assets/index-91b4c1d6.js

-2
This file was deleted.

packages/modules/web_themes/colors/web/assets/vendor-4d91b42b.js

+53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/modules/web_themes/colors/web/assets/vendor-e76013e3.js

-53
This file was deleted.

packages/modules/web_themes/colors/web/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
<link rel="apple-touch-icon" sizes="57x57" href="/openWB/web/img/favicons/apple-touch-icon-57x57.png">
2424
<link rel="apple-touch-icon" sizes="60x60" href="/openWB/web/img/favicons/apple-touch-icon-60x60.png">
2525
<title>openWB</title>
26-
<script type="module" crossorigin src="/openWB/web/themes/colors/assets/index-91b4c1d6.js"></script>
27-
<link rel="modulepreload" crossorigin href="/openWB/web/themes/colors/assets/vendor-e76013e3.js">
28-
<link rel="stylesheet" href="/openWB/web/themes/colors/assets/index-5b61a84c.css">
26+
<script type="module" crossorigin src="/openWB/web/themes/colors/assets/index-4e3f10be.js"></script>
27+
<link rel="modulepreload" crossorigin href="/openWB/web/themes/colors/assets/vendor-4d91b42b.js">
28+
<link rel="stylesheet" href="/openWB/web/themes/colors/assets/index-8951a584.css">
2929
</head>
3030

3131
<body>

0 commit comments

Comments
 (0)