From bb34fa74fdd9a5a8d4780d4b73d5a7c72107b161 Mon Sep 17 00:00:00 2001 From: Bernhard Kirchen Date: Sat, 30 Dec 2023 16:46:16 +0100 Subject: [PATCH] Fix: use FormFooter in OnBattery-specific forms (#569) the upstream project introduced a new Vue component "FormFooter", which is used to end an input form, namely all settings forms. we should not only use this component as well, but the save button on our forms actually broke since the text dtuadmin.Save is replaced by base.Save. also replace the use of dtuadmin.Seconds with base.Seconds, such that an upstream change to dtuadmin.Seconds will not break the battery admin an AC charger views. --- webapp/src/locales/de.json | 14 +++++--------- webapp/src/locales/en.json | 14 +++++--------- webapp/src/locales/fr.json | 13 +++++-------- webapp/src/views/AcChargerAdminView.vue | 4 +++- webapp/src/views/BatteryAdminView.vue | 4 +++- webapp/src/views/PowerLimiterAdminView.vue | 4 +++- webapp/src/views/PowerMeterAdminView.vue | 4 +++- webapp/src/views/VedirectAdminView.vue | 4 +++- 8 files changed, 30 insertions(+), 31 deletions(-) diff --git a/webapp/src/locales/de.json b/webapp/src/locales/de.json index 8514e2488..e2a52f78f 100644 --- a/webapp/src/locales/de.json +++ b/webapp/src/locales/de.json @@ -31,6 +31,7 @@ "Yes": "Ja", "No": "Nein", "VerboseLogging": "Ausführliche Protokollierung", + "Seconds": "Sekunden", "Loading": "Lade...", "Reload": "Aktualisieren", "Cancel": "Abbrechen", @@ -519,8 +520,7 @@ "EnableVedirect": "Aktiviere VE.Direct", "VedirectParameter": "VE.Direct Parameter", "VerboseLogging": "@:base.VerboseLogging", - "UpdatesOnly": "Werte nur bei Änderung an MQTT broker senden", - "Save": "@:dtuadmin.Save" + "UpdatesOnly": "Werte nur bei Änderung an MQTT broker senden" }, "powermeteradmin":{ "PowerMeterSettings": "Stromzähler Einstellungen", @@ -541,7 +541,6 @@ "SDM": "SDM-Stromzähler Konfiguration", "sdmbaudrate": "Baudrate", "sdmaddress": "Modbus Adresse", - "Save": "@:dtuadmin.Save", "HTTP": "HTTP(S) + JSON - Allgemeine Konfiguration", "httpIndividualRequests": "Individuelle HTTP requests pro Phase", "httpUrlDescription": "Die URL muss mit http:// oder https:// beginnen. Manche Zeichen wie Leerzeichen und = müssen mit URL-Kodierung kodiert werden (%xx). Achtung: Ein Überprüfung von SSL Server Zertifikaten ist nicht implementiert (MITM-Attacken sind möglich)! Beispiele gibt es unten.", @@ -596,8 +595,7 @@ "VoltageLoadCorrectionInfo": "Hinweis: Wenn Leistung von der Batterie abgegeben wird, bricht normalerweise die Spannung etwas ein. Damit nicht vorzeitig der Wechelrichter ausgeschaltet wird sobald der \"Stop\"-Schwellenwert erreicht wird, wird der hier angegebene Korrekturfaktor mit einberechnet. Korrigierte Spannung = DC Spannung + (Aktuelle Leistung (W) * Korrekturfaktor).", "InverterRestart": "Wechselrichter Neustart", "InverterRestartHour": "Stunde für Neustart", - "InverterRestartHint": "Neustart des Wechselrichter einmal täglich um die \"Tagesertrag\" Werte wieder auf Null zu setzen.", - "Save": "@:dtuadmin.Save" + "InverterRestartHint": "Neustart des Wechselrichter einmal täglich um die \"Tagesertrag\" Werte wieder auf Null zu setzen." }, "batteryadmin": { "BatterySettings": "Batterie Einstellungen", @@ -613,8 +611,7 @@ "JkBmsInterfaceUart": "TTL-UART an der MCU", "JkBmsInterfaceTransceiver": "RS-485 Transceiver an der MCU", "PollingInterval": "Abfrageintervall", - "Seconds": "@:dtuadmin.Seconds", - "Save": "@:dtuadmin.Save" + "Seconds": "@:base.Seconds" }, "inverteradmin": { "InverterSettings": "Wechselrichter Einstellungen", @@ -800,8 +797,7 @@ "enableVoltageLimitHint": "Die automatische Leistungssteuerung wird deaktiviert wenn die Ausgangsspannung über diesem Wert liegt und wenn gleichzeitig die Ausgangsleistung unter die minimale Leistung fällt.\nDie automatische Leistungssteuerung wird re-aktiveiert wenn die Batteriespannung unter diesen Wert fällt.", "lowerPowerLimit": "Minimale Leistung", "upperPowerLimit": "Maximale Leistung", - "Seconds": "@:dtuadmin.Seconds", - "Save": "@:dtuadmin.Save" + "Seconds": "@:base.Seconds" }, "battery": { "battery": "Batterie", diff --git a/webapp/src/locales/en.json b/webapp/src/locales/en.json index 0347aec83..91df2dbf5 100644 --- a/webapp/src/locales/en.json +++ b/webapp/src/locales/en.json @@ -31,6 +31,7 @@ "Yes": "Yes", "No": "No", "VerboseLogging": "Verbose Logging", + "Seconds": "Seconds", "Loading": "Loading...", "Reload": "Reload", "Cancel": "Cancel", @@ -521,8 +522,7 @@ "EnableVedirect": "Enable VE.Direct", "VedirectParameter": "VE.Direct Parameter", "VerboseLogging": "@:base.VerboseLogging", - "UpdatesOnly": "Publish values to MQTT only when they change", - "Save": "@:dtuadmin.Save" + "UpdatesOnly": "Publish values to MQTT only when they change" }, "powermeteradmin":{ "PowerMeterSettings": "Power Meter Settings", @@ -543,7 +543,6 @@ "SDM": "SDM-Power Meter Parameter", "sdmbaudrate": "Baudrate", "sdmaddress": "Modbus Address", - "Save": "@:dtuadmin.Save", "HTTP": "HTTP(S) + Json - General configuration", "httpIndividualRequests": "Individual HTTP requests per phase", "httpPhase": "HTTP(S) + Json configuration - Phase {phaseNumber}", @@ -605,8 +604,7 @@ "VoltageLoadCorrectionInfo": "Hint: When the power output is higher, the voltage is usually decreasing. In order to not stop the inverter too early (Stop treshold), a power factor can be specified here to correct this. Corrected voltage = DC Voltage + (Current power * correction factor).", "InverterRestart": "Inverter Restart", "InverterRestartHour": "Restart Hour", - "InverterRestartHint": "Restart the Inverter once a day to reset the \"YieldDay\" values.", - "Save": "@:dtuadmin.Save" + "InverterRestartHint": "Restart the Inverter once a day to reset the \"YieldDay\" values." }, "batteryadmin": { "BatterySettings": "Battery Settings", @@ -622,8 +620,7 @@ "JkBmsInterfaceUart": "TTL-UART on MCU", "JkBmsInterfaceTransceiver": "RS-485 Transceiver on MCU", "PollingInterval": "Polling Interval", - "Seconds": "@:dtuadmin.Seconds", - "Save": "@:dtuadmin.Save" + "Seconds": "@:base.Seconds" }, "inverteradmin": { "InverterSettings": "Inverter Settings", @@ -810,8 +807,7 @@ "enableVoltageLimitHint": "Automatic power control is disabled if the output voltage is higher then this value and if the output power drops below the minimum output power limit (set below).\nAutomatic power control is re-enabled if the battery voltage drops below the value set in this field.", "lowerPowerLimit": "Minimum output power", "upperPowerLimit": "Maximum output power", - "Seconds": "@:dtuadmin.Seconds", - "Save": "@:dtuadmin.Save" + "Seconds": "@:base.Seconds" }, "battery": { "battery": "Battery", diff --git a/webapp/src/locales/fr.json b/webapp/src/locales/fr.json index 3d0c5343b..7b7357716 100644 --- a/webapp/src/locales/fr.json +++ b/webapp/src/locales/fr.json @@ -31,6 +31,7 @@ "Yes": "Oui", "No": "Non", "VerboseLogging": "Journalisation Détaillée", + "Seconds": "Secondes", "Loading": "Chargement...", "Reload": "Reload", "Cancel": "Annuler", @@ -521,8 +522,7 @@ "EnableVedirect": "Enable VE.Direct", "VedirectParameter": "VE.Direct Parameter", "VerboseLogging": "@:base.VerboseLogging", - "UpdatesOnly": "Publish values to MQTT only when they change", - "Save": "@:dtuadmin.Save" + "UpdatesOnly": "Publish values to MQTT only when they change" }, "batteryadmin": { "BatterySettings": "Battery Settings", @@ -538,8 +538,7 @@ "JkBmsInterfaceUart": "TTL-UART on MCU", "JkBmsInterfaceTransceiver": "RS-485 Transceiver on MCU", "PollingInterval": "Polling Interval", - "Seconds": "@:dtuadmin.Seconds", - "Save": "@:dtuadmin.Save" + "Seconds": "@:base.Seconds" }, "inverteradmin": { "InverterSettings": "Paramètres des onduleurs", @@ -648,8 +647,7 @@ "BatterySocInfo": "Hint: The battery SoC (State of Charge) values can only be used if the battery communication interface is enabled. If the battery has not reported any SoC updates in the last minute, the voltage thresholds will be used as fallback.", "InverterIsBehindPowerMeter": "Inverter is behind Power meter", "Battery": "DC / Battery", - "VoltageLoadCorrectionInfo": "Hint: When the power output is higher, the voltage is usually decreasing. In order to not stop the inverter too early (Stop treshold), a power factor can be specified here to correct this. Corrected voltage = DC Voltage + (Current power * correction factor).", - "Save": "@:dtuadmin.Save" + "VoltageLoadCorrectionInfo": "Hint: When the power output is higher, the voltage is usually decreasing. In order to not stop the inverter too early (Stop treshold), a power factor can be specified here to correct this. Corrected voltage = DC Voltage + (Current power * correction factor)." }, "login": { "Login": "Connexion", @@ -768,8 +766,7 @@ "enableVoltageLimitHint": "Automatic power control is disabled if the output voltage is higher then this value and if the output power drops below the minimum output power limit (set below).\nAutomatic power control is re-enabled if the battery voltage drops below the value set in this field.", "lowerPowerLimit": "Minimum output power", "upperPowerLimit": "Maximum output power", - "Seconds": "@:dtuadmin.Seconds", - "Save": "@:dtuadmin.Save" + "Seconds": "@:base.Seconds" }, "battery": { "battery": "Battery", diff --git a/webapp/src/views/AcChargerAdminView.vue b/webapp/src/views/AcChargerAdminView.vue index 09527d58d..c9cdf7878 100644 --- a/webapp/src/views/AcChargerAdminView.vue +++ b/webapp/src/views/AcChargerAdminView.vue @@ -73,7 +73,7 @@ - + @@ -82,6 +82,7 @@ import BasePage from '@/components/BasePage.vue'; import BootstrapAlert from "@/components/BootstrapAlert.vue"; import CardElement from '@/components/CardElement.vue'; +import FormFooter from '@/components/FormFooter.vue'; import InputElement from '@/components/InputElement.vue'; import { BIconInfoCircle } from 'bootstrap-icons-vue'; import type { AcChargerConfig } from "@/types/AcChargerConfig"; @@ -93,6 +94,7 @@ export default defineComponent({ BasePage, BootstrapAlert, CardElement, + FormFooter, InputElement, BIconInfoCircle, }, diff --git a/webapp/src/views/BatteryAdminView.vue b/webapp/src/views/BatteryAdminView.vue index 4cf1e6735..e599425b3 100644 --- a/webapp/src/views/BatteryAdminView.vue +++ b/webapp/src/views/BatteryAdminView.vue @@ -49,7 +49,7 @@ type="number" min="2" max="90" step="1" :postfix="$t('batteryadmin.Seconds')"/> - + @@ -58,6 +58,7 @@ import BasePage from '@/components/BasePage.vue'; import BootstrapAlert from "@/components/BootstrapAlert.vue"; import CardElement from '@/components/CardElement.vue'; +import FormFooter from '@/components/FormFooter.vue'; import InputElement from '@/components/InputElement.vue'; import type { BatteryConfig } from "@/types/BatteryConfig"; import { authHeader, handleResponse } from '@/utils/authentication'; @@ -68,6 +69,7 @@ export default defineComponent({ BasePage, BootstrapAlert, CardElement, + FormFooter, InputElement, }, data() { diff --git a/webapp/src/views/PowerLimiterAdminView.vue b/webapp/src/views/PowerLimiterAdminView.vue index f70f82217..8f10a4cd1 100644 --- a/webapp/src/views/PowerLimiterAdminView.vue +++ b/webapp/src/views/PowerLimiterAdminView.vue @@ -265,7 +265,7 @@ - + @@ -276,6 +276,7 @@ import BasePage from '@/components/BasePage.vue'; import BootstrapAlert from "@/components/BootstrapAlert.vue"; import { handleResponse, authHeader } from '@/utils/authentication'; import CardElement from '@/components/CardElement.vue'; +import FormFooter from '@/components/FormFooter.vue'; import InputElement from '@/components/InputElement.vue'; import { BIconInfoCircle } from 'bootstrap-icons-vue'; import type { PowerLimiterConfig } from "@/types/PowerLimiterConfig"; @@ -285,6 +286,7 @@ export default defineComponent({ BasePage, BootstrapAlert, CardElement, + FormFooter, InputElement, BIconInfoCircle, }, diff --git a/webapp/src/views/PowerMeterAdminView.vue b/webapp/src/views/PowerMeterAdminView.vue index 287d94450..280171cf1 100644 --- a/webapp/src/views/PowerMeterAdminView.vue +++ b/webapp/src/views/PowerMeterAdminView.vue @@ -185,7 +185,7 @@ - +