diff options
author | Simon Rettberg | 2021-04-26 12:00:45 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-04-26 12:00:45 +0200 |
commit | 32c67789dd3aa64f9b35b27a88329e8d5aa6cd40 (patch) | |
tree | bc18ad2bdd630bd8da818634874fa8c2dc0b86cb /modules-available | |
parent | [vmstore] Fix display of mount task status (diff) | |
download | slx-admin-32c67789dd3aa64f9b35b27a88329e8d5aa6cd40.tar.gz slx-admin-32c67789dd3aa64f9b35b27a88329e8d5aa6cd40.tar.xz slx-admin-32c67789dd3aa64f9b35b27a88329e8d5aa6cd40.zip |
[rebootcontrol] Simple support for displaying SVG from stdout
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/rebootcontrol/templates/status-exec.html | 7 |
1 files changed, 7 insertions, 0 deletions
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('</svg>')) { + var $i = $('<img class="img-responsive">'); + $i[0].src = 'data:image/svg+xml,' + encodeURIComponent(txt); + $p.find('.stdout').hide(); + $p.append($i); + } } } |