From 32c67789dd3aa64f9b35b27a88329e8d5aa6cd40 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 26 Apr 2021 12:00:45 +0200 Subject: [rebootcontrol] Simple support for displaying SVG from stdout --- modules-available/rebootcontrol/templates/status-exec.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules-available/rebootcontrol') diff --git a/modules-available/rebootcontrol/templates/status-exec.html b/modules-available/rebootcontrol/templates/status-exec.html index 403b7fca..01da6bbb 100644 --- a/modules-available/rebootcontrol/templates/status-exec.html +++ b/modules-available/rebootcontrol/templates/status-exec.html @@ -57,6 +57,13 @@ function updateStatusClient(id, status) { $p.find('.exitCode').text(status.exitCode).addClass((status.exitCode === 0 ? 'text-success' : 'text-danger')); } ignoreHosts[id] = true; + var txt = status.stdout.trim(); + if (txt.startsWith('<') && txt.endsWith('')) { + var $i = $(''); + $i[0].src = 'data:image/svg+xml,' + encodeURIComponent(txt); + $p.find('.stdout').hide(); + $p.append($i); + } } } -- cgit v1.2.3-55-g7522