From 257dd1879611a08090eaa2e3fe9d5bb464bf34a9 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 29 Mar 2020 15:35:58 +0200 Subject: [PATCH] Add console command history (#7483, #8015) Add console command history (#7483, #8015) --- RELEASENOTES.md | 1 + tasmota/CHANGELOG.md | 1 + tasmota/xdrv_01_webserver.ino | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index da5dd225f..9e22461e2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -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) diff --git a/tasmota/CHANGELOG.md b/tasmota/CHANGELOG.md index fa969d778..1d9d2e919 100644 --- a/tasmota/CHANGELOG.md +++ b/tasmota/CHANGELOG.md @@ -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 diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index e4336b736..308fd5ed9 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -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);";