Skip to content

Commit aecc0f7

Browse files
TobiasSchaffnerchombourger
authored andcommitted
chore(www): Only show console and video windows if used
Signed-off-by: Tobias Schaffner <[email protected]>
1 parent 554a604 commit aecc0f7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

mtda/templates/index.html

+10-2
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@
9292
html: "<div id=console></div>",
9393
class: ["no-close", "no-full", "no-max", "modern"],
9494
width: "640px",
95-
height: "480px"
95+
height: "480px",
96+
hidden: true,
9697
});
9798
videoWindow = new WinBox("Video", {
9899
html: "<div id=video></div>",
99100
class: ["no-close", "no-full", "no-max", "modern"],
100101
width: "1360px",
101-
height: "768px"
102+
height: "768px",
103+
hidden: true,
102104
});
103105
consoleWindow.focus()
104106
</script>
@@ -161,6 +163,9 @@
161163

162164
socket.on("console-output", function (data) {
163165
if (data.output != null) {
166+
if (consoleWindow.hidden) {
167+
consoleWindow.show();
168+
}
164169
term.write(data.output);
165170
}
166171
});
@@ -171,6 +176,9 @@
171176

172177
import { vnc_load } from './assets/vnc.js'
173178
socket.on("video-info", function (info) {
179+
if (videoWindow.hidden) {
180+
videoWindow.show();
181+
}
174182
if (info.format == 'VNC') {
175183
vnc_load()
176184
}

0 commit comments

Comments
 (0)