Hide Victron Ve.direct UI elements from Live page when disabled

Resolves #91
This commit is contained in:
Bernhard Kaszt 2023-03-08 19:54:19 +01:00
parent 1e6e40a3ab
commit a66f818e75
3 changed files with 10 additions and 2 deletions

View File

@ -180,6 +180,9 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root)
} else { } else {
hintObj[F("default_password")] = false; hintObj[F("default_password")] = false;
} }
JsonObject vedirectObj = root.createNestedObject("vedirect");
vedirectObj[F("enabled")] = Configuration.get().Vedirect_Enabled;
} }
void WebApiWsLiveClass::addField(JsonObject& root, uint8_t idx, std::shared_ptr<InverterAbstract> inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId, String topic) void WebApiWsLiveClass::addField(JsonObject& root, uint8_t idx, std::shared_ptr<InverterAbstract> inv, ChannelType_t type, ChannelNum_t channel, FieldId_t fieldId, String topic)

View File

@ -46,8 +46,13 @@ export interface Hints {
radio_problem: boolean; radio_problem: boolean;
} }
export interface Vedirect {
enabled: boolean;
}
export interface LiveData { export interface LiveData {
inverters: Inverter[]; inverters: Inverter[];
total: Total; total: Total;
hints: Hints; hints: Hints;
vedirect: Vedirect;
} }

View File

@ -111,7 +111,7 @@
</div> </div>
</div> </div>
</div> </div>
<VedirectView /> <VedirectView v-show="liveData.vedirect.enabled" />
</BasePage> </BasePage>
<div class="modal" id="eventView" tabindex="-1"> <div class="modal" id="eventView" tabindex="-1">