From 352b190a72a7226476750d65238f5a15089b1e63 Mon Sep 17 00:00:00 2001 From: AndyQ Date: Sun, 26 May 2019 12:49:03 +0100 Subject: [PATCH] Added button to terminal window to all log window to be cleared out --- src/octoprint/static/js/app/viewmodels/terminal.js | 8 ++++++++ src/octoprint/templates/tabs/terminal.jinja2 | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/octoprint/static/js/app/viewmodels/terminal.js b/src/octoprint/static/js/app/viewmodels/terminal.js index cd853fe25..5fecaffc9 100644 --- a/src/octoprint/static/js/app/viewmodels/terminal.js +++ b/src/octoprint/static/js/app/viewmodels/terminal.js @@ -338,6 +338,14 @@ $(function() { copyToClipboard(lines.join("\n")); }; + self.clearLogWidow = function() { + if (self.fancyFunctionality()) { + self.log([]); + } else { + self.plainLogLines([]); + } + + }; // command matching regex // (Example output for inputs G0, G1, G28.1, M117 test) // - 1: code including optional subcode. Example: G0, G1, G28.1, M117 diff --git a/src/octoprint/templates/tabs/terminal.jinja2 b/src/octoprint/templates/tabs/terminal.jinja2 index 4ecded92b..e1284eb22 100644 --- a/src/octoprint/templates/tabs/terminal.jinja2 +++ b/src/octoprint/templates/tabs/terminal.jinja2 @@ -13,7 +13,8 @@ ({{ _("Scroll to end") }}) - {{ _('Copy all') }} + {{ _('Copy all') }}
+ {{ _('Clear log widow') }}