live view: remove disabled -OnBattery-specifc views from DOM (#372)

instead of hiding views, we can also avoid adding them to the DOM. this
has a couple of advantages:

* no HTTP request for data is sent and no websocket connection is
  established for disabled features.
* JavaScript that causes errors due to incomplete or incompatible data
  of features that are disabled anyways do not trigger the browser
  debugger.
This commit is contained in:
Bernhard Kirchen 2023-08-10 13:39:21 +02:00 committed by GitHub
parent 1100f10c99
commit b7214161b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,13 +114,9 @@
</div>
</div>
</div>
<VedirectView v-show="liveData.vedirect.enabled" />
<div v-show="liveData.battery.enabled" >
<BatteryView/>
</div>
<div v-show="liveData.huawei.enabled" >
<HuaweiView/>
</div>
<VedirectView v-if="liveData.vedirect.enabled" />
<BatteryView v-if="liveData.battery.enabled" />
<HuaweiView v-if="liveData.huawei.enabled" />
</BasePage>
<div class="modal" id="eventView" tabindex="-1">