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') }}