Zigbee grey buttons when not started

This commit is contained in:
Stephan Hadinger 2022-09-09 23:51:52 +02:00
parent 40e5b9f7d1
commit edb0a8af9c
1 changed files with 12 additions and 4 deletions

View File

@ -2077,7 +2077,14 @@ const char HTTP_ZB_VERSION[] PROGMEM =
const char HTTP_BTN_ZB_BUTTONS[] PROGMEM =
"<button onclick='la(\"&zbj=1\");'>" D_ZIGBEE_PERMITJOIN "</button>"
"<p></p>"
"<form action='zbm' method='get'><button>" D_ZIGBEE_MAP "</button></form>";
"<a href='zbm'><button>" D_ZIGBEE_MAP "</button></a>"
"<p></p>";
const char HTTP_BTN_ZB_BUTTONS_DISABLED[] PROGMEM =
"<button style='background-color:#%06X' disabled>" D_ZIGBEE_PERMITJOIN "</button>"
"<p></p>"
"<button style='background-color:#%06X' disabled>" D_ZIGBEE_MAP "</button>"
"<p></p>";
void ZigbeeShow(bool json)
{
@ -2275,6 +2282,10 @@ void ZigbeeShow(bool json)
WSContentSend_P(HTTP_ZB_VERSION,
zigbee.major_rel, zigbee.minor_rel,
zigbee.maint_rel, zigbee.revision);
WSContentSend_P(HTTP_BTN_ZB_BUTTONS);
} else {
uint32_t grey = WebColor(COL_FORM);
WSContentSend_P(HTTP_BTN_ZB_BUTTONS_DISABLED, grey, grey);
}
#endif
}
@ -2366,9 +2377,6 @@ bool Xdrv23(uint8_t function) {
WebServer_on(PSTR("/zbm"), ZigbeeShowMap, HTTP_GET); // add web handler for Zigbee map
WebServer_on(PSTR("/zbr"), ZigbeeMapRefresh, HTTP_GET); // add web handler for Zigbee map refresh
break;
case FUNC_WEB_ADD_MAIN_BUTTON:
WSContentSend_P(HTTP_BTN_ZB_BUTTONS);
break;
#endif // USE_WEBSERVER
case FUNC_PRE_INIT:
ZigbeeInit();