Show several hints and tips at Live View
This contains the following information: * No connection to the NRF module possible * No time set * Default password used
This commit is contained in:
parent
854af4649c
commit
f8b601f871
@ -5,6 +5,7 @@
|
|||||||
#include "WebApi_ws_live.h"
|
#include "WebApi_ws_live.h"
|
||||||
#include "AsyncJson.h"
|
#include "AsyncJson.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
#include "defaults.h"
|
||||||
|
|
||||||
WebApiWsLiveClass::WebApiWsLiveClass()
|
WebApiWsLiveClass::WebApiWsLiveClass()
|
||||||
: _ws("/livedata")
|
: _ws("/livedata")
|
||||||
@ -150,6 +151,16 @@ void WebApiWsLiveClass::generateJsonResponse(JsonVariant& root)
|
|||||||
addTotalField(totalObj, "Power", totalPower, "W", 1);
|
addTotalField(totalObj, "Power", totalPower, "W", 1);
|
||||||
addTotalField(totalObj, "YieldDay", totalYieldDay, "Wh", 0);
|
addTotalField(totalObj, "YieldDay", totalYieldDay, "Wh", 0);
|
||||||
addTotalField(totalObj, "YieldTotal", totalYieldTotal, "kWh", 2);
|
addTotalField(totalObj, "YieldTotal", totalYieldTotal, "kWh", 2);
|
||||||
|
|
||||||
|
JsonObject hintObj = root.createNestedObject("hints");
|
||||||
|
struct tm timeinfo;
|
||||||
|
hintObj[F("time_sync")] = !getLocalTime(&timeinfo, 5);
|
||||||
|
hintObj[F("radio_problem")] = (!Hoymiles.getRadio()->isConnected() || !Hoymiles.getRadio()->isPVariant());
|
||||||
|
if (!strcmp(Configuration.get().Security_Password, ACCESS_POINT_PASSWORD)) {
|
||||||
|
hintObj[F("default_password")] = true;
|
||||||
|
} else {
|
||||||
|
hintObj[F("default_password")] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebApiWsLiveClass::addField(JsonObject& root, uint8_t idx, std::shared_ptr<InverterAbstract> inv, uint8_t channel, uint8_t fieldId, String topic)
|
void WebApiWsLiveClass::addField(JsonObject& root, uint8_t idx, std::shared_ptr<InverterAbstract> inv, uint8_t channel, uint8_t fieldId, String topic)
|
||||||
|
|||||||
50
webapp/src/components/HintView.vue
Normal file
50
webapp/src/components/HintView.vue
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<template>
|
||||||
|
<BootstrapAlert :show="hints.radio_problem" variant="danger">
|
||||||
|
<BIconBroadcast class="fs-4" /> Could not connect to a correct NRF24L01+ radio module. Please check the wiring.
|
||||||
|
</BootstrapAlert>
|
||||||
|
|
||||||
|
<BootstrapAlert :show="hints.time_sync" variant="danger">
|
||||||
|
<BIconClock class="fs-4" /> The clock has not yet been synchronised. Without a
|
||||||
|
correctly set clock, no requests are made to the inverter. This is normal shortly after the start. However,
|
||||||
|
after a longer runtime (>1 minute), it indicates that the NTP server is not accessible. <a
|
||||||
|
@click="gotoTimeSettings" href="#" class="alert-link">Please check your time
|
||||||
|
settings.</a>
|
||||||
|
</BootstrapAlert>
|
||||||
|
|
||||||
|
<BootstrapAlert :show="hints.default_password" variant="danger">
|
||||||
|
<BIconExclamationCircle class="fs-4" /> You are using the default password for the web interface and the
|
||||||
|
emergency access point. This is potentially insecure. <a @click="gotoPasswordSettings" href="#"
|
||||||
|
class="alert-link">Please change the password.</a>
|
||||||
|
</BootstrapAlert>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, type PropType } from 'vue';
|
||||||
|
import type { Hints } from '@/types/LiveDataStatus';
|
||||||
|
import BootstrapAlert from '@/components/BootstrapAlert.vue';
|
||||||
|
import {
|
||||||
|
BIconClock,
|
||||||
|
BIconExclamationCircle,
|
||||||
|
BIconBroadcast,
|
||||||
|
} from 'bootstrap-icons-vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
components: {
|
||||||
|
BootstrapAlert,
|
||||||
|
BIconClock,
|
||||||
|
BIconExclamationCircle,
|
||||||
|
BIconBroadcast,
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
hints: { type: Object as PropType<Hints>, required: true },
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
gotoTimeSettings() {
|
||||||
|
this.$router.push("/settings/ntp");
|
||||||
|
},
|
||||||
|
gotoPasswordSettings() {
|
||||||
|
this.$router.push("/settings/security");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@ -38,7 +38,14 @@ export interface Total {
|
|||||||
YieldTotal: ValueObject;
|
YieldTotal: ValueObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export interface Hints {
|
||||||
|
time_sync: boolean;
|
||||||
|
default_password: boolean;
|
||||||
|
radio_problem: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
export interface LiveData {
|
export interface LiveData {
|
||||||
inverters: Inverter[];
|
inverters: Inverter[];
|
||||||
total: Total;
|
total: Total;
|
||||||
|
hints: Hints;
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<BasePage :title="'Live Data'" :isLoading="dataLoading" :isWideScreen="true">
|
<BasePage :title="'Live Data'" :isLoading="dataLoading" :isWideScreen="true">
|
||||||
|
<HintView :hints="liveData.hints" />
|
||||||
<InverterTotalInfo :totalData="liveData.total" /><br />
|
<InverterTotalInfo :totalData="liveData.total" /><br />
|
||||||
<div class="row gy-3">
|
<div class="row gy-3">
|
||||||
<div class="col-sm-3 col-md-2" :style="[inverterData.length == 1 ? { 'display': 'none' } : {}]">
|
<div class="col-sm-3 col-md-2" :style="[inverterData.length == 1 ? { 'display': 'none' } : {}]">
|
||||||
@ -335,6 +336,7 @@ import DevInfo from '@/components/DevInfo.vue';
|
|||||||
import BootstrapAlert from '@/components/BootstrapAlert.vue';
|
import BootstrapAlert from '@/components/BootstrapAlert.vue';
|
||||||
import InverterChannelInfo from "@/components/InverterChannelInfo.vue";
|
import InverterChannelInfo from "@/components/InverterChannelInfo.vue";
|
||||||
import InverterTotalInfo from '@/components/InverterTotalInfo.vue';
|
import InverterTotalInfo from '@/components/InverterTotalInfo.vue';
|
||||||
|
import HintView from '@/components/HintView.vue';
|
||||||
import type { DevInfoStatus } from '@/types/DevInfoStatus';
|
import type { DevInfoStatus } from '@/types/DevInfoStatus';
|
||||||
import type { EventlogItems } from '@/types/EventlogStatus';
|
import type { EventlogItems } from '@/types/EventlogStatus';
|
||||||
import type { LiveData, Inverter } from '@/types/LiveDataStatus';
|
import type { LiveData, Inverter } from '@/types/LiveDataStatus';
|
||||||
@ -348,6 +350,7 @@ export default defineComponent({
|
|||||||
BasePage,
|
BasePage,
|
||||||
InverterChannelInfo,
|
InverterChannelInfo,
|
||||||
InverterTotalInfo,
|
InverterTotalInfo,
|
||||||
|
HintView,
|
||||||
EventLog,
|
EventLog,
|
||||||
DevInfo,
|
DevInfo,
|
||||||
BootstrapAlert,
|
BootstrapAlert,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user