webapp: Show NRF24 connection status
This commit is contained in:
parent
64ae87faf1
commit
20b799b630
@ -161,6 +161,11 @@ bool HoymilesRadio::isIdle()
|
|||||||
return !_busyFlag;
|
return !_busyFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HoymilesRadio::isConnected()
|
||||||
|
{
|
||||||
|
return _radio->isChipConnected();
|
||||||
|
}
|
||||||
|
|
||||||
void HoymilesRadio::openReadingPipe()
|
void HoymilesRadio::openReadingPipe()
|
||||||
{
|
{
|
||||||
serial_u s;
|
serial_u s;
|
||||||
|
|||||||
@ -46,6 +46,7 @@ public:
|
|||||||
void setDtuSerial(uint64_t serial);
|
void setDtuSerial(uint64_t serial);
|
||||||
|
|
||||||
bool isIdle();
|
bool isIdle();
|
||||||
|
bool isConnected();
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T* enqueCommand()
|
T* enqueCommand()
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
#include "AsyncJson.h"
|
#include "AsyncJson.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "NetworkSettings.h"
|
#include "NetworkSettings.h"
|
||||||
|
#include <Hoymiles.h>
|
||||||
#include <LittleFS.h>
|
#include <LittleFS.h>
|
||||||
#include <ResetReason.h>
|
#include <ResetReason.h>
|
||||||
|
|
||||||
@ -64,6 +65,8 @@ void WebApiSysstatusClass::onSystemStatus(AsyncWebServerRequest* request)
|
|||||||
|
|
||||||
root[F("uptime")] = esp_timer_get_time() / 1000000;
|
root[F("uptime")] = esp_timer_get_time() / 1000000;
|
||||||
|
|
||||||
|
root[F("radio_connected")] = Hoymiles.getRadio()->isConnected();
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
}
|
}
|
||||||
@ -17,6 +17,8 @@
|
|||||||
<div class="mt-5"></div>
|
<div class="mt-5"></div>
|
||||||
<MemoryInfo v-bind="systemDataList" />
|
<MemoryInfo v-bind="systemDataList" />
|
||||||
<div class="mt-5"></div>
|
<div class="mt-5"></div>
|
||||||
|
<RadioInfo v-bind="systemDataList" />
|
||||||
|
<div class="mt-5"></div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -26,12 +28,14 @@ import { defineComponent } from 'vue';
|
|||||||
import HardwareInfo from "@/components/partials/HardwareInfo.vue";
|
import HardwareInfo from "@/components/partials/HardwareInfo.vue";
|
||||||
import FirmwareInfo from "@/components/partials/FirmwareInfo.vue";
|
import FirmwareInfo from "@/components/partials/FirmwareInfo.vue";
|
||||||
import MemoryInfo from "@/components/partials/MemoryInfo.vue";
|
import MemoryInfo from "@/components/partials/MemoryInfo.vue";
|
||||||
|
import RadioInfo from "@/components/partials/RadioInfo.vue";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
HardwareInfo,
|
HardwareInfo,
|
||||||
FirmwareInfo,
|
FirmwareInfo,
|
||||||
MemoryInfo,
|
MemoryInfo,
|
||||||
|
RadioInfo,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -60,7 +64,9 @@ export default defineComponent({
|
|||||||
littlefs_total: 0,
|
littlefs_total: 0,
|
||||||
littlefs_used: 0,
|
littlefs_used: 0,
|
||||||
sketch_total: 0,
|
sketch_total: 0,
|
||||||
sketch_used: 0
|
sketch_used: 0,
|
||||||
|
// RadioInfo
|
||||||
|
radio_connected: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
35
webapp/src/components/partials/RadioInfo.vue
Normal file
35
webapp/src/components/partials/RadioInfo.vue
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header text-white bg-primary">
|
||||||
|
Radio Information
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-hover table-condensed">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>Chip Status</th>
|
||||||
|
<td class="badge" :class="{
|
||||||
|
'bg-danger': !radio_connected,
|
||||||
|
'bg-success': radio_connected,
|
||||||
|
}">
|
||||||
|
<span v-if="radio_connected">connected</span>
|
||||||
|
<span v-else>not connected</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent } from 'vue';
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
radio_connected: { type: Boolean, required: true },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user