Skip to content

Commit

Permalink
webapp: make all battery admin labels wide, hide battery provided dis…
Browse files Browse the repository at this point in the history
…charge current limit in some cases
  • Loading branch information
AndreasBoehm committed Oct 23, 2024
1 parent fa7f2ef commit 36f3575
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions webapp/src/views/BatteryAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,22 @@
:label="$t('batteryadmin.EnableBattery')"
v-model="batteryConfigList.enabled"
type="checkbox"
wide
/>

<InputElement
v-show="batteryConfigList.enabled"
:label="$t('batteryadmin.VerboseLogging')"
v-model="batteryConfigList.verbose_logging"
type="checkbox"
wide
/>

<div class="row mb-3" v-show="batteryConfigList.enabled">
<label class="col-sm-2 col-form-label">
<label class="col-sm-4 col-form-label">
{{ $t('batteryadmin.Provider') }}
</label>
<div class="col-sm-10">
<div class="col-sm-8">
<select class="form-select" v-model="batteryConfigList.provider">
<option v-for="provider in providerTypeList" :key="provider.key" :value="provider.key">
{{ $t(`batteryadmin.Provider` + provider.value) }}
Expand All @@ -40,10 +42,10 @@
addSpace
>
<div class="row mb-3">
<label class="col-sm-2 col-form-label">
<label class="col-sm-4 col-form-label">
{{ $t('batteryadmin.JkBmsInterface') }}
</label>
<div class="col-sm-10">
<div class="col-sm-8">
<select class="form-select" v-model="batteryConfigList.jkbms_interface">
<option
v-for="jkBmsInterface in jkBmsInterfaceTypeList"
Expand All @@ -64,6 +66,7 @@
max="90"
step="1"
:postfix="$t('batteryadmin.Seconds')"
wide
/>
</CardElement>

Expand All @@ -74,6 +77,7 @@
v-model="batteryConfigList.mqtt_soc_topic"
type="text"
maxlength="256"
wide
/>

<InputElement
Expand All @@ -82,6 +86,7 @@
type="text"
maxlength="128"
:tooltip="$t('batteryadmin.MqttJsonPathDescription')"
wide
/>
</CardElement>

Expand All @@ -91,6 +96,7 @@
v-model="batteryConfigList.mqtt_voltage_topic"
type="text"
maxlength="256"
wide
/>

<InputElement
Expand All @@ -99,13 +105,14 @@
type="text"
maxlength="128"
:tooltip="$t('batteryadmin.MqttJsonPathDescription')"
wide
/>

<div class="row mb-3">
<label for="mqtt_voltage_unit" class="col-sm-2 col-form-label">
<label for="mqtt_voltage_unit" class="col-sm-4 col-form-label">
{{ $t('batteryadmin.MqttVoltageUnit') }}
</label>
<div class="col-sm-10">
<div class="col-sm-8">
<select
id="mqtt_voltage_unit"
class="form-select"
Expand All @@ -128,53 +135,59 @@
<InputElement
:label="$t('batteryadmin.LimitDischargeCurrent')"
v-model="batteryConfigList.enable_discharge_current_limit"
:wide="true"
type="checkbox"
wide
/>

<template v-if="batteryConfigList.enable_discharge_current_limit">
<InputElement
:label="$t('batteryadmin.DischargeCurrentLimit')"
v-model="batteryConfigList.discharge_current_limit"
:wide="true"
type="number"
min="0"
step="0.1"
postfix="A"
wide
/>

<InputElement
:label="$t('batteryadmin.DischargeCurrentLimitBelowSoc')"
v-show="batteryConfigList.enabled"
v-model="batteryConfigList.discharge_current_limit_below_soc"
:wide="true"
type="number"
min="0"
max="100"
step="0.1"
postfix="%"
:tooltip="$t('batteryadmin.DischargeCurrentLimitBelowSocInfo')"
wide
/>

<InputElement
:label="$t('batteryadmin.DischargeCurrentLimitBelowVoltage')"
v-show="batteryConfigList.enabled"
v-model="batteryConfigList.discharge_current_limit_below_voltage"
:wide="true"
type="number"
min="0"
max="60"
step="0.01"
postfix="V"
:tooltip="$t('batteryadmin.DischargeCurrentLimitBelowVoltageInfo')"
wide
/>

<InputElement
:label="$t('batteryadmin.UseBatteryReportedDischargeCurrentLimit')"
:wide="true"
v-show="batteryConfigList.enabled"
v-show="
batteryConfigList.enabled &&
(batteryConfigList.provider == 0 ||
batteryConfigList.provider == 2 ||
batteryConfigList.provider == 4 ||
batteryConfigList.provider == 5)
"
v-model="batteryConfigList.use_battery_reported_discharge_current_limit"
type="checkbox"
wide
/>
</template>

Expand All @@ -195,15 +208,15 @@
<InputElement
:label="$t('batteryadmin.MqttDischargeCurrentTopic')"
v-model="batteryConfigList.mqtt_discharge_current_topic"
:wide="true"
wide
type="text"
maxlength="256"
/>

<InputElement
:label="$t('batteryadmin.MqttJsonPath')"
v-model="batteryConfigList.mqtt_discharge_current_json_path"
:wide="true"
wide
type="text"
maxlength="128"
:tooltip="$t('batteryadmin.MqttJsonPathDescription')"
Expand Down

0 comments on commit 36f3575

Please sign in to comment.