Add console command history (#7483, #8015)

Add console command history (#7483, #8015)
This commit is contained in:
Theo Arends 2020-03-29 15:35:58 +02:00
parent 397fea3bb2
commit 257dd18796
3 changed files with 4 additions and 2 deletions

View File

@ -62,3 +62,4 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
- Add support for unreachable (unplugged) Zigbee devices in Philips Hue emulation and Alexa
- Add support for 64x48 SSD1306 OLED (#6740)
- Add support for up to four MQTT GroupTopics using the same optional Device Group names (#8014)
- Add console command history (#7483, #8015)

View File

@ -3,6 +3,7 @@
### 8.2.0.2 20200328
- Add support for up to four MQTT GroupTopics using the same optional Device Group names (#8014)
- Add console command history (#7483, #8015)
### 8.2.0.1 20200321

View File

@ -213,12 +213,12 @@ const char HTTP_SCRIPT_CONSOL[] PROGMEM =
"}"
// Console command history - part 2
"var mh=20,hc=[],cn=0;"
"var hc=[],cn=0;" // hc = History commands, cn = Number of history being shown
"function cH(a){"
"var b=qs('#c1'),c=a.keyCode;" // c1 = Console command id
"38==c?(++cn>hc.length&&(cn=hc.length),b.value=hc[cn-1]||''):" // Arrow Up
"40==c?(0>--cn&&(cn=0),b.value=hc[cn-1]||''):" // Arrow Down
"13==c&&(hc.length>19&&hc.pop(),hc.unshift(b.value),cn=0)" // Enter
"13==c&&(hc.length>19&&hc.pop(),hc.unshift(b.value),cn=0)" // Enter, 19 = Max number -1 of commands in history
"}"
"wl(l);";