webapp: Added cmt radio status to system overview
This commit is contained in:
parent
46036eb958
commit
c19d2007bd
@ -69,8 +69,12 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
root["uptime"] = esp_timer_get_time() / 1000000;
|
root["uptime"] = esp_timer_get_time() / 1000000;
|
||||||
|
|
||||||
root["radio_connected"] = Hoymiles.getRadioNrf()->isConnected();
|
root["nrf_configured"] = Hoymiles.getRadioNrf()->isInitialized();
|
||||||
root["radio_pvariant"] = Hoymiles.getRadioNrf()->isPVariant();
|
root["nrf_connected"] = Hoymiles.getRadioNrf()->isConnected();
|
||||||
|
root["nrf_pvariant"] = Hoymiles.getRadioNrf()->isPVariant();
|
||||||
|
|
||||||
|
root["cmt_configured"] = Hoymiles.getRadioCmt()->isInitialized();
|
||||||
|
root["cmt_connected"] = Hoymiles.getRadioCmt()->isConnected();
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
@ -4,27 +4,61 @@
|
|||||||
<table class="table table-hover table-condensed">
|
<table class="table table-hover table-condensed">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ $t('radioinfo.ChipStatus') }}</th>
|
<th>{{ $t('radioinfo.Status', { module: "nRF24" }) }}</th>
|
||||||
<td>
|
<td>
|
||||||
<StatusBadge :status="systemStatus.radio_connected" true_text="radioinfo.Connected" false_text="radioinfo.NotConnected" />
|
<StatusBadge :status="systemStatus.nrf_configured" true_text="radioinfo.Configured" false_text="radioinfo.NotConfigured" false_class="text-bg-secondary" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ $t('radioinfo.ChipType') }}</th>
|
<th>{{ $t('radioinfo.ChipStatus', { module: "nRF24" }) }}</th>
|
||||||
<td>
|
<td>
|
||||||
<span class="badge" :class="{
|
<span class="badge" :class="{
|
||||||
'text-bg-danger': systemStatus.radio_connected && !systemStatus.radio_pvariant,
|
'text-bg-danger': systemStatus.nrf_configured && !systemStatus.nrf_connected,
|
||||||
'text-bg-success': systemStatus.radio_connected && systemStatus.radio_pvariant,
|
'text-bg-success': systemStatus.nrf_configured && systemStatus.nrf_connected,
|
||||||
'text-bg-secondary': !systemStatus.radio_connected,
|
|
||||||
}">
|
}">
|
||||||
<template
|
<template
|
||||||
v-if="systemStatus.radio_connected && systemStatus.radio_pvariant">nRF24L01+</template>
|
v-if="systemStatus.nrf_configured && systemStatus.nrf_connected">{{ $t('radioinfo.Connected') }}</template>
|
||||||
<template
|
<template
|
||||||
v-else-if="systemStatus.radio_connected && !systemStatus.radio_pvariant">nRF24L01</template>
|
v-else-if="systemStatus.nrf_configured && !systemStatus.nrf_connected">{{ $t('radioinfo.NotConnected') }}</template>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{ $t('radioinfo.ChipType', { module: "nRF24" }) }}</th>
|
||||||
|
<td>
|
||||||
|
<span class="badge" :class="{
|
||||||
|
'text-bg-danger': systemStatus.nrf_connected && !systemStatus.nrf_pvariant,
|
||||||
|
'text-bg-success': systemStatus.nrf_connected && systemStatus.nrf_pvariant,
|
||||||
|
'text-bg-secondary': !systemStatus.nrf_connected,
|
||||||
|
}">
|
||||||
|
<template
|
||||||
|
v-if="systemStatus.nrf_connected && systemStatus.nrf_pvariant">nRF24L01+</template>
|
||||||
|
<template
|
||||||
|
v-else-if="systemStatus.nrf_connected && !systemStatus.nrf_pvariant">nRF24L01</template>
|
||||||
<template v-else>{{ $t('radioinfo.Unknown') }}</template>
|
<template v-else>{{ $t('radioinfo.Unknown') }}</template>
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{ $t('radioinfo.Status', { module: "CMT2300a" }) }}</th>
|
||||||
|
<td>
|
||||||
|
<StatusBadge :status="systemStatus.cmt_configured" true_text="radioinfo.Configured" false_text="radioinfo.NotConfigured" false_class="text-bg-secondary" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{{ $t('radioinfo.ChipStatus', { module: "CMT2300a" }) }}</th>
|
||||||
|
<td>
|
||||||
|
<span class="badge" :class="{
|
||||||
|
'text-bg-danger': systemStatus.cmt_configured && !systemStatus.cmt_connected,
|
||||||
|
'text-bg-success': systemStatus.cmt_configured && systemStatus.cmt_connected,
|
||||||
|
}">
|
||||||
|
<template
|
||||||
|
v-if="systemStatus.cmt_configured && systemStatus.cmt_connected">{{ $t('radioinfo.Connected') }}</template>
|
||||||
|
<template
|
||||||
|
v-else-if="systemStatus.cmt_configured && !systemStatus.cmt_connected">{{ $t('radioinfo.NotConnected') }}</template>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -187,10 +187,13 @@
|
|||||||
},
|
},
|
||||||
"radioinfo": {
|
"radioinfo": {
|
||||||
"RadioInformation": "Funkmodulinformationen",
|
"RadioInformation": "Funkmodulinformationen",
|
||||||
"ChipStatus": "Chip-Status",
|
"Status": "{module} Status",
|
||||||
"ChipType": "Chip-Typ",
|
"ChipStatus": "{module} Chip-Status",
|
||||||
|
"ChipType": "{module} Chip-Type",
|
||||||
"Connected": "verbunden",
|
"Connected": "verbunden",
|
||||||
"NotConnected": "nicht verbunden",
|
"NotConnected": "nicht verbunden",
|
||||||
|
"Configured": "konfiguriert",
|
||||||
|
"NotConfigured": "nicht konfiguriert",
|
||||||
"Unknown": "unbekannt"
|
"Unknown": "unbekannt"
|
||||||
},
|
},
|
||||||
"networkinfo": {
|
"networkinfo": {
|
||||||
|
|||||||
@ -187,10 +187,13 @@
|
|||||||
},
|
},
|
||||||
"radioinfo": {
|
"radioinfo": {
|
||||||
"RadioInformation": "Radio Information",
|
"RadioInformation": "Radio Information",
|
||||||
"ChipStatus": "Chip Status",
|
"Status": "{module} Status",
|
||||||
"ChipType": "Chip Type",
|
"ChipStatus": "{module} Chip Status",
|
||||||
|
"ChipType": "{module} Chip Type",
|
||||||
"Connected": "connected",
|
"Connected": "connected",
|
||||||
"NotConnected": "not connected",
|
"NotConnected": "not connected",
|
||||||
|
"Configured": "configured",
|
||||||
|
"NotConfigured": "not configured",
|
||||||
"Unknown": "Unknown"
|
"Unknown": "Unknown"
|
||||||
},
|
},
|
||||||
"networkinfo": {
|
"networkinfo": {
|
||||||
|
|||||||
@ -187,10 +187,13 @@
|
|||||||
},
|
},
|
||||||
"radioinfo": {
|
"radioinfo": {
|
||||||
"RadioInformation": "Informations sur la radio",
|
"RadioInformation": "Informations sur la radio",
|
||||||
"ChipStatus": "État de la puce",
|
"Status": "{module} Status",
|
||||||
"ChipType": "Type de puce",
|
"ChipStatus": "{module} sÉtat de la puce",
|
||||||
|
"ChipType": "{module} Type de puce",
|
||||||
"Connected": "connectée",
|
"Connected": "connectée",
|
||||||
"NotConnected": "non connectée",
|
"NotConnected": "non connectée",
|
||||||
|
"Configured": "configured",
|
||||||
|
"NotConfigured": "not configured",
|
||||||
"Unknown": "Inconnue"
|
"Unknown": "Inconnue"
|
||||||
},
|
},
|
||||||
"networkinfo": {
|
"networkinfo": {
|
||||||
|
|||||||
@ -25,6 +25,9 @@ export interface SystemStatus {
|
|||||||
sketch_total: number;
|
sketch_total: number;
|
||||||
sketch_used: number;
|
sketch_used: number;
|
||||||
// RadioInfo
|
// RadioInfo
|
||||||
radio_connected: boolean;
|
nrf_configured: boolean;
|
||||||
radio_pvariant: boolean;
|
nrf_connected: boolean;
|
||||||
|
nrf_pvariant: boolean;
|
||||||
|
cmt_configured: boolean;
|
||||||
|
cmt_connected: boolean;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user