Skip to content

Commit

Permalink
webapp: MQTT: use v-if in favor of v-show
Browse files Browse the repository at this point in the history
if we hide elements (which is done using style="display:none;"), they
are still part of the DOM and mess with CSS rules that shall apply to
the last element of a card or the last row of a table.
  • Loading branch information
schlimmchen authored and tbnobody committed Nov 1, 2024
1 parent eecd7f7 commit 9132a88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions webapp/src/views/MqttAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/>

<InputElement
v-show="mqttConfigList.mqtt_enabled"
v-if="mqttConfigList.mqtt_enabled"
:label="$t('mqttadmin.EnableHass')"
v-model="mqttConfigList.mqtt_hass_enabled"
type="checkbox"
Expand All @@ -26,7 +26,7 @@
:text="$t('mqttadmin.MqttBrokerParameter')"
textVariant="text-bg-primary"
add-space
v-show="mqttConfigList.mqtt_enabled"
v-if="mqttConfigList.mqtt_enabled"
>
<InputElement
:label="$t('mqttadmin.Hostname')"
Expand Down Expand Up @@ -99,7 +99,7 @@
<InputElement :label="$t('mqttadmin.EnableTls')" v-model="mqttConfigList.mqtt_tls" type="checkbox" />

<InputElement
v-show="mqttConfigList.mqtt_tls"
v-if="mqttConfigList.mqtt_tls"
:label="$t('mqttadmin.RootCa')"
v-model="mqttConfigList.mqtt_root_ca_cert"
type="textarea"
Expand All @@ -108,14 +108,14 @@
/>

<InputElement
v-show="mqttConfigList.mqtt_tls"
v-if="mqttConfigList.mqtt_tls"
:label="$t('mqttadmin.TlsCertLoginEnable')"
v-model="mqttConfigList.mqtt_tls_cert_login"
type="checkbox"
/>

<InputElement
v-show="mqttConfigList.mqtt_tls_cert_login"
v-if="mqttConfigList.mqtt_tls_cert_login"
:label="$t('mqttadmin.ClientCert')"
v-model="mqttConfigList.mqtt_client_cert"
type="textarea"
Expand All @@ -124,7 +124,7 @@
/>

<InputElement
v-show="mqttConfigList.mqtt_tls_cert_login"
v-if="mqttConfigList.mqtt_tls_cert_login"
:label="$t('mqttadmin.ClientKey')"
v-model="mqttConfigList.mqtt_client_key"
type="textarea"
Expand All @@ -137,7 +137,7 @@
:text="$t('mqttadmin.LwtParameters')"
textVariant="text-bg-primary"
add-space
v-show="mqttConfigList.mqtt_enabled"
v-if="mqttConfigList.mqtt_enabled"
>
<InputElement
:label="$t('mqttadmin.LwtTopic')"
Expand Down Expand Up @@ -182,7 +182,7 @@
:text="$t('mqttadmin.HassParameters')"
textVariant="text-bg-primary"
add-space
v-show="mqttConfigList.mqtt_enabled && mqttConfigList.mqtt_hass_enabled"
v-if="mqttConfigList.mqtt_enabled && mqttConfigList.mqtt_hass_enabled"
>
<InputElement
:label="$t('mqttadmin.HassPrefixTopic')"
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/views/MqttInfoView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
/>
</td>
</tr>
<tr v-show="mqttDataList.mqtt_tls">
<tr v-if="mqttDataList.mqtt_tls">
<th>{{ $t('mqttinfo.RootCertifcateInfo') }}</th>
<td>{{ mqttDataList.mqtt_root_ca_cert_info }}</td>
</tr>
Expand All @@ -93,7 +93,7 @@
/>
</td>
</tr>
<tr v-show="mqttDataList.mqtt_tls_cert_login">
<tr v-if="mqttDataList.mqtt_tls_cert_login">
<th>{{ $t('mqttinfo.ClientCertifcateInfo') }}</th>
<td>{{ mqttDataList.mqtt_client_cert_info }}</td>
</tr>
Expand Down

0 comments on commit 9132a88

Please sign in to comment.